Can we select Parent node of the selected Mesh using Selection Set

I have a model with multiple meshes. Using a selection set API, I want to ensure that selecting any mesh will return the parent node (Model Name). Could you please guide us on how to achieve this?

Thank you!

The selection API will return an item in the object called parent which typically is an ID of that parent node (example here). If you’d like to get the name or additional details of that node, you may have to execute a query in the scene graph using that ID.

Let me know if this is helpful -

Thanks Will, this is helpful

1 Like

Good to see you in the forum again @Prashant!

@Will Thanks… Your quick response and guidance has always helped our team and project.

Need another guidance
We have created a scene and able to find node to hide and show.
playerApi.enableApi(‘player’)
playerApi.scene.find({name:‘Scene_Sphere_Model’})

But when we refer the scene in a catalog item, we are not able to find the node. I remember we should get the asset instance for the scene but some how I am not able to get the syntax right.

var assetInstance = await playerObj.getAssetInstance({
id: ??,
plug: “Proxy”,
property: “asset”
})

Using the playerObj can you run the below command and see if it surfaces the information you’re looking for? Quite a few updates have been made to the scene docs but using the catalog item has always been a bit tedious.

playerObj.sceneGraph.nodes

we are able to find the node using scneGraph.nodes.

But is there a way so that we can find the scene ID referred in the Catalog Item.

On the item I checked that has a stage associated to the catalog item, the stage appears in the sceneGraph.nodes list:

You should also be able to see it if you run: playerObj.stageId

I can see the stage ID but we need Scene instance.

Ahh, I see I apologize for the confusion. I believe the syntax should be something like this (I tested on my own asset) - can you let me know if this helps?

 const assetInstance = await playerObj.getAssetInstance(
    playerApi.scene.find({
      id: SCENE_ID,
      plug: "Proxy",
      property: "asset",
    })
  );

Thanks Will we will check and let you know