Jump to content

having hard times understanding the HOM.


Symbolic

Recommended Posts

Hi,

I have been experimenting with python in Houdini for a while. Well the python sytax itself is very well documented. But I really do not understand what is going on in the Houdini help. Like I managed to build my first python codes looking at other examples. Things like:

hou.node('../DATA').parm('list').set(" ".join(connected))

which will store the value of an array called "connected" as a string named "list" on a node called "DATA". Well, I can understand that. But when I try to look for each individual element that builds that single line of code. There is nothing?!

There is somethin called "hou.Node class". Under this there is lots of things that I just do not understand. Like:

childTypeCategory(self) → NodeTypeCategory

what does this arrow mean? what is "NodeTypeCategory"?

inputs(self) → tuple of hou.Node

what? It is actually used as:

hou.pwd().inputs()[0].name()

this sometimes works as:

hou.pwd().inputs()

Why?

I can see that [0] means the first element of the array of the list of the inputs. But where is that piece of information in the help?

Something I have learned from examples and by asking people. There is no explanation about this anywhere... or I am not able to find it?

Any ideas? What is the way of understanding the HOM help?

Link to comment
Share on other sites

it is a little based on your knowledge of houdini and python

the little arrow is nothing it just separates the command from the type of the result

example

in hou.Node help you can see

name(self) → str

this means that if you have a variable A which type/class is hou.Node

then the command

A.name()

will give you string type

so if you call

B= A.name()

then B will be string variable and will contain the name of the A node as you can see in help

knowing all this, you can read following (still in hou.Node help page)

inputs(self) → tuple of hou.Node

as: A.inputs() will give me tuple of all the inputs of the node A and it will be of type hou.Node

so C = A.inputs() will give me this tuple (tuple in python is something like read only list type or array if you come from other languages)

then C[0] is the first element of the tuple and its type/class is as you allready know hou.Node

so you can call C[0].name() and you will get the name of the node which is connected to the first input of the A node

you can get the same with A.inputs()[0].name()

and this is not just something i know, but it is also how i understand it from help

so as you can see it is all about understanding python and houdini, then the help reading is easy

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