From: Mathias Froehlich Date: Wed, 28 Mar 2012 05:44:41 +0000 (+0200) Subject: scenery: Only run SGModelData in the topmost model. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=191675cc797e94f160597dbc6907552cdca0d8bc;p=simgear.git 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 --- diff --git a/simgear/scene/model/SGReaderWriterXML.cxx b/simgear/scene/model/SGReaderWriterXML.cxx index 17f23bc7..17c51dd9 100644 --- a/simgear/scene/model/SGReaderWriterXML.cxx +++ b/simgear/scene/model/SGReaderWriterXML.cxx @@ -218,7 +218,9 @@ sgLoad3DModel_internal(const SGPath& path, SGSharedPtr 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 data = options->getModelData(); + options->setModelData(0); osg::ref_ptr model; osg::ref_ptr group;