ZBrushCentral

Question: greyed out switches

Hey guys, no matter what version of zbrush I’m using, my code runs all fine but as soon as I stop using the txt file and put the (.zsc) file in the plugins folder. As soon as I hit one switch all switches of my plugin get greyed out instantly.

I’ve made a few plugins before and never had this issue. I tried to see if it would also happen with a really small test and it does. At this point I have no idea how to fix it anyone else experiencing the same?

//_____test code

[ISubPalette,“Zplugin:Quick Tools”]
[ISubPalette,“Zplugin:Quick Tools:Clean Up”]

[ISwitch, “Zplugin:Quick Tools:Clean Up:Folder” , 0, “When on it will only clean the subtools of current folder”, , , , 95]

//_____

(also for some reason if I don’t specify the width of the switch they get really weird scales and start over lapping each other. which also never happened to me before)

Hi,

Welcome to ZBC!

Switches can become disabled so you need to make sure each switch is enabled by putting a line like this at the very end of your code:

[IEnable, “Zplugin:Quick Tools:Clean Up:Folder” ]

Also, for the switch/button widths, it is generally better to use proportional widths rather than pixels so the switch or button will scale correctly if you change your button size in Preferences. So use 1.0 for full palette width, 0.5 for half palette width, etc.

-Marcus

Thanks for the reply marcus I’m not sure what you mean with the porportional widths? could you send me an example of a switch with porportional widths this is what I have now. But it only keeps the switch I toggle enabled the other gets greyed out.

[ISubPalette,“Zplugin:Quick Tools”]
[ISubPalette,“Zplugin:Quick Tools:Clean Up”]

[ISwitch, “Zplugin:Quick Tools:Clean Up:Folder” , 0, “When on it will only clean the subtools of current folder”,[IEnable, “Zplugin:Quick Tools:Clean Up:Folder” ] ,[IEnable, “Zplugin:Quick Tools:Clean Up:Folder” ] , , 95]
[ISwitch, “Zplugin:Quick Tools:Clean Up:Lol” , 0, “When on it will only clean the subtools of current folder”,[IEnable, “Zplugin:Quick Tools:Clean Up:lol” ] ,[IEnable, “Zplugin:Quick Tools:Clean Up:lol” ] , , 95]

should I make a routine where it enables all the switches and put that routine at the end of every code? I guess it would work but seems like a rather weird thing to do?

Hi,

The [IEnabled] commands should go outside the Switch code, like this. And I’ve put 0.5 (proportional width) instead of your 95 pixels width. You’ll see that the two switches are on the same line, each is a half of the palette width.

[ISubPalette,"Zplugin:Quick Tools"]
[ISubPalette,"Zplugin:Quick Tools:Clean Up"]

[ISwitch, "Zplugin:Quick Tools:Clean Up:Folder" , 0, "When on it will only clean the subtools of current folder",, , , 0.5]

[ISwitch, "Zplugin:Quick Tools:Clean Up:Lol" , 0, "When on it will only clean the subtools of current folder", , , , 0.5]


[IEnable, "Zplugin:Quick Tools:Clean Up:Folder" ]
[IEnable, "Zplugin:Quick Tools:Clean Up:lol" ]

(The switch getting disabled is basically a bug in ZBrush but this fixes it.)

HTH,
Marcus

Thanks a lot marcus all clear now!

1 Like