Hi everybody! I am new to OSG and this is my first posting to OSG users. I have some problems to retrieve the textures from a .flt model and would like to know what I'm doing wrong.
In main, the model is loaded in this way: osg::Group* Ground = dynamic_cast<osg::Group*> (osgDB::readNodeFile("C:/Program/Multigen-Paradigm/creator_3_2/tutorials/DesktopTutor/Models/arena.flt")); I use a node visitor to find all geodes in the scenegraph "Ground" and the apply function looks like this: for (unsigned int i=0; i<currentGeode.getNumDrawables(); ++i) { osg::StateSet* StateSet = (currentGeode.getDrawable(i))->getStateSet(); osg::Texture* Texture = dynamic_cast<osg::Texture*> (StateSet->getTextureAttribute(0, osg::StateAttribute::TEXTURE)); --- modify the texture --- } The node visitor is executed and counts the drawables, but the function getStateSet() returns the null pointer. If I use getOrCreateStateSet() instead, an empty StateSet is created. What should I do to retrieve the textures?
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org