nodepath.hasTextureOff return value

NodePath.hasTextureOff is returning a bool. (at least according to the apiref)

woudnt it make more sense if it would return the priority you that has been defined by NodePath.setTextureOff?

the same applies to setLightOff, hasLightOff.

while im on the NodePath topic already:

isnt setTextureOff supposed to disable a texture that has been inherited from a parent node.
it does disable the texture of the model itself for me.

Except that 0 is a reasonable priority to set. If you want a method that returns priority, it will have to be a different method than the one that returns a bool. But, this is not a common question; so rather than peppering NodePath with dozens of more methods, it would probably be more reasonable to use the low-level interface to query the priority, e.g. nodePath.getState().getOverride(TextureAttrib.getClassType()).

setTextureOff() with no parameters will disable all textures that have been inherited from above. setTextureOff() with a specific parameter will disable the specific texture only. Neither of them will disable a texture from a node with a higher priority (“override”) TextureAttrib.

Note that the priority is applied per node, not per texture. So if you assign multiple textures to a particular node, they all have to have the same priority.


i’ve found the bug, the texture of the shader was applied with a priority > 0, using priorities < 0 makes the shader work, and allows to remove the texture on child nodes.

got to theck the reading of priority next.