ZBrushCentral

Recalculate Dynamesh

what is the command for recalculating a dynamesh object? I’m trying to create a few buttons that change the dynamesh resolution to 128,256,512 (blur 0) presets and I want my current tool to update with the new resolution without having to touch the mesh and ctrl+click drag on the canvas.

thanks,
z

You can do it by offsetting the mesh temporarily, which will force DynaMesh to update:


[IButton,UpdateDynaMesh,"Update DynaMesh for current mesh",
    
  //first record the current axis setting for Offset
  [VarSet,tmpMod,[IModGet,Tool:Deformation:Offset]]
  //one of the axes must be set, so set it to 1
  [If,(#tmpMod != 1),  //if it's not set to 1 (X axis)
    [IModSet,Tool:Deformation:Offset,1]
  ]
    //turn off the Dynamesh button
  [ISet,Tool:Geometry:Dynamesh,0]
  //offset the tool a little
  [ISet,Tool:Deformation:Offset,1]
  //undo the offset
  [ISet,Tool:Deformation:Offset,-1]
  //turn on the Dynamesh button - mesh will update
  [ISet,Tool:Geometry:Dynamesh,1]
  //reset the Offset axis setting
  [IModSet,Tool:Deformation:Offset,#tmpMod]

]

nice trick, worked great. thanks Marcus!

btw here is the plugin, it creates 4 buttons under “DynaPresets” in the “Tool” subpallet for 128,256,512,728 (all with blur = 0) dynamesh rez.

super simple but speeds up my workflow.

Attachments

DynaPresets.zip (2.54 KB)

zwick,
No problem, and thanks for sharing your plugin. :+1: