From 98a3e7cffa79bb68e0c48a8f2fcfc978bcb25d5e Mon Sep 17 00:00:00 2001 From: mfranz Date: Thu, 9 Oct 2008 22:20:33 +0000 Subject: [PATCH] if a model XML file contains a block, copy its contents to the model's property root (/ai/models/multiplayer[*]) --- simgear/scene/model/SGReaderWriterXML.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.39.5