Multi-Object Pose Fixes for POSE_OT_armature_apply()

This operator was only partially converted to multi-object editing,
as on one hand, it was using the new "objects in mode" iterator,
while on the other hand, it was also using the context iterator inside
that, making all selected bones across armatures get included.
This commit is contained in:
Joshua Leung 2018-04-30 16:40:45 +02:00
parent 09dcb6d60c
commit 9114ebe850
1 changed files with 5 additions and 5 deletions

View File

@ -225,13 +225,13 @@ static int pose_visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op))
{
ViewLayer *view_layer = CTX_data_view_layer(C);
FOREACH_OBJECT_IN_MODE_BEGIN(view_layer, OB_MODE_POSE, ob)
FOREACH_OBJECT_IN_MODE_BEGIN(view_layer, OB_MODE_POSE, ob_iter)
{
/* loop over all selected pchans
*
* TODO, loop over children before parents if multiple bones
* at once are to be predictable*/
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pose_bones)
FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN (ob_iter, pchan)
{
float delta_mat[4][4];
@ -247,12 +247,12 @@ static int pose_visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op))
BKE_pchan_apply_mat4(pchan, delta_mat, true);
}
CTX_DATA_END;
FOREACH_PCHAN_SELECTED_IN_OBJECT_END;
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
DEG_id_tag_update(&ob_iter->id, OB_RECALC_DATA);
/* note, notifier might evolve */
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob_iter);
}
FOREACH_OBJECT_IN_MODE_END;