Jump to content

Coloring Node based on its state


gyurma

Recommended Posts

Goto Edit Parameter Interface of the switch node and :

Create an Int spare parm on the switch node (call it trigger, for example) and connect it's value to the switch input parm (ch("input") expression)

Fill the callback script (python) on this new parameter with:

colorList = [[1,0,0],[0,1,0],[0,0,1]]; kwargs["node"].setColor(hou.Color(colorList[min(len(colorList)-1,int(kwargs['script_value']))]))

 

Bam!

  • Like 1
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...