Jump to content

Python Question


conwiz3304

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?

Link to comment
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
Link to comment
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?

 

 

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...