ZBrushCentral

Question: Is it possible to batch process a bunch of obj's

Hi

I would like to batch process a bunch of obj’s in zbrush te export maps for 50 or so characters.

1st Prize would be that you launch a python script that then launches the zbrush task but not sure this would be possible?
Alternatively in zbrush looking at the file location or selection and doing the batch process on that?

Not even sure if this is possible so if it isn’t please let me know.

Thanks

The ZFileUtils provides the necessary functions to get the contents of a folder:

http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/zfileutils/

Once you know the file names it’s straightforward to import each file using

[FileNameSetNext, … ]
[IPress,Tool:Import]

and then process how you want. However, remember that you can’t use zscript with plugins such as the Multi Map Exporter. ZBrush only allows one zscript or plugin to be active at a time and the moment your script presses a plugin button control passes to that plugin and no more code in your script is run.

HTH,

Hi Marcus

Thanks I am reading it and trying to figure out how this works exactly, copying the code just like that does not work :frowning:

Any code that I can reverse engineer?

I saw a post where you had a mulitsaveZtl script a while back but can’t access the txt file. Was wondering if any helpful code would be in there.

Thanks

OK! I was a bit hasty there… I downloaded the zip which works and gives something to reverse engineer :slight_smile:

Thanks Marcus for all the help :slight_smile:

Hi

So got it all to work, by getting path for maps to export and then path for my obj’s and all the action that needs to happen to each obj.

But struggling with the vector map export option, when it asks do you want to export the base mesh. I don’t and might run through 10/20 meshes and would rather that this option not appear, is this possible?

Also when I import a mesh it ask do I want to project the old to new mesh, possible to get zbrush to ignore this?

Thanks

Hi,

I’m glad you got it to work!

  1. For the base mesh export when creating vector displacement maps, unfortunately there’s no solution to this at the moment. The best thing is to let ZBrush do its thing and then delete the file using [FileDelete]. (This is what Multi Map Exporter does…)

[FileNameSetNext,vectDispfile]
[IKeyPress,13,[IPress,Tool:VectorDisplacement Map:CreateAndExport VDMap]]

//delete OBJs exported by default:
[VarSet,vdOBJfile,[StrMerge,[FileNameExtract,vectDispfile,3],".OBJ"]]
[If,[FileExists,vdOBJfile],
[FileDelete, vdOBJfile]
]
//repeat code to delete MTL file
[VarSet,vdOBJfile,[StrMerge,[FileNameExtract,vectDispfile,3],".MTL"]]
[If,[FileExists,vdOBJfile],
[FileDelete, vdOBJfile]
]

  1. Delete any subdivision levels before importing a new OBJ. If there are no subdivision levels then ZBrush will simply replace the subtool with the imported mesh.

HTH,

Hi Marcus

Thanks so much for your help, you also answered the other problems I was busy with! I did not realize you could target a file to delete, really smart way of handling that :slight_smile:

So script is working and I can now batch through unlimited amount of obj’s, reconstruct to lowest level and export the vdisp map thanks to you.

Regards

Great! You’re welcome. :slight_smile: