sn.clearTexture()
sn.clearAttrib(TextureAttrib.getClassType())
sn.node().clearAttrib(TextureAttrib.getClassType())
sn.getParent().clearAttrib(TextureAttrib.getClassType())
print "at=",sn.node().getAttrib(TextureAttrib.getClassType())
for ts in sn.findAllTextureStages():
print "texture stage found:",ts
sn.clearTexture(ts)
for c in sn.findAllMatches("**/*"):
print "child found:",c
c.clearAttrib(TextureAttrib.getClassType())
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:
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).