3ds Max - maxscript button RENDERABLE properties switch on/off problem

234 Views Asked by At

I want to know how can a setup a button for switch the renderable properties beetwen on and off.

Using the maxscript listener I can do one or another, but I can't make a script that change beetwen them

$.renderable = off
$.renderable = on

And this also works:

if $.renderable = on then $.renderable = off

But I don't understand why the opposite doesn't:

if $.renderable = off then $.renderable = on

I also tried this but no luck either.

if $.renderable = on then  $.renderable = off 
else $.renderable = on
1

There are 1 best solutions below

0
Swordslayer On

'=' is assignment, that's why your second example doesn't work, for comparison you'd use '==' instead. If you have a single object selected, the easiest way to toggle the state is

$.renderable = not $.renderable