System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: Radeon RX 580 Series ATI Technologies Inc. 4.5.13570 Core Profile Context 19.8.1 26.20.13001.29010
Blender Version
Broken: version: 2.81 (sub 5), branch: master, commit date: 2019-09-04 00:01, hash: rBda25aca2677e
Worked: (optional)
Short description of error
Can't undo annotations in Sculpt Mode
Exact steps for others to reproduce the error
Go to sculpt
Make some strokes with annotation tool
CTRL+Z (can't undo)
Due to the lack of this feature I made a similar (and specific) way to undo annotations by just deleting the last stroke:
Also it can be temp. saved to perform a redo with the same operator.
class NSMUI_OT_SculptNotes_UndoStroke(Operator):
bl_idname = "nsmui.sculpt_notes_undo_stroke"
bl_label = "Undo Note in Sculpt"
bl_options = {'REGISTER', 'UNDO'}
def error(self, context):
self.layout.label(text="No strokes to undo !")
def execute(self, context):
noteData = context.scene.grease_pencil
frame = noteData.layers.active.active_frame
if len(frame.strokes) < 1:
bpy.context.window_manager.popup_menu(NSMUI_OT_SculptNotes_UndoStroke.error, title = "Can't do this !", icon = 'INFO')
else:
numStrokes = len(frame.strokes)
lastStroke = frame.strokes[numStrokes-1]
frame.strokes.remove(lastStroke)
return {'FINISHED'}