Checkbutton question

Hi!

I made a toolbar to quickly change object properties (like Visibility to Camera).
At the moment for each property I have two buttons one to activate a property and one to deactivate it. I would like to have only one button with two states which updates on each object selection to reflect the actual property of the selected object. This task is too tricky for my poor scripting abilities and I would be very grateful if somebody could help me with this.

kind regards
buddho

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

When you work with booleans then just reverse the property value using the NOT. Instead of 2 buttons that will set the boxMode of the selected object to true or false, you can use only one line of code. It will check the current mode and will reverce it.
Use this as reference:

$.boxmode = not $.boxmode

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.