attachNewNode() question [SOLVED]

I notice that attachNewNode can be fed any string as it’s input. I tested this out a bit and I found out that I can attach nodes that have the same string, and they show up as multiple nodes with the same name when I print out

My question is very simple: Is there any consequence to using the same name for multiple nodes other than a search by node name won’t be able to differentiate between them?

The reason I ask is because I am using some custom classes that act as wrappers for models, or could use access to NodePath functions like setPos() or getPos() for other reasons. I’ve found that inheriting from NodePath doesn’t work so hot because NodePath is written in C++ (I guess). I’m thinking that instead, the class can create a dummy node for itself, store the NodePath to that node, and thus gain all the NodePath functionality. To do that, either every time I instantiate the class it uses attachNewNode() with the same string, or I have to feed it a unique name to use. Feeding a unique name each time would be problematic, so I’d rather not.


There is no inherent reason to avoid duplicating names for different PandaNodes. As you say, only NodePath.find() operations will be impacted.


Great, that’s what I figured. Thanks, David.