Hi Åsa, The OpenFlight face attributes are initially attached to the face geode. If you rely on the original structure of the .flt file you should disable the post optimizer in the OpenFlight reader with the reader option preserveFace.
http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/OpenFlight Regards, Brede On Tue, Jun 17, 2008 at 8:24 AM, Engvall Åsa <[EMAIL PROTECTED]> wrote: > 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 > > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org