ZBrushCentral

Zremesher multiple subtools in one go

Hi there. I have a nice model that has 243Million points consisting of around 100 subtools. I am wanting to make it game engine ready by zremeshing, UVing & then baking normal maps.

Of course to do this each subtool manually would be a very long job. I am wondering if there is a way to zremesh multiple subtools with a single operation?

If not, is this the kind of thing I could find someone to write a script for?

Thanks

I have a second question, which I will try posting here but let me know if it’s better to start a new topic.

Some subtools are two separate meshes geometrically (ie their vertices form two separate watertight solids) but are the same polygroup.

I would like to split them apart.

I know I could do it via masking to split into separate polygroups, but is there a way to quickly mask a ‘watertight’ geometric object? I tried messing with the Masking parameters but it didn’t help.

In Blender I would do this by selecting vertices on one mesh, and then ‘growing the selection’…

separate

Hello @arumiat

Well, I don’t know anything about the situation you’re working towards, but generally a model would be merged into as few pieces as possible when prepping for a game engine. So if you were to create a new merged version of the mesh that fuses those pieces together and eliminates redundant geometry, then you would only need to ZRemesh that mesh and not all the component subtools.

You could fuse parts together with Live Boolean, certain Gizmo deformers, or Dynamesh. It may also be necessary to project the high res detail from the previous high res versions of the mesh onto the newer mesh, via one of the various methods for doing so.



@marcus_civis might be able to answer this for you better than I can.



If the situation is two distinct volumes that are not connected to each other ( non-contiguous) in the same subtool, then Tool> Polygroups> Autogroups should assign them both separate polygroups if that is what you’re after.

If you would like to split the two parts into separate subtools, then Tool> Subtool > Split to Parts will do this with a single button press.

If the situation is not how I stated it above, please let me know.

Thank you!

Thanks @Spyndel as always. Actually our use-case requires us to keep all the subtools as separate gameObjects. So am left with the problem of trying to Zremesh all of them.

I will wait to hear.

Cheers but I can’t see the Autogroups function anywhere?

autogroup

That’s because for some reason I sent you to the Masking palette to look for Polygroup functions! :wink: You are looking for the Tool> Polygroups menu.

1 Like

hi @arumiat if you need a macro for another use case :

zremesh-all-subtools.txt (507 Bytes)

Instructions :

So you must to put the txt file into Zbrush2021/zstartup/macros/misc.
You also must to set the Zremesher options before you run the macro, it will only apply the same options for every subtools.

Hope it helps!
Nicolas

1 Like

@facelessmindz
Thanks Nicolas, though ZRemesher settings don’t copy automatically so you need to set them for each subtool.

@arumiat
Here’s a revised version of Nicolas’s macro which copies the settings from the selected subtool.

zremesh-all-subtools.txt (2.4 KB)

Marcus

2 Likes

good sight @marcus, I didn’t thought about it, thanks for the edit :wink:
Nicolas

Edit: it makes me think that it could be nice to have a way to setup option from a naming convention for all subtools.

1 Like

Nicolas, I’m not sure what you mean. Can you explain a bit more?

Marcus

You are all awesome! ::slight_smile: Thanks - looking forward to trying all out shortly.

1 Like

I am not sure yet as this is just the start of an idea so it’s hard to tell you in details.
Also we can just store 39 chars for a subtool name which limit a lot the possibility.
Anyway I have a method to store value consecutively as I directly on winid.
So I can for example setup all values for a primitives into the initialize section of the tool palette, and append the result into the active tool.

Here with subtool it would be really different, I can apply that same method from primitive, and the method also work great to quickly customize zremesher, dynamesh and few others sections when the winid are consecutive values for easy unpacking the value we want for that or this options.
I will continue to explore the possibilities for user customizable settings to processes with more section of the ZBrush toolset in my note interface based toolbars plugins.
That might work well with plenty of other sections like tool:deformations, and other geometry modifiers like Dynamesh, ZRemesher, edgeloops, panel loops, extract, reproject…

I had removed the dedicated toolbar for subtool, because with INoteSwitch, and as you have to exit the note interface to apply the settings, and redraw and exit, so that’s not very fast as workflow, it would had be before if you can exit by moving the cursor off the note interface.

I will review the plug with the code i have got now and try to pack you test and will pm you that Marcus.

Best,
Nicolas

1 Like

Thanks Nicolas, that all sounds very interesting!

-Marcus

1 Like

Dear @marcus_civis & @facelessmindz . The subtool works very well thank you. Some more questions if I may.

I wish to remesh this model which consists of multiple subtools:
different

As you can see within the same model, there are subtools that are complex/ big like the skull, and subtools that are very simple like the simple/small bones in the leg that require different polycounts to capture all the detail.

  1. at the moment it seems as though, the subtool will go through & remesh according to the Zremesher settings that it encounters on the first subtool. I tried setting the subtool settings to different values (target poly count 30 for the skull subtool & 1 for the small bone subtool) but all of the remeshed subtools came out around the same values. Is this expected behavior for the macro?

  2. it seems as though the macro will Zremesh any subtool present in the file, regardless of its visibility status. Is this expected behaviour & if so, is there a way to modify the macro to only Zremesh those subtools where the status is set to visible? (this would allow me to first Zremesh the complex objects at high polycount, and after the simple objects at low poly count)

  3. if I were to remesh all of the subtools at a high polycount (20k) - is it possible to go through & Zremesh the smaller subtools that need less polygons, at a lower polycount, without losing details from the original high res subtool? Or when you Zremesh an already Zremeshed subtool, does it use the original subtool or the first Zremeshing as the original topology?

  4. if there were scope to develop this macro into a plugin, I’d be keen to discuss this!

Thanks, A

  1. Look like with my macro you can setup the ZRemesher setting for those specific subtools before to run the macro. The Marcus’s version of the macro grabs ZRemesher values of the first subtool and copy the value from the first subtool to the next one etc…
    My version do not copy the setting of the first subtool, it use the current settings, so if you set that up before to run the macro that might behave like you expected it to.

  2. it was a quick macro for helping on that, not a plugin that consider many workflow.

  3. you had better to split your tool into multiple tool if you absolutely want to batch remesh multiple subtools, then in the end when you are happy with that, you just combine them to make a single tool.

  4. nope but thee are some plugins to automate zremeshing, but not sure if they would do what you are looking for.

Hope it helps
Nicolas

1 Like