[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58596] trunk/blender/source/blender/ editors: fix [#36278] X, Y Direction wrong after bpy.ops.view3d.viewnumpad

Campbell Barton ideasman42 at gmail.com
Thu Jul 25 13:05:08 CEST 2013


Revision: 58596
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58596
Author:   campbellbarton
Date:     2013-07-25 11:05:08 +0000 (Thu, 25 Jul 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
    trunk/blender/source/blender/editors/transform/transform_orientations.c

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_edit.c	2013-07-25 10:34:30 UTC (rev 58595)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_edit.c	2013-07-25 11:05:08 UTC (rev 58596)
@@ -3241,16 +3241,11 @@
 			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);

Modified: trunk/blender/source/blender/editors/transform/transform_orientations.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_orientations.c	2013-07-25 10:34:30 UTC (rev 58595)
+++ trunk/blender/source/blender/editors/transform/transform_orientations.c	2013-07-25 11:05:08 UTC (rev 58596)
@@ -895,8 +895,11 @@
 		}
 		
 		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;
 	}




More information about the Bf-blender-cvs mailing list