ZBrushCentral

Bug with ISwitch command???

Hey guys,

I’m having a problem with the ISwitch command. I’m getting an error message that the command must be a Top Level command however it is not placed within another command. I’m wondering if anybody else has run across this and/or if this is a bug. This is the command that I’m trying to execute.

[ISwitch,“Tool:Models:Load Rim Right”
,0,“Press this to view your current rim light”,
[Loop,20,
[IPress,Tool:SubTool:SelectUp]
]
[VarDef,filelocation,""]
[VarDef,filename,""]
[VarSet,filelocation,[GetActiveToolPath]]
[VarSet,filename,[StrMerge,filelocation,“R2.ZLI”]]
[IPress,Material:Metal 01]
[IPress,Draw:M]
[IPress,Color:FillObject]
[IPress,Tool:SubTool:SelectDown]
[IPress,Color:FillObject]
[IPress,Tool:SubTool:SelectUp]
[If,
[FileExists,filename] > 0,
[FileNameSetNext,filename][IPress,Light:Load],
[FileNameSetNext,“C:/ArtifactRenders/ZLights02.ZLI”][IPress,Light:Load]
]
[IUnPress,Draw:M]

,
[Loop,20,
[IPress,Tool:SubTool:SelectUp]
]
[IPress,Edit:Tool:Undo]
[IPress,Tool:SubTool:SelectDown]
[IPress,Edit:Tool:Undo]
,.1]

Any help would be appreciated, thank you.

Hi,

There’s nothing obviously wrong with your code, except you’re not using [ISubPalette] to create the new “Models” sub-palette. Could you post the whole zscript text file so I can take a look?

Thanks,

Hey Marcus,

Based off of our previous discussion I looked through the script and you’re correct everything is getting wrapped into the macro button. I’m posting my updated script with the button commented out. Thanks again for the help!!Switch.TXT (1.1 KB)

Hi,

That looks good (though you still have the macro end bracket ‘]’ at the very end of the zscript this won’t stop the plugin loading).

All best,