diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-25 15:05:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-25 15:05:08 +0400 |
commit | b2b0b58fb5ee48fdbbee1d8f19b4051f80880908 (patch) | |
tree | 6126012b0c749a3529e3f5144929f340d0c69d60 | |
parent | aec8cff9ab730fdf525242ffbf1f4dcfd67c2bb1 (diff) |
fix [#36278] X,Y Direction wrong after bpy.ops.view3d.viewnumpad
the cause of the problem was the orientation from the active object was inconstant.
copying the obmat directly gave a different result then getting the normal,tangent from getTransformOrientation and passing to createSpaceNormalTangent.
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 7 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 5 |
2 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index bfc64d1d37a..a361d1419d4 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -3241,16 +3241,11 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar, align_active = false; } else { - const float z_flip_quat[4] = {0.0f, 0.0f, 0.0f, 1.0f}; float obact_quat[4]; float twmat[3][3]; - /* flip the input, the end result being that an object - * with no rotation behaves as if 'align_active' is off */ - mul_qt_qtqt(new_quat, new_quat, z_flip_quat); - /* same as transform manipulator when normal is set */ - ED_getTransformOrientationMatrix(C, twmat, false); + ED_getTransformOrientationMatrix(C, twmat, true); mat3_to_quat(obact_quat, twmat); invert_qt(obact_quat); diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 47a63bdb063..a424613d616 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -895,8 +895,11 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], } if (ob) { + /* note: negating the plane so when used with createSpaceNormalTangent(), + * we want the normal and the plane to make the same orientation as + * what we would get from 'ob->obmat' */ copy_v3_v3(normal, ob->obmat[2]); - copy_v3_v3(plane, ob->obmat[1]); + negate_v3_v3(plane, ob->obmat[1]); } result = ORIENTATION_NORMAL; } |