diff options
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/pose_edit.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index 857176937dc..91893af003f 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -898,6 +898,20 @@ static int pose_bone_layers_exec(bContext *C, wmOperator *op) Object *prev_ob = NULL; + /* Make sure that the pose bone data is up to date. + * (May not always be the case after undo/redo e.g.). + */ + struct Main *bmain = CTX_data_main(C); + wmWindow *win = CTX_wm_window(C); + View3D *v3d = CTX_wm_view3d(C); /* This may be NULL in a lot of cases. */ + ViewLayer *view_layer = WM_window_get_active_view_layer(win); + + FOREACH_OBJECT_IN_MODE_BEGIN (view_layer, v3d, OB_ARMATURE, OB_MODE_POSE, ob_iter) { + bArmature *arm = ob_iter->data; + BKE_pose_ensure(bmain, ob_iter, arm, true); + } + FOREACH_OBJECT_IN_MODE_END; + /* set layers of pchans based on the values set in the operator props */ CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) { /* get pointer for pchan, and write flags this way */ |