Jump to content

Python, Get current node


avizzle

Recommended Posts

Using python, how can I get my current node.  Not the selected node, but the node that I'm currently in.  In my search I keep coming across hou.pwd(), but that always just returns / whenever I try it.

I figured out how to get the parent of a selected node, but that doesn't work if you don't have anything selected.  

Thanks for any help!

Link to comment
Share on other sites

it all depends on the pane you want the object from

as in your current desktop you can have network editor pane, parameter pane and viewport, each of them can have different current node

or you can even have more network editor panes, each of them with different current node

but let's say you want the node level from the first found Network Editor Pane found on your current desktop

ne = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor, 0)
node = ne.pwd()

 

  • Like 1
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...