Jump to content
Sign in to follow this  
danielsweeney

set absolute reference? python

Recommended Posts

Hi Everyone,

 

can anyone give me a heads up on how to do this?

 

if I want to set a relative reference I usually do something like this.

 

node = hou.node('/obj/geo1/')
p1 = node.parm('sphere1/scale')
p2 = node.parm('sphere2/scale')

p2.set(p1)

 

but what if I want the path to be an absolute reference?

 

cheers for your help.

 

D

Share this post


Link to post
Share on other sites

You could build an expression pointing to the parm instead, something like this

node_one = hou.node("/obj/geo1/sphere1")
node_two = hou.node("/obj/geo1/sphere2")

node_two.parm("scale").setExpression('chs("' + node_one.path() + '/scale")')

Share this post


Link to post
Share on other sites

ah ok. so just do it manually.

 

just didn't know if there was a more elegant solution. and you can set absolute reference with right-click. thought there might be a function for it. 

 

cheers for the help.

 

D

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  

×