Jump to content

Recommended Posts

I have a control object for assigning colors/materials to each object:

control.jpg.03dfb43af1a9d41838fe4dd31d2f2601.jpg

now I want to include an on/off toggle for (de)activating all materials/colors via the interface dialog at once. Whats the procedere for it? Even a hint for a button wouldnt help cause I'm not able to program the neccesary callbackscript.

Thanks in advance for any suggestions.

 

 

 

Share this post


Link to post
Share on other sites
On 9/1/2019 at 2:11 PM, Follyx said:

I have a control object for assigning colors/materials to each object:

control.jpg.03dfb43af1a9d41838fe4dd31d2f2601.jpg

now I want to include an on/off toggle for (de)activating all materials/colors via the interface dialog at once. Whats the procedere for it? Even a hint for a button wouldnt help cause I'm not able to program the neccesary callbackscript.

Thanks in advance for any suggestions.

 


 

 

Hello,You can simply put this Python Code that i have made and tested with the same setup you have created.

Below is the Callback Script to deactivate all materials and colors via the single click or disable toggle with tick:

kwargs['node'].parmTuple('outside').set(' '), kwargs['node'].parmTuple('first').set((0.0,0.0,0.0)), kwargs['node'].parmTuple('inside').set(' '), kwargs['node'].parmTuple('second').set((0.0,0.0,0.0)), kwargs['node'].parmTuple('third').set((0.0,0.0,0.0)), kwargs['node'].parmTuple('burned').set(' ')

Note: Please change the parmTuple name according to your node name. This Callback Script i have tried with the same setup or control box you have made. It's working with both Button and Toggle checkbox also.

Edited by Vishal Bakhaswala

Share this post


Link to post
Share on other sites

thanks a lot. I see, I should start with Python... but where to start outgoing from Houdini?

Sorry for the late reply, was busy.

Uhm, how I should integrate that? if I place a button on the control panel an paste the script (with parrmTuple changed to COPAN_CO_MAT (nodes name)) following error appear:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'ObjNode' object has no attribute 'PANEL_CO_MAT'

any idea?

Edited by Follyx

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

×