fix for the rna curve interpolation enum, 'ease' was using the same value as Bezier.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 12 Aug 2010 06:28:46 +0000 (06:28 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 12 Aug 2010 06:28:46 +0000 (06:28 +0000)
source/blender/blenkernel/intern/curve.c
source/blender/makesdna/DNA_curve_types.h
source/blender/makesrna/intern/rna_curve.c

index 841bd635acf8b73858c56603e5b6477c746fc876..358dd1914e75080270fb6ff0dfdc27010d8d473a 100644 (file)
@@ -1573,7 +1573,7 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *
        
        for(a=0; a<resolu; a++, fac+= dfac) {
                if (tilt_array) {
-                       if (nu->tilt_interp==3) { /* May as well support for tilt also 2.47 ease interp */
+                       if (nu->tilt_interp==KEY_CU_EASE) { /* May as well support for tilt also 2.47 ease interp */
                                *tilt_array = prevbezt->alfa + (bezt->alfa - prevbezt->alfa)*(3.0f*fac*fac - 2.0f*fac*fac*fac);
                        } else {
                                key_curve_position_weights(fac, t, nu->tilt_interp);
@@ -1584,7 +1584,7 @@ static void alfa_bezpart(BezTriple *prevbezt, BezTriple *bezt, Nurb *nu, float *
                }
                
                if (radius_array) {
-                       if (nu->radius_interp==3) {
+                       if (nu->radius_interp==KEY_CU_EASE) {
                                /* Support 2.47 ease interp
                                 * Note! - this only takes the 2 points into account,
                                 * giving much more localized results to changes in radius, sometimes you want that */
index 973ba896100c501fbc0bfa0ea48368b736e08396..8537b703c69f1d5d7e84bb545fba4087eb55345d 100644 (file)
@@ -346,5 +346,9 @@ typedef enum eBezTriple_KeyframeType {
 #define CU_CHINFO_SMALLCAPS    (1<<4)
 #define CU_CHINFO_SMALLCAPS_CHECK (1<<5) /* set at runtime, checks if case switching is needed */
 
+/* mixed with KEY_LINEAR but define here since only curve supports */
+#define KEY_CU_EASE                    3
+
+
 #endif
 
index 2cd7953d878752935665bce0752f3da7b895bbd9..d513b13c92353ef1d9004d7b601322b6b8c7089f 100644 (file)
@@ -29,6 +29,7 @@
 #include "rna_internal.h"
 
 #include "DNA_curve_types.h"
+#include "DNA_key_types.h"
 #include "DNA_material_types.h"
 #include "DNA_scene_types.h"
 
@@ -1252,10 +1253,10 @@ static void rna_def_curve(BlenderRNA *brna)
 static void rna_def_curve_nurb(BlenderRNA *brna)
 {
        static EnumPropertyItem spline_interpolation_items[] = {
-               {BEZT_IPO_CONST, "LINEAR", 0, "Linear", ""},
-               {BEZT_IPO_LIN, "CARDINAL", 0, "Cardinal", ""},
-               {BEZT_IPO_BEZ, "BSPLINE", 0, "BSpline", ""},
-               {BEZT_IPO_BEZ, "EASE", 0, "Ease", ""},
+               {KEY_LINEAR, "LINEAR", 0, "Linear", ""},
+               {KEY_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
+               {KEY_BSPLINE, "BSPLINE", 0, "BSpline", ""},
+               {KEY_CU_EASE, "EASE", 0, "Ease", ""}, /* todo, define somewhere, not one of BEZT_IPO_* */
                {0, NULL, 0, NULL, NULL}};
 
        StructRNA *srna;