Jump to content
Sign in to follow this  
Linguininess

how to change HDA node color?

Recommended Posts

I have a fairly simple question. I am trying to dynamically change my HDA's node color depending on a checkbox that is either on or off.

example: on = 1,1,1

off = 0,0,0

 

How would I be able to do this? Thanks

Share this post


Link to post
Share on other sites

node = hou.node('/obj/geo1/null1')
node.setColor(hou.Color(1,0,0))

also you could have just googled: houdini set node color and clicked on the very first link B)
 

Share this post


Link to post
Share on other sites

Hi,

You can put this code in Scripts > Python Module:

def setNodeColor(kwargs):
    this = kwargs['node']
    
    color = hou.Color(1, 0, 0)
    readmode = this.evalParm('readmode')
    if readmode == 1:
        color = hou.Color(1, 0.8, 0)
    elif readmode > 0:
        color = hou.Color(0.6, 1, 0.2)
        
    this.setColor(color)

Then call it in the parameter's Callback Script parameter like this:

hou.phm().setNodeColor(kwargs)

 

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  

×