diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-11 09:53:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-11 09:53:59 +0300 |
commit | 32339a56f11ac1392c4b8d8651ff452a2a5511cc (patch) | |
tree | 15bf50d82f588225375e1c86b08e146758ad17ca /source/blender/editors/object | |
parent | f55adabb3e5d3a75ecdb30f90487e314f0afb753 (diff) |
Cleanup: minor changes to pose-mode switching API
Prepare for multi-object pose mode
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 803b183fea1..0eda9668c47 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -703,7 +703,7 @@ static int posemode_exec(bContext *C, wmOperator *op) Base *base = CTX_data_active_base(C); Object *ob = base->object; const int mode_flag = OB_MODE_POSE; - const bool is_mode_set = (ob->mode & mode_flag) != 0; + bool is_mode_set = (ob->mode & mode_flag) != 0; if (!is_mode_set) { if (!ED_object_mode_compat_set(C, ob, mode_flag, op->reports)) { @@ -714,12 +714,15 @@ static int posemode_exec(bContext *C, wmOperator *op) if (ob->type == OB_ARMATURE) { if (ob == CTX_data_edit_object(C)) { ED_object_editmode_exit(C, EM_FREEDATA | EM_DO_UNDO); - ED_armature_enter_posemode(C, base); + is_mode_set = false; + } + + if (is_mode_set) { + ED_object_posemode_exit(C, base); + } + else { + ED_object_posemode_enter(C, base); } - else if (is_mode_set) - ED_armature_exit_posemode(C, base); - else - ED_armature_enter_posemode(C, base); return OPERATOR_FINISHED; } |