Blender Git Commit Log
Git Commits -> Revision 6f21137
Revision 6f21137 by Campbell Barton (master) June 3, 2020, 08:29 (GMT) |
Object: refactor mode switching Functionality here has become confusing over time, this removes duplicate, similar functions, preferring to set the mode instead of toggle, enter, exit. Mode switching utility function behaved differently regarding undo, 'ED_object_mode_toggle' for example didn't skip the undo push where 'ED_object_mode_set' did. Some callers chose these functions based on the intended undo behavior, even when toggling didn't make sense. There was also ED_object_mode_generic_enter which was similar to ED_object_mode_set, instead of the reverse of ED_object_mode_generic_exit. Simplify object mode switching internals: - Replace ED_object_mode_generic_enter with ED_object_mode_set. - Remove ED_object_mode_toggle as nearly all callers needed to check the current mode so toggling would set the mode argument correctly. - Use ED_object_mode_set for the object mode switching operator to simplify logic. - Add ED_object_mode_set_ex which has an argument to disable undo, needed when loading undo data needs to set the mode. - Remove unused ED_object_mode_exit. |
Commit Details:
Full Hash: 6f21137722fb1d4376691cd27cb710aa77e5170e
Parent Commit: 53cb1a3
Lines Changed: +58, -82
11 Modified Paths:
/source/blender/editors/animation/keyframing.c (+2, -2) (Diff)
/source/blender/editors/curve/editfont_undo.c (+1, -1) (Diff)
/source/blender/editors/include/ED_object.h (+5, -4) (Diff)
/source/blender/editors/io/io_alembic.c (+1, -1) (Diff)
/source/blender/editors/object/object_edit.c (+6, -22) (Diff)
/source/blender/editors/object/object_modes.c (+37, -45) (Diff)
/source/blender/editors/physics/particle_edit_undo.c (+1, -1) (Diff)
/source/blender/editors/screen/workspace_edit.c (+2, -3) (Diff)
/source/blender/editors/space_image/image_undo.c (+1, -1) (Diff)
/source/blender/editors/space_view3d/view3d_buttons.c (+1, -1) (Diff)
/source/blender/editors/util/ed_util.c (+1, -1) (Diff)
/source/blender/editors/curve/editfont_undo.c (+1, -1) (Diff)
/source/blender/editors/include/ED_object.h (+5, -4) (Diff)
/source/blender/editors/io/io_alembic.c (+1, -1) (Diff)
/source/blender/editors/object/object_edit.c (+6, -22) (Diff)
/source/blender/editors/object/object_modes.c (+37, -45) (Diff)
/source/blender/editors/physics/particle_edit_undo.c (+1, -1) (Diff)
/source/blender/editors/screen/workspace_edit.c (+2, -3) (Diff)
/source/blender/editors/space_image/image_undo.c (+1, -1) (Diff)
/source/blender/editors/space_view3d/view3d_buttons.c (+1, -1) (Diff)
/source/blender/editors/util/ed_util.c (+1, -1) (Diff)