ZBrushCentral

Question: Is it possible to zscript decimating and exporting subtools eg. LODs

Before I attempted spending many an hour trying to get this working.

I have a lidar set model from Reality Capture cut up into multiple subtools. Which I then need to export Levels Of Detail into a HighRes MedRes and LowRes obj.

Is it possible to once the subtools are ready to have a zscript that will pre-process all subtools(decimation master). Then export the subtool with _HR on the end, decimate 10%, export with _MR, decimate 2%, export _LR. Then move onto the next subtool until they are all done? No UV’s or textures are required just raw mesh.

I have seen zscripts to export subtools with their naming. But was it possible to add the decimation master component into it?

Thanks for your time.

Hi,

Welcome to ZBC!

You can’t use zscript to run plugins like Decimation Master. The reason is that only one zscript, plugin or macro can be active at a time and, as soon as you call Decimation Master from your code, control passes to Decimation Master and won’t go back to your script.

Thanks for the information. Is this ever going to be possible in the future or not because how Zbrush is coded? The company I work for loves the decimation of Zbrush over pretty much any other program. The pre-process all keeps failing on some of the subtools or deleting the goZ cache happens randomly waiting for it to finish. This is usually over 20 sub-tools with 25 million points per tool.

Exporting and decimating a subtool into 3 Lods for multiple sub tools can take hours and is a large time sink. So scripting it would have been great if possible.

Thanks for your time!!!

Cheers

I’m working on a version of Decimation Master that can be used for batch processing (which will eventually be released to the community). It does need clear understanding of the coding requirements for the user but if you are confident with zscript then you are welcome to try it. I will need to finish a few things which I shan’t be able to do until next week but if you are interested, send me a private message.

Hi,

I would be interested in testing this batch processing out if possible. It could prove to be very helpful. Also not sure how to send a private message haha. I can’t seem to find a way to send one!!!

Cheers

No worries, I’ll send you a message when I’ve something for you. You access your private messages by clicking the account icon at the top right of the ZBC page (yours will be the green W). The message tab is the “envelope” icon that shows when you do this.

-Marcus

Have sent you a private message.

Hi @marcus_civis

Have there been any updates on this? I could really use this tool and would love to try it out as well.

Thanks

Hi @Aphex96

Welcome to ZBC! :slight_smile:

Here’s a version you can try. Note there are specific memory block requirements for your own script - there’s a sample script in the zip that shows you what needs to be done.

Batch_DM_2022.zip (792.1 KB)

Any questions, let me know.

Marcus

Thank you @marcus_civis !

I managed to get it working. If I had a directory of obj files instead of ztl would it be possible to get those to import? Additionally, is it possible to decimate by percentage rather than total poly?

Yes, you can do that though zscript on its own can’t get a list of files in a folder. You will need to use the ZFileUtils dynamic library. The latest version, and how to use it is on this page:
http://docs.pixologic.com/user-guide/customizing-zbrush/zscripting/zfileutils/

For percentage decimation, all you need to do is calculate the polys you want from the total polys (use [Mesh3DGet]).

HTH,
Marcus

Hey. Is it possible with this plugin to use the subtool master and multi map exporter? Or it’s only for decimation master? Thank you.

Hi,

Welcome to ZBC! :slight_smile:

No, this won’t work with SubTool Master or Multi Map Exporter. New versions of those plugins would be needed to work with zscripting.

HTH,
Marcus

Hi @marcus_civis

I have been working tirelessly on getting this to work in the latest version of Zbrush but simply can’t.
Either it spits out a decimated rhino, which is actually just the default sphere, or it presents me with the following error:
image

Do you by any chance have a new version ready for testing?
We have SO many obj’s to decimate :wink:

Hi Martin,

Welcome to ZBC! :slight_smile:

That error looks as though you haven’t installed the plugin correctly. Did you put the Batch_DM_2022.zsc file to the Pixologic/ZBrush 2022/ZStartup/ZPlugs64 folder?

-Marcus

Yup, right here →

OK, thanks.

So do you have a “Batch Plugins” subpalette in the Zplugin palette, with a “DM - Decimate Current” button? And how are you loading the Test_Batch_DM zscript?

(I’ve just tested the posted version with the latest ZBrush and it works without problems for me.)

-Marcus

That’s just it - There’s no “Batch Plugins” in the Zplugins… I’m loading the zscript with the script loader as I usually do with my own scripts.

Hmm, that’s strange. Can you try loading the Batch_DM_2022.zsc file from the ZScript>Load button and tell me if you get any error messages?

Ok, this is indeed a strange behavior… I restarted Zbrush a couple of times and suddenly I had the “Batch Plugins” in Zplugins - BUT with two buttons to unwrap uvw, one for ‘current’ and one for ‘all’.
After another restart I got the “DM - Decimate current” but when I tried running the demo-script I got a Zbrush popup that told me it couldn’t find the plugin.
After yet another restart I can now run the script - This is so weird :crazy_face:
I’ll have to investigate and test further - Will return later!