Jump to content
avizzle

Python, Get current node

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!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Ah, ha, that makes sense now.  Just tried it out and works perfectly, thank you for the answer, I appreciate it!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×