Jump to content
conwiz3304

Python Question

Recommended Posts

Hi big friends, i have a little question for you

it about python function 'hou.node.children()'


that's returning always like this (<hou.SopNode of type sphere at /obj/geo1/subnet1/sphere1>,..)
it's seems like used absolute path for searching node look to me...


wonder how get relative path node not used absolute path.
like
(<hou.SopNode of type sphere at ./subnet1/sphere1.>,..)    (when if current node is '/obj/geo1')

have a any idea?

Share this post


Link to post
Share on other sites
6 hours ago, conwiz3304 said:

that's returning always like this (<hou.SopNode of type sphere at /obj/geo1/subnet1/sphere1>,..)
it's seems like used absolute path for searching node look to me...

If you print an object in Python it'll show human readable text describing the object. The text you see isn't comprehensive and the data of the object often isn't human readable. There are lots of things you can do with the object. See the Houdini documentation for more details.

Reference for the hou module - http://www.sidefx.com/docs/houdini/hom/hou/index.html

Reference for hou.Node - http://www.sidefx.com/docs/houdini/hom/hou/Node.html

You probably want the relativePathTo method shown on the hou.Node reference page. If you're new to Python and/or object oriented programming I suggest checking out more generic Python training material along with these Houdini references.

Edited by lukeiamyourfather

Share this post


Link to post
Share on other sites
9 hours ago, lukeiamyourfather said:

If you print an object in Python it'll show human readable text describing the object. The text you see isn't comprehensive and the data of the object often isn't human readable. There are lots of things you can do with the object. See the Houdini documentation for more details.

Reference for the hou module - http://www.sidefx.com/docs/houdini/hom/hou/index.html

Reference for hou.Node - http://www.sidefx.com/docs/houdini/hom/hou/Node.html

You probably want the relativePathTo method shown on the hou.Node reference page. If you're new to Python and/or object oriented programming I suggest checking out more generic Python training material along with these Houdini references.

thx for your reply :)

before the discussion, i'm not well eng. but i understand your answer.

relativePathTo, it just extracting string path of node by node...:(  my question means the way searching nodes function.

 

i research the way about python working process in block box and testing for simply.

in more then deep blackbox level, pwd or node('.') or node('./[node]') are access working. can access node, parms, set value, anythings

but, searching node function(children, parent, etc...) was blocked by permission error. even using accessed node.

as i think, pwd or node('./[node]') can accessing node by relative path, but children or parent function has accessing by only absolute path. 

because blockbox is blocked of outside accessed. but, inside the blockbox was accessed worked. (like a shell)

 

wonder how i accessing children nodes function using by relative path in blockbox?

 

 

Share this post


Link to post
Share on other sites
16 hours ago, f1480187 said:

Does it cause problems? It is for display. There is no relative or absolute nodes in HOM, as far as I know.

thx to reply :)

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

×