Jump to content

Getting a node output value...


Dejo1974

Recommended Posts

Well I'm a total begginer in Python and Houdin, how do I get output distance value from hou.node('/obj/KIN_Chops/Measure_Distance_L_Hand'), and assign it to a variable let's say "A" ?

I can see it when I MMB hower over the node it reads 54. 99476.

I dragged&dropped the node to the python shell but I can't see it in the .attribute listing... or am I doing this completely wrong?

Link to comment
Share on other sites

If you look at the help for chop() you'll see how you can access the same data through HOM:

> exhelp chop
float chop (string channel)
        REPLACED BY
            hou.ChopNode
            hou.Track

value = hou.node('/obj/chopnet1/mynode').track("chan1").eval()

Link to comment
Share on other sites

  • 7 months later...

Sorry guys... maybe I'm too stupid to crack this...but this doesn't  work... sorry for  a late reply also, and rising this topic out of the dead... I'm getting something like "this node has no track attribute" error...

Edited by Dejo1974
Link to comment
Share on other sites

GOT IT!!! As it usually happens... after days of pulling my hair...

it turns out that I should first assign the object node from the chopnet

i.e.

hou.node('/obj/KIN_Chops/object1')

 

TO the hou.chopnode

 

i.e.

 

hou.chopnode = hou.node('/obj/KIN_Chops/object1')

 

THEN

 

call the hou.track class with the name of the track as the tuple (double quotes)

 

i.e.

 

hou.chopnode.track("dist")

 

and the last step was to call .eval()

 

i.e.

 

hou.chopnode.track("dist").eval()

 

and it spits out the distance... with this many doors open... next question is should this be setted to evaluate per frame (will it slow down the rig) or per time range basis?

And the people say there is no hiearchy in programming...

Edited by Dejo1974
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...