Jump to content
Follyx

node color choice dependent

Recommended Posts

Hi,

is there a way to change the node color depending on my choice in an attribute wrangle?

I.e: an attribut wrangle with the possibility to set an object to active/inactive (i@active=chi(active");). Depending on the choice from the slider (1/0), the node should change the color, i.e. red/green.

Share this post


Link to post
Share on other sites

Hi,

You can set a Python callback for that active parameter in Edit Parameters Interface window like this:

hou.pwd().setColor([hou.Color(1,0,0), hou.Color(0,1,0)][hou.pwd().evalParm("active")])

 

  • Like 1

Share this post


Link to post
Share on other sites

just be aware that parameter callbacks are not evaluated if the parameter is driven by expressions, they are triggered upon manual value change or upon calling parm.pressButton() function

Share this post


Link to post
Share on other sites

hm, so what would be a better way to realice it?

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

×