ZBrushCentral

Clean up small polygroups scripting advice

Hi there! Pretty new to ZBrushCentral so if this isn’t in the right place let me know.

I’m trying to write a script that will clean up isolated polygroups that fall under a face count threshold by merging them with one of their neighbors.

These are sometimes generated when assigning polygroups by normals, or when making polygroups from polypaint data.

The available “Merge similar groups” and “Merge stray groups” do similar jobs, but seem constrained to very specific circumstances. I’ve often found that some of the stray groups fall outside of the conditions for these two tools.

I wrote a small .dll to parse an exported .obj and it works pretty well for models up to about 15k polys, but doesn’t work too well after that (or at all after a point haha).

Is there native ZScript functionality to do something like this? The existing “Merge stray groups” is pretty fast even on heavy models. I’d love to get that speed but with some flexibility on threshold.

I guess my questions boil down to:

  • Is exporting and parsing the obj the right way to go about this?
  • Are there any techniques or existing libraries I could look at to speed up parsing the geo data?
  • Am I missing something? Is this something that could be done in ZScript?

Thanks for any help!

I think you a basically doing it the right/only way. Sadly, there is no zscript way of handling polygroups, other than by button presses.

Thanks for your response Marcus. Shame about PG scripting limitations but good to know all the same!