On 15/10/09 2:00 PM, Martin Scheffler wrote:
I think the idea with the visitor would work for me.
I apply this visitor to my meshes:

[code]
class StripTexturesVisitor : public osg::NodeVisitor
{
public:

    StripTexturesVisitor()
       : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
    {}

    virtual void apply(osg::Node&  node)
    {
       osg::StateSet* ss = node.getStateSet();
       if(ss != NULL)
       {
          ss->removeTextureAttribute(0, osg::StateAttribute::TEXTURE);
          ss->removeTextureAttribute(1, osg::StateAttribute::TEXTURE);
       }
       traverse(node);
    }
};
[/code]

This does not seem to work. The removeTextureAttribute method is called, but I 
can
still  see the textures on the meshes. Is this the correct way to remove the 
textures?

You're missing StateSets attached to Drawables. For this you need to handle Geodes separately and examine all of their drawables.

Cheers,
/ulrich
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to