ZBrushCentral

ZScript stops at first command

Hi,

I have been trying to make a simple script that:

Goes to the loaded AppLink Front View
Groups visible as single polygroup
Uses Group front at a 87 degree angle to create a new polygroup

When I record it as a macro I get the following:

//ZBRUSH MACRO - Recorded in ZBrush version 2019
[IButton,???,“Press to run this macro. Macros can be aborted by pressing the ëescí key.”,
[IShowActions,0]
[IConfig,2019]
[IFreeze,
[TransformSet,1176.85852,586.10614,-309.43127,174.77311,174.77311,174.77311,16.67798,-153.64848,164.53727]
]
[IPress,Tool:Polygroups:GroupVisible]
[ISet,Tool:Polygroups:Angle,87]
[IPress,Tool:Polygroups:Group Front]
]

This works fully as a script, but if I wanted to load a different saved view, it uses the TransformSet coordinates. So I took out the Transformset command and replaced it with:

[IPress,Document:ZAppLink Properties:Front:Front]

This leaves me with the following macro:

//ZBRUSH MACRO - Recorded in ZBrush version 2019
[IButton,???,“Press to run this macro. Macros can be aborted by pressing the ëescí key.”,
[IShowActions,0]
[IConfig,2019]
[IFreeze,
[IPress,Document:ZAppLink Properties:Front:Front]
]
[IPress,Tool:Polygroups:GroupVisible]
[ISet,Tool:Polygroups:Angle,87]
[IPress,Tool:Polygroups:Group Front]
]

However the moment Zbrush hits the [IPress,Document:ZAppLink Properties:Front:Front] bit, it will not advance any further down the macro, so it goes to the loaded/saved front view, but does not do anything else (it does not create polygroups).

Lastly if I delete the [IPress,Document:ZAppLink Properties:Front:Front] bit, the the macro will run just fine, but I obviously want it to first revert to the saved view.

I have tried searching documentation, google and the forums, but I can’t find any explanation of how to troubleshoot a script, or any similar error.

Hopefully it is something simple/stupid and someone who has more experience can point out what I am doing wrong.

Many thanks in advance,

Tobbe

Hi Tobbe. Hopefully we can summon @marcus_civis to spirit you away to the scripting forum and get you some help there.

Hi Tobbe,

Unfortunately a macro (or zscript, or plugin) will cease running if another plugin is called - the control passes to the plugin but doesn’t get passed back. ZAppLink is a plugin which is why your macro stops running at that point.

I hope this helps,
Marcus

1 Like

Hi Marcus,

It makes perfect sense, I will see if I can come up with a workaround not using another plugin then.

None the less I wanted to thank you for your quick reply, and also @Spyndel for reaching out to you. Thank you both!

Thanks,

Tobbe

1 Like