gyurma Posted December 14, 2019 Share Posted December 14, 2019 I am not a king in scripting but this is would be an excellent addition to a switch node. All I'd like to do is to color the switch node based on it's state (0=red,1=blue,2=green....etc) I have no idea how to go about this. any ideas? Thank you Quote Link to comment Share on other sites More sharing options...
ftaswin Posted December 14, 2019 Share Posted December 14, 2019 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! 1 Quote Link to comment Share on other sites More sharing options...
gyurma Posted December 14, 2019 Author Share Posted December 14, 2019 thank yo very much! that's great! cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.