ZBrushCentral

ISwitch syntax

Hi,

I was delighted to see the pressed and unpressed command group areas of ISwitch are working fine in 3.5. However I still have a problem with my Iswitches disabling themselves. They work fine in the zscript window (or Tutorial View, as it is named). But putting them in a subpalette will cause them to disable themselves the next time they are pressed, if another script has been activated.

Is it my syntax, which you can see below, that is causing the problem?

[ISwitch ,"Current Brush", Switch(5) ,"description", // have also used numbers instead of the variable Switch( ).
   // Put Commands When Pressed Here
   ,
   // Put Commands When Unpressed Here
   , 0 , 1.0 ]

The solution so far has been to add an [If,…] statement at the end of my script that enables each switch one at a time.

Any ideas? I remember the script part of ZAppLink used switches, without any poblems.

Mark

The reason I am pushing this is the solution comes with a handicap. You can add a positive [If, …] statement at the end of the script that enables the switch(es), but this prevents the next iswitch press from registering (two presses needed). Or you can add another zplugin, much like a rebound plugin to get around the Shift click functionality that broke in 3.0/3.1. Both are cumbersome since there most likely is a simple solution as was used with ISwitches in the ZAppLink plugin.

Here is an example that will auto disable when the switch is pressed(another plugin is activated at the end):

[IConfig, 3.5]
 [ISubPalette, "Zplugin:TestingSwitches"]
 
 [Ibutton, "Zplugin:TestingSwitches:Just for kicks", "press this instead off the Iswitch",
 , 0, 1]
 
 [ISwitch, "Zplugin:TestingSwitches:This Disables", 1, "the next time you press it",
 //When pressed
 ,
 //when unpressed
 ,0, 1]
 
 [If, 1,
 	[IPress, "Zplugin:Misc Utilities :brush>>"]
 ]