From 49cd96cd4470467979cf618bb2e6f4bfab8754a1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 6 Dec 2006 14:17:55 +0000 Subject: [PATCH] From Rick Pingry, "n my application I am walking through the scene graph looking for nodes of a specific name. I noticed there were times when some of the nodes were not named what I had expected. Upon reviewing the code, I noticed this was happening when there was a forward reference to a parented object. The existing code uses a map with object ID's. The original code only applied the name to a node for a new ID only if the node did not already exist in the map. The problem was that there was another part of the code (when a parent was forward declared) that also created the node with the ID in the map, but it did not know its name. I simply made sure that the name was set regardless of whether or not the node was already in the map. " --- src/osgPlugins/lws/SceneLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/lws/SceneLoader.cpp b/src/osgPlugins/lws/SceneLoader.cpp index c667832e9..9c850f866 100644 --- a/src/osgPlugins/lws/SceneLoader.cpp +++ b/src/osgPlugins/lws/SceneLoader.cpp @@ -155,10 +155,10 @@ osg::Group *SceneLoader::load(const std::string &filename, const osgDB::ReaderWr osg::ref_ptr pat = pats[j]; if (!pat.valid()) { pat = new osg::PositionAttitudeTransform; - pat->setName(i->name); pats[j] = pat; } + pat->setName(i->name); pat->addChild(i->layer_node.get()); pat->setPivotPoint(options_.csf->fix_point(i->pivot));