1

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
paddy
  • 60,864
  • 6
  • 61
  • 103

1 Answers1

2

'=' 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
Swordslayer
  • 2,061
  • 1
  • 13
  • 15