Jump to content

Accessing selected node from Shelf Tool


Mikal

Recommended Posts

I'm trying to create a shelf tool that manipulates selected SOP geometry in a scene. I would like to be able to directly reference the path of the currently selected node and thought there might be an easy way to do this - like hou.pwd() from a parameter, or kwargs['node'] in a digital asset.

Currently the only way I've found of doing this is by cycling through the children of /obj and testing the isSelected() method. Does anyone know if there's a more direct way of accessing selected nodes?

Cheers!

M

Link to comment
Share on other sites

Take a look at hou.selectedNodes():

http://www.sidefx.com/docs/houdini11.1/hom/hou/selectedNodes

Also, you could use kwargs["pane"] to get the current interface pane and call currentNode() to get something. It's not exactly the same as hou.selectedNodes(), but it's a different way about going at it.

Edited by graham
  • Like 1
Link to comment
Share on other sites

Thanks graham, exactly what I was after

Take a look at hou.selectedNodes():

http://www.sidefx.com/docs/houdini11.1/hom/hou/selectedNodes

Also, you could use kwargs["pane"] to get the current interface pane and call currentNode() to get something. It's not exactly the same as hou.selectedNodes(), but it's a different way about going at it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...