mirror of
https://github.com/blender/blender-addons.git
synced 2025-07-21 23:46:24 +00:00
GPencil Tools: Optimize Undo for Rotate Canvas
The `rotate canvas` feature now adds steps to the undo stack only in camera view. This change prevents the unnecessary filling of the undo stack when used in free view, enhancing usability.
This commit is contained in:
@ -6,7 +6,7 @@ bl_info = {
|
||||
"name": "Grease Pencil Tools",
|
||||
"description": "Extra tools for Grease Pencil",
|
||||
"author": "Samuel Bernou, Antonio Vazquez, Daniel Martinez Lara, Matias Mendiola",
|
||||
"version": (1, 8, 2),
|
||||
"version": (1, 8, 3),
|
||||
"blender": (3, 0, 0),
|
||||
"location": "Sidebar > Grease Pencil > Grease Pencil Tools",
|
||||
"warning": "",
|
||||
|
@ -68,7 +68,7 @@ def draw_callback_px(self, context):
|
||||
class RC_OT_RotateCanvas(bpy.types.Operator):
|
||||
bl_idname = 'view3d.rotate_canvas'
|
||||
bl_label = 'Rotate Canvas'
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
bl_options = {"REGISTER"}
|
||||
|
||||
def get_center_view(self, context, cam):
|
||||
'''
|
||||
@ -109,7 +109,9 @@ class RC_OT_RotateCanvas(bpy.types.Operator):
|
||||
bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
|
||||
context.area.tag_redraw()
|
||||
if self.in_cam:
|
||||
self.cam.rotation_mode = self.org_rotation_mode
|
||||
self.cam.rotation_mode = self.org_rotation_mode
|
||||
# Undo step is only needed if used within camera
|
||||
bpy.ops.ed.undo_push(message='Rotate Canvas')
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user