Hi,
I am looking for a reliable way to identify a node in the scenegraph. I found that the node pointer is changing every time when I select it e.g. with node = findNode(Name). I also found that the node ID is changing when I open the Scene in a new session. To use the Name is also not reliable, because the data is imported from CAD and there can be several instances of the same part with identical names. The only possibility I found is to rename all nodes, so that every node Name is unique.
Are there any other ideas?
Thanks
Solved! Go to Solution.
Solved by Bob.Bon2000. Go to Solution.
Solved by michael_nikelsky. Go to Solution.
There is no way to do it. Also, the nodes can change, for example when doing undo/redo, restructuring in the scenegraph when using clones and so on.
Your best option is to use a fully qualified name starting from the root. This will fail if you have nodes named the same on the same hierarchy level but I found that to be rarely the case (except for surfaces in a shell, which should not have a name at all).
Kind regards
Michael
You can probably hock up ur own component to node and then make ID in it. Not sure tho I only theorized about it tho...
Thanks for the replies. I implemented a renaming of the nodes. I append a Counter to the original Name. This seems to be the best solution.
Regards
Jochen
Hi,
in theory for each node your CAD-name (Part-ID + revision-inormation + whatever else your CAD-system uses) + the world-transformation of the node-instance should be enough to uniquely identify each node.
If it isn't you have the same node in the exact same position multiple times in your scene, which points to a problem in your source data.
Or, if this is done on purpose in your CAD, you would need to add something like variant-information from your CAD-system to each node-identifier to make them unique again.
Can't find what you're looking for? Ask the community or share your knowledge.