diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-24 16:12:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-24 16:22:15 +0300 |
commit | 0d768cca65c065a8560ba6fd16af88aeee906eb8 (patch) | |
tree | c9b2a85552e7e3ff190cd227267b5b97b3948a64 /source/blender/editors/transform/transform_orientations.c | |
parent | 40dfb3eed6588c36c4e09f410fd0d8ee2b43bb59 (diff) |
Fix T55177: pose-mode manipulator placement w/ COW
Diffstat (limited to 'source/blender/editors/transform/transform_orientations.c')
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 19df46455d7..3065007ea6b 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -56,6 +56,8 @@ #include "BKE_scene.h" #include "BKE_workspace.h" +#include "DEG_depsgraph_query.h" + #include "BLT_translation.h" #include "ED_armature.h" @@ -1014,12 +1016,14 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3 } } else if (ob && (ob->mode & OB_MODE_POSE)) { - bArmature *arm = ob->data; + const Depsgraph *depsgraph = CTX_data_depsgraph(C); + Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); + bArmature *arm = ob_eval->data; bPoseChannel *pchan; float imat[3][3], mat[3][3]; bool ok = false; - if (activeOnly && (pchan = BKE_pose_channel_active(ob))) { + if (activeOnly && (pchan = BKE_pose_channel_active(ob_eval))) { add_v3_v3(normal, pchan->pose_mat[2]); add_v3_v3(plane, pchan->pose_mat[1]); ok = true; @@ -1030,7 +1034,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3 totsel = count_bone_select(arm, &arm->bonebase, true); if (totsel) { /* use channels to get stats */ - for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { + for (pchan = ob_eval->pose->chanbase.first; pchan; pchan = pchan->next) { if (pchan->bone && pchan->bone->flag & BONE_TRANSFORM) { add_v3_v3(normal, pchan->pose_mat[2]); add_v3_v3(plane, pchan->pose_mat[1]); @@ -1043,7 +1047,7 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3 /* use for both active & all */ if (ok) { /* we need the transpose of the inverse for a normal... */ - copy_m3_m4(imat, ob->obmat); + copy_m3_m4(imat, ob_eval->obmat); invert_m3_m3(mat, imat); transpose_m3(mat); |