ZBrushCentral

plugin request: ReMesh per poly group for selected/visible sub-tool(s)

I have to say that the new ReMesh feature in ZB3.5R3 rocks! It speeds up max->zbrush workflow immensely. However, I found an area in which a script or plugin could help the process even more. Here is my situation:

  • Export a brick arch way .obj.
  • Import in zbrush
  • Auto Group to get individual poly groups for each brick.
  • Hide by poly group
  • Re-mesh the visible poly group
  • Un-hide rest of arch poly groups
  • Hide all except the next brick in the arch
  • Hide the newly created sub-tool from the re-mesh
  • Remesh all…

And so on until all of the bricks (poly groups) have been re-meshed. This just seems to be begging for a script. Any ideas?

Best Regards,

Bryce

Why would you want to remesh in this situation?

The meshes are not suitable for subdivision when they are imported into ZBrush. The ReMesh speeds up the process by creating a great all quad and equally distributed poly mesh. I don’t have to worry about creating extra edge loops at the edges of the mesh in 3ds Max. I really don’t have to worry at all about the mesh from max, which was always a step that I felt was very tedious.

Another reason, when using ReMesh All, objects which are close to eachother end up becoming re-meshed together. Thus, the need to hide by individual brick in my example.

I went ahead and wrote a zplugin for this function a while back, but I’m not sure if it’s anything that anybody is interested in using. It does not ReMesh per poly group like I initially requested. I Figured that might be something that the user is better off deciding, so now the plugin ReMeshes per sub-tool. You can also choose to delete the original sub-tools, which then brings up the option to merge the ReMeshed sub-tools. Anyways, if anybody is interested in taking a look at it, I’d be glad to pass it along. It is my first attempt at Zscript, so I’d appreciate any advice as well. I’m certain there’s room for optimization…

I’d enjoy a test of your plugin, if you’re willing to share it. I know I could use this feature too! Thanks for writing what could be a time-saver for many.

Here you go uaun. Hope it serves you well!

A few notes…

  • Please, save your work before running the plugin! Especially if you have the “Delete” option selected. There is no way to undo the Delete operation.

  • The plugin seems to choke if you hit the “start” button from the main toolbar Plugins drop down, but if you dock the Plugins palette and run it from there, then there does not seem to be any snags.

  • The Delete switch has to be clicked twice before it activates. I’ve noticed the Delete switch becoming disabled at startup a couple of times too, but once I restarted, it was working again. :roll_eyes:

  • The plugin will re-mesh all of the sub-tools in the SubTools pallet even if a SubTool is hidden.

Anyone, please feel free to edit or comment on this script. Again, it was my first attempt, and I’d appreciate any feedback.

Best Regards,

Bryce

Attachments

ReMeshPerSubTool01002.zip (4.08 KB)

ISwitches in plugins will become disabled if the user switches to another plugin and then back. The solution is to add a line similar to:

[IEnable,“ZPlugin:My Plugin Menu: Delete”]

for each switch at the end of the code so that it runs any time the plugin is reloaded. You could include this in an initialize routine provided the routine is called each time.

Thanks Marcus! I think I got that right. The problem hasn’t occurred for me since adding the IEnable. :smiley:

Attachments

ReMeshPerSubTool01003.zip (4.09 KB)

thanks for the quick fix, time for testing :slight_smile: