scenery: Only run SGModelData in the topmost model.

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
This commit is contained in:
Mathias Froehlich 2012-03-28 07:44:41 +02:00
parent df2e5bf39f
commit 191675cc79

View 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;