Selection API of the player

Prashant
This is regarding Player API Selection Set. https://docs.threekit.com/docs/player-api#module_Selection..set I am trying to add a mesh to the Selection set but its not getting added. I have passed the nodeid, node name …

Comments

4 comments

  • Comment author
    Prashant

    This is regarding Player API Selection Set.
    https://docs.threekit.com/docs/player-api#module_Selection..set

    I am trying to add a mesh to the Selection set but its not getting added. I have passed the nodeid, node name but not working.

    HTML code
    handlers: {
    mousedown: e => {
    const hits = e.hitNodes;
    if (!hits.length) return;
    const hierarchy = […hits[0].hierarchy];
    hierarchy.reverse();
    for (let node of hierarchy) {
    if (node.type === "PolyMesh”) {
    api.selectionSet.add({ name: node.nodeId });
    }
    }

    Tried in Console also

    0
  • Comment author
    William Thompson

    Hi Prashant, sorry for your challenge I believe there is a gap in our documentation thank you for pointing it out.

    Instead of calling api.selectionSet.add(NODE_ID) can you please try: api.selectionSet.set(NODE_ID) or api.selectionSet.add(NODE_ID) and see if that is giving you the results you want? I believe IDs are what will create the selection. I am investigating with our team to confirm.

    0
  • Comment author
    Prashant

    Thanks @Will its working as per your suggestion. When we add i get undefined in response. is there a way to get confirmation response.

    0
  • Comment author
    William Thompson

    Great, I’m glad it’s working. At this time there is no way to get a confirmation response.

    0

Please sign in to leave a comment.