From: mfranz Date: Thu, 9 Oct 2008 22:20:33 +0000 (+0000) Subject: if a model XML file contains a block, copy its contents X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=98a3e7cffa79bb68e0c48a8f2fcfc978bcb25d5e;p=simgear.git if a model XML file contains a block, copy its contents to the model's property root (/ai/models/multiplayer[*]) --- diff --git a/simgear/scene/model/SGReaderWriterXML.cxx b/simgear/scene/model/SGReaderWriterXML.cxx index 2d48e7e2..2ceb0f89 100644 --- a/simgear/scene/model/SGReaderWriterXML.cxx +++ b/simgear/scene/model/SGReaderWriterXML.cxx @@ -135,8 +135,8 @@ sgLoad3DModel_internal(const string &path, { if ( !prop_root ) { SG_LOG(SG_GENERAL, SG_ALERT, "prop_root NULL: " << path); - } + string fg_root=osgDB::Registry::instance()->getDataFilePathList().front(); osg::ref_ptr model; osg::ref_ptr group; @@ -168,6 +168,10 @@ sgLoad3DModel_internal(const string &path, } else { model = new osg::Node; } + + SGPropertyNode *mp = props->getNode("multiplayer"); + if (mp && prop_root && prop_root->getParent()) + copyProperties(mp, prop_root); } osg::ref_ptr options