Revision: 14435
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14435
Author:   aligorith
Date:     2008-04-16 09:33:54 +0200 (Wed, 16 Apr 2008)

Log Message:
-----------
Bugfix #8948: Transformation constraint - destination rotation is in radians

Unfortunately, my previous fixes here to get gears working resulted in this 
problem. The flip side of that was that gears worked for quite a few cases. 

Alas, it is not to be... The bug is now fixed, but gears no longer work any 
more. Sadly, there is not much I can do about this.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/constraint.c
    trunk/blender/source/blender/src/buttons_object.c

Modified: trunk/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/constraint.c 2008-04-16 
07:27:42 UTC (rev 14434)
+++ trunk/blender/source/blender/blenkernel/intern/constraint.c 2008-04-16 
07:33:54 UTC (rev 14435)
@@ -3178,12 +3178,6 @@
                        }
                }
                
-               /* convert radians<->degrees */
-               if (data->to == 1) {
-                       /* if output is rotation, convert to radians from 
degrees */
-                       for (i=0; i<3; i++) 
-                               sval[i] = sval[i] / 180 * M_PI;
-               }
                
                /* apply transforms */
                switch (data->to) {
@@ -3195,11 +3189,14 @@
                                for (i=0; i<3; i++) {
                                        float tmin, tmax;
                                        
-                                       /* convert destination min/max ranges 
from degrees to radians */
-                                       tmin= data->to_min[i] / M_PI * 180;
-                                       tmax= data->to_max[i] / M_PI * 180;
+                                       tmin= data->to_min[i];
+                                       tmax= data->to_max[i];
                                        
+                                       /* all values here should be in degrees 
*/
                                        eul[i]= tmin + (sval[data->map[i]] * 
(tmax - tmin)); 
+                                       
+                                       /* now convert final value back to 
radians */
+                                       eul[i] = eul[i] / 180 * M_PI;
                                }
                                break;
                        default: /* location */

Modified: trunk/blender/source/blender/src/buttons_object.c
===================================================================
--- trunk/blender/source/blender/src/buttons_object.c   2008-04-16 07:27:42 UTC 
(rev 14434)
+++ trunk/blender/source/blender/src/buttons_object.c   2008-04-16 07:33:54 UTC 
(rev 14435)
@@ -1645,7 +1645,7 @@
                                uiBlockEndAlign(block);
                                
                                /* Extrapolate Ranges? */
-                               uiDefButBitC(block, TOG, 1, B_CONSTRAINT_TEST, 
"Extrapolate", *xco, *yco-42,80,19, &data->expo, 0, 0, 0, 0, "Extrapolate 
ranges");
+                               uiDefButBitC(block, TOG, 1, B_CONSTRAINT_TEST, 
"Extrapolate", *xco-10, *yco-42,80,19, &data->expo, 0, 0, 0, 0, "Extrapolate 
ranges");
                                
                                /* Draw options for source motion */
                                uiDefBut(block, LABEL, B_CONSTRAINT_TEST, 
"Source:", *xco-10, *yco-62, 50, 18, NULL, 0.0, 0.0, 0.0, 0.0, ""); 


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to