How would i clear a textures from a node path?

How would i clear a textures from a node path?

I tried:


        print "at=",sn.node().getAttrib(TextureAttrib.getClassType())

        for ts in sn.findAllTextureStages():
            print "texture stage found:",ts

        for c in sn.findAllMatches("**/*"):
            print "child found:",c

But nothing helps, Node still says:

GeomNode  (1 geoms: S:(TextureAttrib)) E:(ShowBoundsEffect)

It does not look like the Geoms can have textures and it does not look like it gets applied from above because its shown in the ls definition.

You’re seeing the per-Geom TextureAttrib that is stored within the GeomNode itself. If you really want to remove it completely, you have to get to the Geom and strip it off by hand, e.g.:

for c in sn.findAllMatches("**/+GeomNode"):
  gn = c.node()
  for i in range(gn.getNumGeoms()):
    state = gn.getGeomState(i)
    state = state.removeAttrib(TextureAttrib.getClassType())
    gn.setGeomState(i, state)

But you rarely need to go through that much trouble. If all you want is to make the geometry untextured, you can do that with an override:



Thanks! I really want to strip the all of the textures this been great help.

You can also do:


Which applies the off texture attribute onto the Geoms, effectively removing the existing texture attributes from the Geom and replacing them with the off attribute, in just two lines of code. There are other side-effects of this approach, though (like the fact that an override value of 1 also gets flattened down with the off attribute, requiring a higher override in the future).