[SOLVED] Multiple parent nodes?

I’m using get_surface_point to get the point on a node, in the objects reference frame.
Here is some of the code.

NodePath node = entry->get_into_node_path();
LPoint3f pt = entry->get_surface_point(node.node());

And on the second line, every time I call it, I get this error message

:pgraph(warning): ModelRoot node has 2 parents; choosing arbitrary path to root.
:pgraph(warning): Chose: render/node

But everything still works ok. And when I run node.ls(), I only see one parent (of course?). Why am I getting this error? And how can I suppress it?


It means node.node() (or one of its ancestors) has multiple parents–the node is instanced repeatedly in the scene graph.

To avoid this message, don’t use instancing.

Or, just use entry->get_surface_point(node), which is the correct way to call get_surface_point() anyway. You want to pass it a NodePath, not the PandaNode it references. A NodePath is by its nature unambiguous even in the presence of instancing, while a PandaNode is ambiguous.

The warning message is telling you that Panda internally made an arbitrary decision to resolve the ambiguity. It’s not necessarily a problem, but it means that the answer may not always be right, depending on what path it happened to choose.


aahhh, thanks, must have misread the api