]> git.mxchange.org Git - simgear.git/commitdiff
scenery: Only run SGModelData in the topmost model.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Wed, 28 Mar 2012 05:44:41 +0000 (07:44 +0200)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Wed, 28 Mar 2012 05:44:41 +0000 (07:44 +0200)
It looks like that we loose the nasal script stored
in the property tree when this callback is issued
multiple times.

This should fix
 http://code.google.com/p/flightgear-bugs/issues/detail?id=714

simgear/scene/model/SGReaderWriterXML.cxx

index 17f23bc75877e553919db0a6bfb57caee24e3168..17c51dd9d91ceb93f921b277a0cb71e496d008c7 100644 (file)
@@ -218,7 +218,9 @@ sgLoad3DModel_internal(const SGPath& path,
     SGSharedPtr<SGPropertyNode> prop_root = options->getPropertyNode();
     if (!prop_root.valid())
         prop_root = new SGPropertyNode;
+    // The model data appear to be only used in the topmost model
     osg::ref_ptr<SGModelData> data = options->getModelData();
+    options->setModelData(0);
     
     osg::ref_ptr<osg::Node> model;
     osg::ref_ptr<osg::Group> group;