Hi,
I wanted to apply an action to all subnodes of render, so I used this code:
for i in range(render.getNumChildren()):
child = render.getChild(i)
...
But it errors out at the render.getChild(i) line. It gives this assertion:
Assertion failed: n >= 0 && n < get_num_children(current_thread) at line 387 of panda/src/pgraph/nodePath.I
Which is incorrect, because getNumChildren returns 5 and range(getNumChildren) returns [0,1,2,3,4], so that perfectly fits the assertion.
I’ve looked at the source of nodePath.I, but I don’t see anything suspicious there… I must be making a very silly mistake but can’t see it.
PS. Yeah, iterating getChildren().asList() works fine. Just found out about that.