Revision: 15175
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15175
Author:   theeth
Date:     2008-06-09 18:54:54 +0200 (Mon, 09 Jun 2008)

Log Message:
-----------
PATCH: [#13656] Bad rotation computing for manual rotation higher than 180 
degrees

By Fabrice Tiercelin

This enables rotation angles of more than 180 degrees to result in the same 
rotation applied to the object (the result used to be clamps between -180 - 180 
of the initial rotation).

The patch had to be modified to deal with IPO keys properly

Modified Paths:
--------------
    trunk/blender/source/blender/src/transform.c

Modified: trunk/blender/source/blender/src/transform.c
===================================================================
--- trunk/blender/source/blender/src/transform.c        2008-06-09 16:49:33 UTC 
(rev 15174)
+++ trunk/blender/source/blender/src/transform.c        2008-06-09 16:54:54 UTC 
(rev 15175)
@@ -2530,15 +2530,22 @@
                                /* are there ipo keys? */
                                if(td->tdi) {
                                        TransDataIpokey *tdi= td->tdi;
+                                       float current_rot[3];
                                        float rot[3];
                                        
+                                       /* current IPO value for compatible 
euler */
+                                       current_rot[0] = tdi->rotx[0];
+                                       current_rot[1] = tdi->roty[0];
+                                       current_rot[2] = tdi->rotz[0];
+                                       VecMulf(current_rot, (float)(M_PI_2 / 
9.0));
+                                       
                                        /* calculate the total rotatation in 
eulers */
                                        VecAddf(eul, td->ext->irot, 
td->ext->drot);
                                        EulToMat3(eul, obmat);
                                        /* mat = transform, obmat = object 
rotation */
                                        Mat3MulMat3(fmat, mat, obmat);
                                        
-                                       Mat3ToCompatibleEul(fmat, eul, 
td->ext->irot);
+                                       Mat3ToCompatibleEul(fmat, eul, 
current_rot);
                                        
                                        /* correct back for delta rot */
                                        if(tdi->flag & TOB_IPODROT) {
@@ -2567,7 +2574,7 @@
                                        /* mat = transform, obmat = object 
rotation */
                                        Mat3MulMat3(fmat, smat, obmat);
                                        
-                                       Mat3ToCompatibleEul(fmat, eul, 
td->ext->irot);
+                                       Mat3ToCompatibleEul(fmat, eul, 
td->ext->rot);
                                        
                                        /* correct back for delta rot */
                                        VecSubf(eul, eul, td->ext->drot);


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to