ZBrushCentral

Completely, utterly puzzling (to me) behaviour.

Here is one half a ZScript. When loaded on its own, it loads without complaint.

//ZScript

[ISubPalette, Document:Ortho]

[IButton, Document:Ortho:Load Views, “Pick an image in a folder to load views.”]]
[IButton, Document:Ortho:R, “Right Orthogonal View”, , 1]
[IButton, Document:Ortho:L, “Left Orthogonal View”, , 1]
[IButton, Document:Ortho:Top, “Top Orthogonal View”, , 1]
[IButton, Document:Ortho:Bot, “Bottom Orthogonal View”, , 1]
[IButton, Document:Ortho:Fr, “Front Orthogonal View”, , 1]
[IButton, Document:Ortho:Bk, “Back Orthogonal View”, , 1]

and here is the second half of the ZScript. When loaded on its own (without the first half being present in the file), it loads without complaint:

[RoutineDef, GetView,
[If, [FileExists, [StrMerge, folder, file]],
[IEnable, control]
]
,
folder, file, control
]

However, when I combine the two into one file (as below) and attempt to load, I get an “improper commands list” error.

//ZScript

[ISubPalette, Document:Ortho]

[IButton, Document:Ortho:Load Views, “Pick an image in a folder to load views.”]]
[IButton, Document:Ortho:R, “Right Orthogonal View”, , 1]
[IButton, Document:Ortho:L, “Left Orthogonal View”, , 1]
[IButton, Document:Ortho:Top, “Top Orthogonal View”, , 1]
[IButton, Document:Ortho:Bot, “Bottom Orthogonal View”, , 1]
[IButton, Document:Ortho:Fr, “Front Orthogonal View”, , 1]
[IButton, Document:Ortho:Bk, “Back Orthogonal View”, , 1]

[RoutineDef, GetView,
[If, [FileExists, [StrMerge, folder, file]],
[IEnable, control]
]
,
folder, file, control
]

What the heck am I doing wrong?

Thanks,
Ken

You have an extra bracket, ‘]’ , in the first Ibutton.

Not sure why the script loads without the RoutineDef.

I think that it had something to do with the extra bracket and the ordering of the routine defn and the rest of the code, but I’m not sure…

Thanks, though, that was definitely a help. I need to write a ZScript error parser…

Ken

No, you simply had an extra bracket that was all. The rest of the code was fine.