Hello,
Very simple script to help decimate the mesh during sculpting. The problem is that UNDO does not work( does not restore mesh state before decimation). Can anyone give me tips how to go about it so i can undo/not lose data. Thank You
[SUB]
class nwDecimate(bpy.types.Operator):
“”“Tooltip Sculpt Decimate”""
bl_idname = “nw.decimate”
bl_label = “nw Decimate Mesh”
bl_options = {‘REGISTER’, ‘UNDO’}
def invoke(self, context, abc):
print ("Decimating")
bpy.ops.object.modifier_add(type='DECIMATE')
bpy.context.object.modifiers["Decimate"].ratio = 0.5
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Decimate")
return {'FINISHED'}[/SUB]