ZBrushCentral

Question: How to Put Tool Layers into Recording Mode?

I am putting a macro together and wish to switch tool layers, coming out of Layer_A recording mode and going into Layer_B recording mode. The line of code that’s generated when making a new macro and manually doing this sequence does not set Layer_B into recording mode when played back, which is why I’m stuck and asking you.

Thank you very much for any help you can give.

Rory

There’s a little bit of zscript gymnastics necessary to get this to work. First of all you need to take note of the points that TVeyes makes in this thread: http://www.zbrushcentral.com/showthread.php?157182-script-request-toggle-record-off-and-bake-all-for-ALL-subtools.

Once you have made sure that the Layer you want is positioned (using the scrollbar) at the top of the list you can use this code:

[VarSet,layerPath,[StrMerge,“Tool:Layers:”,[IGetTitle,“Tool:Layers:Layer Intensity”]]]
//turn on Layer recording if necessary
[VarSet,wid,[IWidth,layerPath]]
[If,([IModGet,layerPath]&1) != 1, // if record mode is OFF
//set Intensity to 1 for recording
[ISet,Tool:Layers:Layer Intensity,1]
[IClick,layerPath,wid-28,5] // turn on recording by clicking the REC icon
]

Basically the code simulates a click of the Record icon. You have to get the width of the Layer list so that the click is in the right place (this will vary with the user’s setup). Setting the Layer Intensity to 1 is not necessary but it does give a visual reminder that all recording is done at an intensity of 1.

HTH,

You are a hero! Thank you very much indeed. I shall give this a go tomorrow when I get back to the office. I was really stumped there; not being a programmer in any shape or form, all I could do was click the record button and put the code that action spat out into my macro and hope it worked. When it didn’t there was nowhere for me to go, but here!

Thank you again,

Rory

You’re welcome. :slight_smile: Let me know if you need more help.

By the way, I like your Halloween pic - a particularly cruel Alice! :wink:

Thank you Marcus. You are always so helpful! The code worked a treat!

And I’m glad you enjoyed my Humpty pic.
R