diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-12-01 19:43:10 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-12-01 19:44:24 +0300 |
commit | 18f06186778ea67583a362a611b1efa8c9da5fbd (patch) | |
tree | 70f2fd8b2d9f9f0d9c47899d2ea210d1b9d8a71a /source/blender/editors/armature/pose_edit.c | |
parent | 9ed522db735b1d798a5d68c6bf547e8123d33a4b (diff) |
Fix T58412: in weight paint + pose mode certain armature operations crash.
The cause is that FOREACH_OBJECT_IN_MODE_BEGIN assumed that the active
object is in the correct mode, which is wrong in this case. It also
only considered objects of the same type as active, which had to be
replaced with an explicit type parameter.
Diffstat (limited to 'source/blender/editors/armature/pose_edit.c')
-rw-r--r-- | source/blender/editors/armature/pose_edit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index 715203135d9..4864f001782 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -744,7 +744,7 @@ static int pose_flip_names_exec(bContext *C, wmOperator *op) View3D *v3d = CTX_wm_view3d(C); const bool do_strip_numbers = RNA_boolean_get(op->ptr, "do_strip_numbers"); - FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, OB_MODE_POSE, ob) + FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob) { bArmature *arm = ob->data; ListBase bones_names = {NULL}; @@ -1329,7 +1329,7 @@ static int pose_flip_quats_exec(bContext *C, wmOperator *UNUSED(op)) ViewLayer *view_layer = CTX_data_view_layer(C); View3D *v3d = CTX_wm_view3d(C); - FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, OB_MODE_POSE, ob_iter) { + FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob_iter) { bool changed = false; /* loop through all selected pchans, flipping and keying (as needed) */ FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN (ob_iter, pchan) { |