Pie menu: PIE_OT_SetObjectModePie() in space_view3d_pie_menus is not adding an undo step when executed #86707

Open
opened 2021-03-18 16:23:42 +01:00 by Henrik Berglund · 4 comments

System Information
Operating system: Win10 64
Graphics card: GTX1070

Blender Version
Broken:
2.93 Alpha d7fb38ddd4af (and likely before)

Short description of error
PIE_OT_SetObjectModePie() in space_view3d_pie_menus is not adding an undo step when executed. For example used by gpencil mode switching and armature pose/object mode switching. This leads to the annoying behavior where if you switch a mode using a pie menu, do something (for example sculpt) and undo directly after, the mode switch is undone as well.

I fixed it temporarily by adding 'UNDO' to the operator bl_options but there's probably a nicer way since this makes the undo history say "Set the object interactive mode" instead of showing the actual mode.

Exact steps for others to reproduce the error
From startup blend: (assuming pie menus are enabled)

  1. Add a GP Monkey.
  2. Mode switch from Object mode to Sculpt mode using the pie menu.
  3. Show undo history to display it without actually undoing, no mode change information is shown.
  4. Sculpt a bit on the GP object.
  5. Press undo.
  6. You are in object mode again.

Expected:

  1. Add a GP Monkey.
  2. Mode switch from Object mode to Sculpt mode using the pie menu.
  3. Show undo history to display it without actually undoing, "Toggle Sculpt Mode" or something similar is shown.
  4. Sculpt a bit on the GP object.
  5. Press undo.
  6. You are in sculpt mode before you sculpted.
**System Information** Operating system: Win10 64 Graphics card: GTX1070 **Blender Version** Broken: 2.93 Alpha d7fb38ddd4af (and likely before) **Short description of error** PIE_OT_SetObjectModePie() in space_view3d_pie_menus is not adding an undo step when executed. For example used by gpencil mode switching and armature pose/object mode switching. This leads to the annoying behavior where if you switch a mode using a pie menu, do something (for example sculpt) and undo directly after, the mode switch is undone as well. I fixed it temporarily by adding 'UNDO' to the operator bl_options but there's probably a nicer way since this makes the undo history say "Set the object interactive mode" instead of showing the actual mode. **Exact steps for others to reproduce the error** From startup blend: (assuming pie menus are enabled) 1. Add a GP Monkey. 2. Mode switch from Object mode to Sculpt mode using the pie menu. 3. Show undo history to display it without actually undoing, no mode change information is shown. 4. Sculpt a bit on the GP object. 5. Press undo. 6. You are in object mode again. Expected: 1. Add a GP Monkey. 2. Mode switch from Object mode to Sculpt mode using the pie menu. 3. Show undo history to display it without actually undoing, "Toggle Sculpt Mode" or something similar is shown. 4. Sculpt a bit on the GP object. 5. Press undo. 6. You are in sculpt mode before you sculpted.
Author
Member

Added subscriber: @cyaoeu

Added subscriber: @cyaoeu
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

An undo step is only necessary if the ID data are changed, so this is not considered a bug, but I will let the developer make a more informed decision.

An undo step is only necessary if the ID data are changed, so this is not considered a bug, but I will let the developer make a more informed decision.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#86707
No description provided.