FCurve: only calculate single axis length
authorCampbell Barton <ideasman42@gmail.com>
Fri, 2 Mar 2018 01:43:41 +0000 (12:43 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 2 Mar 2018 01:45:25 +0000 (12:45 +1100)
Was calculating all 3

source/blender/blenkernel/intern/fcurve.c

index d7e8c62375b5e2ca9e756d423daab684f8bc255e..905f103250a2fd2f13e97c7c08026771dfcda481 100644 (file)
@@ -1590,11 +1590,9 @@ static float dvar_eval_transChan(ChannelDriver *driver, DriverVar *dvar)
                return 0.0f;
        }
        else if (dtar->transChan >= DTAR_TRANSCHAN_SCALEX) {
-               /* extract scale, and choose the right axis */
-               float scale[3];
-               
-               mat4_to_size(scale, mat);
-               return scale[dtar->transChan - DTAR_TRANSCHAN_SCALEX];
+               /* Extract scale, and choose the right axis,
+                * inline 'mat4_to_size'. */
+               return len_v3(mat[dtar->transChan - DTAR_TRANSCHAN_SCALEX]);
        }
        else if (dtar->transChan >= DTAR_TRANSCHAN_ROTX) {
                /* extract rotation as eulers (if needed)