ZBrushCentral

Export rendered map

Hi

I searched the topics but could not find anything related:

I am getting an error - interface item could not be found.
For the following code

[IPress,Render:BPR RenderPass:Img]

But if you create this through a macro setup it also gives the same code and error?
Is this possible and am I missing something?

Thanks

What are you trying to do?

At the end quite a lot… But for now just export lets say the rendered maps in the BPR renderPass location.
So you rendered a beuty/ambOc etc. then you want to export them in one click etc. But even just exporting one map via scripting does not to work - I am sure I am missing something.

ZPlugin>Multi Map exporter… I made a script too.
Some code omitted from top of file, ZBrush version etc and leading “[” Note is commented out. No error checking routines.
[IPress,Render:BPR RenderPass:Render Best Preview]
[IPress,Texture:GrabDoc]
[IPress,Texture:Export]
/[INote,“You can now save or cancel”]/
]

Thanks for the quick reply Doug

I also have seen this type of export, but I want to export the files like they are in the render passes, or will this do that? According to me the code you posted will just create a copy of what was in the canvas. So you wont be able to export the mask for example?

http://docs.pixologic.com/user-guide/zbrush-plugins/multi-map-exporter/

The multi map exporter is for texture maps - when you want to render in another application, I don’t want to go to another application I want to use the maps zbrush has rendered. The only map that has connection with the images I want to export are the ambOC maps. I am not sure if I am being dumb but is this possible? IPress works with all interface buttons why not the renderpass BPR properties?

You can export the AO map with this…it has to be selected in the BPR properties options panel beforehand.

Yip but now how do you do the same thing for the other maps… depth/beut/sss/mask etc…

I tried to look into the code of the multi map exporter but seems like the file is closed or is there a way to look at the code?

I am trying to create something for myself - so not looking for a solution that already exists but merely a solution to what I want to achieve… Yes if it already exists it will suck but then at least I would like to replicate it… Or look at the code

A .zsc file you can’t read or edit. Why reinvent the wheel when it exists? You have to enable the others as well in that panel. And there’s this>> May or may not be helpful. http://www.zbrushcentral.com/showthread.php?170886-MatCap-Baker!-unofficial-Information-Installation&highlight=MatCap+Baker

The link seems broken.

And yes reinventing the wheel not always the best. But according to me that plugin doesn’t export the actual rendered files?
And what I want to do, the saving of renders is only a fraction of the bigger picture.

So simple thing though, is it possible?

I fixed the link.

thanks Doug, I will look into that plugin but I am afraid it seems like map/texture extraction again and not the psd files created after a render in Zbrush.

I know I am not the first thinking of this, question is, is it possible?

Hi cnever,

Good that you are interested in zscripting and welcome to the forum. :slight_smile:

For those particular buttons, you need to use the interface IDs instead of the button paths in order to export the render pass files (I don’t know why but it works that way). I give a code example in my reply to this thread:
http://www.zbrushcentral.com/showthread.php?178046-Question-coding-image-sequence-with-passes

HTH,

Wow Marcus, this is brilliant - very strange that those buttons require ID’s.

This is how I understand the code please feel free to correct or help out.
But many thanks for jump start already!
You will see that the comments have all my questions and where did you get the information about button ID’s and this?


[If,            // if statemnt starts
([StrFind,"Width=",     /*didn't know you could use () these brackets to encompass a command? but the way I understand this is - look for the letters with the following letters */
[IGetInfo,2219]]>-1),  /* look in here if you find the letters - but usually the code will return a 0 or 1 so the >-1 throws me a bit off here?*/
[IPress,2219]/*pressing the shaded button when the if statement returns false? Why would we press the button if it returns false*/
] // close if statment

http://docs.pixologic.com/reference-guide/preferences/utilities/

Hi cnever,

Most interface items have a numerical ID. You can find it out either by using the Preferences>Utilities>View Window Id slider that Doug’s link takes you to (thanks Doug), or you can use the [IGetID] zscript command. Note that you can learn about how to use the zscript commands using the online docs zscript section, expecially the command reference: http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/command-reference/

Sometimes ZBrush will change the ‘button path’ internally and that can cause it to fail in zscript. That is probably what is happening here, as the internal reference will be to a specific image (the current render pass) rather than the default path. But the ID works OK, so we use that instead.

Note that some interface items don’t have useful IDs - notably items in the Tool palette. This is because the Tool palette changes depending on what type of ZTool is selected.

As for the code example:

  • You can only use curved brackets in specific situations. They are used to clarify how a particular operation is evaluated. For example, you might use them when doing a math calculation such as 14 * (3 + 18) . In my example they are not strictly needed but I tend to use them in an If statement to show which bit is being evaluated - it just makes the code a little more readable.
  • The [StrFind] command looks for a particular string (that is a string or group of characters) in another string. If it’s not found then -1 will be returned. Zero will be returned if the string is found at the start of string being looked at. This is because the index starts at 0 (this is something common in coding). For example, [StrFind, “Hello”, “Hello World”] will return 0 as the first character of “Hello” is the first character of “Hello World”. If we try [StrFind, “World”, “Hello World”] then 6 will be returned, as the first character of “World” is at index 6 (the seventh position). Note that the space is counted as a character. Note also that [StrFind] is case-sensitive, so that [StrFind, “hello”, “Hello World”] will return -1.
  • The If statement will be ‘true’ if [StrFind] returns a value greater than -1. That will happen if “Width=” is found in the pop-up info of the button. As this indicates that there is an image associated with the button it is safe to press the button and export the image.

HTH,

You guys are amazing!

Thanks Doug for that awesome little tip.

Thanks Marcus for thorough explanation - the thing that threw me was all the commas in the if statement and hence you state the () brackets help with grouping/reading the code.

Thanks so much - it really helped now to try and implement what I have learned!