Symbolic Posted May 7, 2009 Share Posted May 7, 2009 Hi, I have a script that is doing some simple automation. But I would like this script to be able to work only when I am inside a certain geometry node. right now I use: focus="/obj/geo1/" so I can tell the script where to operate. Is there a way of doing this automaticly. Like If I am in the network... any geometry network... and I hit the button on shelf... it works. Right now, if I do not hardcode the scope path... when I execute the script... it thinks that it is at the top level of Houdini. When I list nodes, it lists only OBJ, VEX etc.... nothing related to the actual scope that I am working in. Thanks. Quote Link to comment Share on other sites More sharing options...
anakin78z Posted May 9, 2009 Share Posted May 9, 2009 You can get the current path from the viewport using the toolutils module: import toolutils view = toolutils.sceneViewer() curpath = view.pwd() curpath is now a node object for whatever's displaying in the viewport. You can then check to see if it's a geometry node: if curpath.childTypeCategory() == hou.sopNodeTypeCategory(): print 'yay' At least I'm pretty sure that'll work. -z Quote Link to comment Share on other sites More sharing options...
Symbolic Posted May 13, 2009 Author Share Posted May 13, 2009 Thanks. Will try it soon. Quote Link to comment Share on other sites More sharing options...
static Posted May 14, 2009 Share Posted May 14, 2009 (edited) Thanks. Will try it soon. Straight out of the help docs http://www.sidefx.com/docs/houdini10.0/ref/windows/edittool Edited May 14, 2009 by static Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.