From b2b0b58fb5ee48fdbbee1d8f19b4051f80880908 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 25 Jul 2013 11:05:08 +0000 Subject: 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. --- source/blender/editors/transform/transform_orientations.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/transform/transform_orientations.c') 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; } -- cgit v1.2.3