ZBrushCentral

Macro for BPR not working

Hi

I have tried making a macro for repeating a BPR render but on replay I am getting a zscript error

Command could not be found Render:Img

[IPress,Render:Img]

This also happens if I save a turntable plus action as a macro and try and replay it.

Any help would be appreciated!

Thanks

I can’t tell why that should fail from a single line. Can you post the macro as an attachment, or share some more of it? I should then be able to see what’s going wrong.

Thanks,

//ZBRUSH MACRO - Recorded in ZBrush version 4.0

[IButton,???,“Press to run this macro. Macros can be aborted by pressing the ëescí key.”,

[IShowActions,0]

[IConfig,4.0]

[IPress,Tool:PM3D_Sphere3D_1]

[CanvasStroke,(ZObjStrokeV02n2=H1CCV30CH1CCV30C)]

[IPress,Transform: Edit]

[IUnPress,Render:Create Maps]

[IPress,Render:Create Maps]

[IPress,Render:MGray]

[IPress,Render:AOcclusion]

[IPress,Render:Render Best Preview]

[FileNameSetNext,“D:\1a71-allzip\BPR_Render.psd”][IPress,Render:Img]

[FileNameSetNext,“D:\1a71-allzip\BPR_Depth.psd”][IPress,Render:Dep]

[FileNameSetNext,“D:\1a71-allzip\BPR_Shadow.psd”][IPress,Render:Shdw]

[FileNameSetNext,“D:\1a71-allzip\BPR_AO.psd”][IPress,Render:AmOc]

[FileNameSetNext,“D:\1a71-allzip\BPR_Mask.psd”][IPress,Render:Mask]

]

As far as I can tell you should be able to reproduce it by trying to save a BPR render as a macro then running the macro.

Does that work for you?

Perhaps if you have an example script that can do a BPR render and save out the associated files. That would be a great help!

Thanks!

OK, thanks. It looks like the problem arises because the button paths don’t remain constant - they relate to the image name, if it has been saved. This throws everything out. The solution is to use the numerical IDs which do remain constant:

//ZBRUSH MACRO - Recorded in ZBrush version 4.0

[IButton,???,"Press to run this macro. Macros can be aborted by pressing the ëescí key.",

[IShowActions,0]

[IConfig,4.0]

[IPress,Tool:PM3D_Sphere3D_1]

[CanvasStroke,(ZObjStrokeV02n2=H1CCV30CH1CCV30C)]

[IPress,Transform: Edit]

[IUnPress,Render:Create Maps]

[IPress,Render:Create Maps]

[IPress,Render:MGray]

[IPress,Render:AOcclusion]

[IPress,Render:Render Best Preview]

[FileNameSetNext,"D:\1a71-allzip\BPR_Render.psd"][IPress,2207]

[FileNameSetNext,"D:\1a71-allzip\BPR_Depth.psd"][IPress,2208]

[FileNameSetNext,"D:\1a71-allzip\BPR_Shadow.psd"][IPress,2209]

[FileNameSetNext,"D:\1a71-allzip\BPR_AO.psd"][IPress,2210]

[FileNameSetNext,"D:\1a71-allzip\BPR_Mask.psd"][IPress,2211]

]

HTH,

I will give that a try!

Where exactly did you get these ‘magic’ numbers? Any links to this type of information would be much appreciated .

Thanks again!

Sometimes it is necessary to edit macros to get them to work how you want. Macros are written in ZScript and to learn about ZScripting see here:

http://www.pixologic.com/docs/index.php/ZScripting

When you need the ‘button path’ for an interface item you can find it by holding the cursor over the item and pressing Ctrl - the button path will be at the bottom of the pop-up note. When you need the numerical ID you can find it by looking at the View Window Id slider in the Preferences>Utilities menu (it’s the 5th slider down). Dock the Preferences palette so it stays open and you can see the slider, then put the cursor over the item you want.

HTH,

I tried it again but now it comes up with the number in the error instead of the text.

Have you tried to start to record a macro, do a bpr render, save the files then stop the recording of the macro. Now delete the render files you saved.

Now play the macro. Does this work for you? Are the files created? Does your ID solution work for you in this case?

I don’t understand why I seem to be getting this error and you don’t?

I don’t know why it shouldn’t be working for you.

Try this Macro. Put the text file in the ZStartup\Macros\Misc folder. Start ZBrush, or if it is running press Macro>Reload All Macros. There will be a “BPR_Render” button in the Macro>Misc menu.

With a model in Edit mode, pressing the button will give a dialog box that asks for a file name. This is so you can save to the location you want. The file name will be used as a prefix for the image files, which will have “BPR_Render”, “BPR_Depth”, etc., added to them. Note that you will need to switch on Shadows or AO in the Render palette in order for these to be saved.

Let me know if this is any help.

Yes this worked!

Thanks so much for taking the time to look into this. I have learnt a lot and having this macro ability will save me much time down the road!

I tried the previous substitution you suggested again and this time it worked. I must have done a typo before and did not catch it.

Thanks again for your time. (and the code!)

Great. Have fun ZBrushing. :slight_smile: