Has my node been binned?

I’m trying to check on the cull-bin and sort-order of certain nodes, and I’m finding myself stuck.

I have certain nodes, loaded as part of a model, than include “static”-tags that should assign them to specific culling-bins, with specific sorting-orders. However, I’m not finding any way of reading this state once they’re loaded.

Calls to “NodePath.getBinName()” and “NodePath.getBinDrawOrder()” return “” and 0, respectively. On the other hand, calling “NodePath.ls()” indicates a GeomNode that has, amongst other things, a “CullBinAttrib”. (And checking its parent indicated no such “attrib”, I believe.) On the other hand again, “NodePath.hasAttrib(CullBinAttrib)” returns False, and “NodePath.getAttrib(CullBinAttrib)” returns None.

Looking at CullBinManager, I don’t see a way to examine which objects have been assigned to which bin there, either.

Any suggestions? :confused:

(I’m using a home-built version of 1.10, running under Ubuntu 16.04 (“Xenial”), I believe.)

The CullBinAttrib reported by the call to NodePath.ls() is most likely an attribute of the RenderState associated with a particular Geom within your GeomNode.

For example, consider the following output:

ModelRoot my_model.egg
  GeomNode model_name (1 geoms: S:(CullBinAttrib TextureAttrib)) S:(ColorAttrib TransparencyAttrib)

Here, color and transparency are associated with the “model_name” NodePath, but cull-bin and texture are directly associated with the Geom itself.

If this is similar to your case, you can retrieve the cull-bin attribute with code like this:

state = my_model.node().get_geom_state(0)
if state.has_attrib(CullBinAttrib):
    print "Cull-bin attribute:", state.get_attrib(CullBinAttrib)
else:
    print "No cull-bin attribute set"

Ah, thank you! It seems that you’re are indeed correct, and the state is set there. :slight_smile:

(And it looks like all is in order, for that matter; I’ve only checked one object, but since it’s exactly as expected, I see little reason to check the others.)