Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrEdit
Plugin troubles

wimnea
Registered User
Quote
2012-07-04 00:39:57

I'm using irrEdit (1.5) as a world editor for a project of mine and trying to write a plug in that would import terrain from a .raw file (the default terrain loader was not working for the uses I needed it for, from what i could tell, it was decreasing the size of my heightmaps by 16 on each side), and I've come across some roadblocks in my endeavors.

I was able to get the terrain loaded properly (using the example scene node as reference, and the C++ STL for the .raw file input) I tried to load a static mesh to place on my terrain, however irrEdit crashed, after a few trials i found the nodes that opened a dialog box would crash irrEdit, but the default cubes and circles worked fine. Up to this point, the heightmap was loaded without any directory modification, from the same folder that irrEdit.exe was in, so figuring, if file open dialog boxes were what was upsetting irrEdit, i would convert my code from the C++ STl to what was available in irrlight.h and irredit.h, and use their open dialogues and directory changes. however i can't seem to get it working, as just a test, i have tried to create an open dialog, dont have the actual code on me right now srry), but in the nodefactory.addSceneNode() function i used
IGUIEnvironment *env = Manager->getGUIEnvironment();
env->addFileOpenDialog();
this compiles in visual studio (express 2008) just fine, however when i run the plug in in irrEdit, it does nothing new, it loads the terrain, but i never get any sort of open dialog box.

So basically the question is "Am I missing anything that I need to create the dialog box?" and if you have any other comments regarding any possible errors that I should look into.

And Thank you in advance, for any input.


niko
Moderator
Quote
2012-07-04 20:31:52

ah, I don't think this would work either.
There is no way planned to make this work, but it would probably by this way: Let the file you want to open be in the property window, as string. Simply implement the functions

void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);


like in the deserializing function as this:
FileName = in->getAttributeAsString("FileName");


and in the serializing code like this:
out->addString("FileName", FileName.c_str());


and you are able to send a filename to your scenenode through the editor.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact