Merge pull request #76 from reportingsjr/master

Change name prefix in the VRML/OpenInventor exporter
This commit is contained in:
wwmayer 2016-01-13 13:54:53 +01:00
commit bf151fe5e5

View File

@ -26,6 +26,7 @@
# include <Inventor/actions/SoToVRML2Action.h> # include <Inventor/actions/SoToVRML2Action.h>
# include <Inventor/VRMLnodes/SoVRMLGroup.h> # include <Inventor/VRMLnodes/SoVRMLGroup.h>
# include <Inventor/VRMLnodes/SoVRMLParent.h> # include <Inventor/VRMLnodes/SoVRMLParent.h>
# include <Inventor/SbString.h>
#endif #endif
#include <Base/FileInfo.h> #include <Base/FileInfo.h>
@ -217,6 +218,7 @@ bool Gui::SoFCDB::writeToVRML(SoNode* node, const char* filename, bool binary)
SoToVRML2Action tovrml2; SoToVRML2Action tovrml2;
tovrml2.apply(node); tovrml2.apply(node);
SoVRMLGroup* vrmlRoot = tovrml2.getVRML2SceneGraph(); SoVRMLGroup* vrmlRoot = tovrml2.getVRML2SceneGraph();
vrmlRoot->setInstancePrefix(SbString("o"));
vrmlRoot->ref(); vrmlRoot->ref();
std::string buffer = SoFCDB::writeNodesToString(vrmlRoot); std::string buffer = SoFCDB::writeNodesToString(vrmlRoot);
vrmlRoot->unref(); // release the memory as soon as possible vrmlRoot->unref(); // release the memory as soon as possible