2009/1/3 Simon Hammett <[email protected]>:
> 2009/1/2 Ryan Morris <[email protected]>:
>> Just to be clear, would something like:
>>
>> osg::Node *node = osgDB::readNodeFile("file.osg");
>> osg::Geode *geode = osg::dynamic_cast<osg::Geode>node;
>>
>> geode->getDrawable()->setName("New name");
>>
>> should work? (syntax might be a little off I'm not at my home system right
>> now).
>>
>
> Well it will work if the root of the scene is a geode,
> which is extremely unlikely for any non-trivial scene graph.
>
> It's much more likely that the root will be a class which derives
> from osg::Group
>
Doh. Should be:
geode->getDrawable( 0 )->setName("New name");
Or better yet:
for(unsigned i = 0, iC = geode->getNumDrawables(); i != iC; ++i )
geode->getDrawable( i )->setName( GenerateName( i ) );
--
The truth is out there. Usually in header files.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org