Jump to content
Sign in to follow this  

connecting parameters in python

Recommended Posts


I've been having trouble trying to replicate the "copy parameter/paste relative references" process of referencing parameters from one node to another in python. I understand you can write an expression in the parameter like: evalParm('../box1/tx') but I'd like to be able to do this in the python source editor. 

This chunk of code copies the translate x from box1 and pastes the value into sphere1's tx, however it doesn't connect the two like the expression above does.

boxy = hou.node('/obj/testGeo/box1')
ball = hou.node('/obj/testGeo/sphere1')
ball.setParms({'tx':boxy.evalParm('tx'), 'ty':0.55})

Essentially I want the parameters to be linked so that if I change box1 tx, sphere1 tx is also changed. Any ideas on what I'm missing to make that connection permanent? 

Edited by andehpandeh

Share this post

Link to post
Share on other sites

just use parm() instead of evalParm()
ball.setParms({'tx':boxy.parm('tx'), 'ty':0.55})

  • Thanks 1

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
Sign in to follow this