Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the ambiera forums
Not that I know of. You should be able to do it yourself in C++. You could load you .irr file, run a little bit of code on it and then write out a new .irr file with the changes. You could then load it up in irrEdit to make sure it turned out like you wanted. The following _might_ work.
ISceneNode*
ISceneNode_clone(ISceneNode* node, ISceneNode* parent, IrrlichtDevice* device)
{
// smgr needed to access node factory
ISceneManager* smgr = device->getSceneManager();
// file system needed to create new attributes
IFileSystem* fs = device->getFileSystem();
// video driver needed to load textures
IVideoDriver* driver = device->getVideoDriver();
if (!parent)
parent = smgr->getRootSceneNode();
// create a new node instance of the correct type
s32 f;
for (f = 0; f < smgr->getRegisteredSceneNodeFactoryCount(); ++f)
{
ISceneNodeFactory* factory = smgr->getSceneNodeFactory(f);
if (!factory)
continue; // just in case
ISceneNode* clone = factory->addSceneNode(node->getType(), parent);
if (clone)
{
io::IAttributes* attribs = fs->createEmptyAttributes(driver);
// serialize attributes from existing node
node->serializeAttributes(attribs);
// and use them to fill our current node
clone->deserializeAttributes(attribs);
// clean up our attribs
attribs->drop();
// return cloned node
return clone;
}
}
return 0;
}
You may have no problems trying to figure out how to copy a scene node of arbitrary type, but a lot of guys aren't quite as sharp. Someone else will want to know how to do it, and hopefully they'll find the code above to be useful...
I'm glad you got it working. To bad that IrrEdit doesn't support extension by plug-ins.