From 191675cc797e94f160597dbc6907552cdca0d8bc Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Wed, 28 Mar 2012 07:44:41 +0200 Subject: [PATCH] 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 --- simgear/scene/model/SGReaderWriterXML.cxx | 2 ++ 1 file changed, 2 insertions(+) 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;