ZBrushCentral

[SOLVED] Zremesher for thousands of objects Z4R8

Sorry for resurrecting an old topic, but after spending a few hours reading old topic for creating a zscript for remeshing in batch lot of objects I’m a bit confused (almost 3000)
Before starting to describe why I’m confused, I need to say that I need a batch since even if I can merge all sub autogroups and then again split my obj I would lose the names of the subobjects which for me is vital (all the obj comes from anatomy scans and so the name gives a precise anatomical classification+scientific name of the scanned body part)
I’ve created a script that open an obj, zremesh the obj and then save it. I’ve undeserstand that I should probably use ZFileUtils DLL for 4R7 but I don’t know if it will work on Zbrush R8. Also I find the syntax a bit confusing.
So is it possible to open the obj in batch, run the script and then resave with same name (or adding just a letter to the name) ?
If anyone has tried in zbrush r8 please let me know.
Thanks in advance for the reply.
Giorgio

edit-
The script included worked like a breeze. It made me spare days ! Thanks !!!

no hints :frowning: ?

Hi,
not sure if this is exactly what you need, but here is a very simple script that will automatically apply ZRemesher to every SubTool. It’s very simple, and assumes that all SubTools are polymeshs3D with no subdivision, etc… (that’s the case if you simply import obj files).
Put the .txt file in attachement in ZScripts subfolder of ZBrush folder, then go in ‘ZPlugin’ menu, ‘ZRemesh batch’ subpalette, and click ‘ZRemesh all SubTools’.

Hope that helps,
Wixi.

Attachments

ZRemeshAllSubTools.txt (534 Bytes)

Thanks I will test this weekend and post the results ! You saved my day

Hello I’ve tried with r8 but it doesn’t seems to work. Probably the best solution could be to see if the new zscript utils will include also an example for batch applying to a directory of obj an action. For now my thousands objs must wait :frowning:

Sorry, I’ve read too quickly what you requested, and misunderstood your needs.

So, here is another proposal that should do what you want:
1- First, make a copy of all your objs in a separate folder (objs in this separate folder will be overwritten, so KEEP A BACKUP OF YOUR ORIGINAL OBJS).
2- Put the attached file “MakeList.bat.txt” in this folder and rename it to “MakeList.bat” (I don’t know how to attach .bat file so I saved it as txt)
3- Then double click “MakeList.bat”: it will create a file “ObjsList.txt”, which will contain the list of all your obj files.
4- Launch ZBrush and open any the Dog project.
5- Go in ZScript menu, and open the attached “ZRemeshList.txt” zscript attached.
6- Then go in “ZPlugin” menu, open “ZRemesh batch” subpalette and click on “ZRemesh file list”.
7- Select the file “ObjsList.txt” (which was generated in 3-)
As a result, it will import all your objs one by one, calling ZRemesh for each one and exporting/overwriting your obj files with the zremeshed objects.

Note:
This will run the ZRemesher with default parameters, and without symmetry (I had to deactivate symmetry before processing otherwise ZRemesher won’t work on non symmetrical objects).
If you need to change some ZRemesher parameters on a per-file basis, you can do it in “ZRemeshCurrentSubTool” routine, right before calling the [IPress, “Tool:Geometry:ZRemesher”] (you get the filename as parameter in this routine). This would not be very convenient/quick to do so, but I don’t have other idea on how to do specific per-file parameters in an easier way.

Hope that helps,
Wixi.

Attachments

ZRemeshList.txt (1.32 KB)

MakeList.bat.txt (29 Bytes)

Thanks a million for your patience wixii, I will test it immediatly.
It’s just perfect !!! You saved me !!