ZBrushCentral

Question: Saving out render passes gives error

I’m attempting to create a script that will cycle through a number of render passes and save the render between each pass.

I started by recording a script;

//RECORDED ZSCRIPT 4.73
[IButton,Play,“Press to play this ZScript. ZScript can be aborted at anytime by pressing the ëescí key.”,
[IConfig,4.73]
[IPress,Render:Render Properties:Shadows]
[IPress,Render:Render Properties:AOcclusion]
[FileNameSetNext,“C:\Lights\Default_Lights.ZLI”][IPress,Light:Load]
[IPress,Material:BasicMaterial]
[IPress,Render:BPR RenderPass:Render Best Preview]
[FileNameSetNext,“C:\Renders\BPR_Depth.psd”][IPress,Render:BPR RenderPass:Dep]
[FileNameSetNext,“C:\Renders\BPR_Shadow.psd”][IPress,Render:BPR RenderPass:Shdw]
[FileNameSetNext,“C:\Renders\BPR_AO.psd”][IPress,Render:BPR RenderPass:AmOc]
[FileNameSetNext,“C:\Renders\BPR_Mask.psd”][IPress,Render:BPR RenderPass:Mask]
]/End of ZScript/

When I attempt to run the script I get an error

ZScript Note: Interface item could not be found.
ERROR: Render:BPRRenderPass:Dep
IN: [IPress,Render:BPRRenderPass:Dep]

This is what the program recorded, so I’m at a loss as to what the issue is…

Yes, as the names of the buttons change when they have images you have to edit the code so that the interface numerical IDs are used instead:

//RECORDED ZSCRIPT 4.73
[IButton,Play,“Press to play this ZScript. ZScript can be aborted at anytime by pressing the ëescí key.”,
[IConfig,4.73]
[IPress,Render:Render Properties:Shadows]
[IPress,Render:Render Properties:AOcclusion]
[FileNameSetNext,“C:\Lights\Default_Lights.ZLI”][IPress,Light:Load]
[IPress,Material:BasicMaterial]
[IPress,Render:BPR RenderPass:Render Best Preview]
[FileNameSetNext,“C:\Renders\BPR_Depth.psd”][IPress,2220]
[FileNameSetNext,“C:\Renders\BPR_Shadow.psd”][IPress,2221]
[FileNameSetNext,“C:\Renders\BPR_AO.psd”][IPress,2222]
[FileNameSetNext,“C:\Renders\BPR_Mask.psd”][IPress,2223]
]/End of ZScript

How do I determine the numerical ID of a particular button, and why doesn’t the script recorder record so that it can play back? Seems like a pretty major oversight.

Thank you for the quick reply.

You can find out the interface item ID by putting the cursor over the item and looking at the Preferences>Utilities>View Window Id slider. If you need them, the IDs for the other passes are:

Image - 2219
SSS - 2302
Floor - 2303

For many operations ZScript recording will record & play back without problems. But it is something of a legacy feature these days. Some things, such as ZModeler, are completely beyond it. Others, such as the render passes, can be got to work with some editing.

Once I docked that menu, I found the slider you were referring to. Thank you for all this. Now I can move onto the next phase of the script.

Chris

Great! Let us know if you run into any more problems.

I probably will, as I delve into getting user input, like for selecting the save directory. !)

Well, I plugged in the ID numbers, but the error persists…

Nevermind. Bad syntax…

I can’t seem to find anything on opening up the folder navigation dialogue. Basically, I want to prompt the user for a folder location to save all the renders.

You have to use [FileNameAsk]. The user would have to give an initial file name which you can then use to get the folder path using [FileNameExtract].