Adding object references as node property

I have played a bit with adding user properties to nodes in the scene. I see that we can use Model.addPropertyToNode to add string properties using a string key to a node in the scenegraph.

Some of our scene nodes are created from objects in our model. What we would like to do is to add an object reference (or pointer if you will) on the scene node so we can easily link back to the object the node represents in the scene. Is this possible with the Typescript API?

Right now, we store a map in our application to link some scene node ID to some objects in our model. It is kind of challenging to guarantee there is no discrepancy between the scene graph and this map.


Hey @alexis.besner! First off, welcome to our forum!

I’m not sure exactly the answer to your question, but I think @beau.trifiro or @rajesh.bhartiya might be able to help as they have more experience.

Hi @alexis.besner !

It isn’t directly possible to link an object to a node ID; I think a map would be the best way to go about it. Can you describe in a bit more detail what your goal is and your concerns with using a map? Perhaps I’m misunderstanding your question or can provide a better solution with more info.

Thank you!