Revision: 36058
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36058
Author:   campbellbarton
Date:     2011-04-08 13:32:56 +0000 (Fri, 08 Apr 2011)
Log Message:
-----------
add new subtype PROP_COORDS, for generic coordinates that are not to be changed 
by units.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/RNA_types.h
    trunk/blender/source/blender/makesrna/intern/makesrna.c
    trunk/blender/source/blender/makesrna/intern/rna_fcurve.c
    trunk/blender/source/blender/makesrna/intern/rna_rna.c
    trunk/blender/source/blender/python/intern/bpy_rna.c

Modified: trunk/blender/source/blender/makesrna/RNA_types.h
===================================================================
--- trunk/blender/source/blender/makesrna/RNA_types.h   2011-04-08 12:49:38 UTC 
(rev 36057)
+++ trunk/blender/source/blender/makesrna/RNA_types.h   2011-04-08 13:32:56 UTC 
(rev 36058)
@@ -127,6 +127,7 @@
        PROP_XYZ = 29,
        PROP_XYZ_LENGTH = 29|PROP_UNIT_LENGTH,
        PROP_COLOR_GAMMA = 30,
+       PROP_COORDS = 31, /* generic array, no units applied, only that x/y/z/w 
are used (python vec) */
 
        /* booleans */
        PROP_LAYER = 40,

Modified: trunk/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/makesrna.c     2011-04-08 
12:49:38 UTC (rev 36057)
+++ trunk/blender/source/blender/makesrna/intern/makesrna.c     2011-04-08 
13:32:56 UTC (rev 36058)
@@ -1776,6 +1776,7 @@
                case PROP_ACCELERATION: return "PROP_ACCELERATION";
                case PROP_XYZ: return "PROP_XYZ";
                case PROP_COLOR_GAMMA: return "PROP_COLOR_GAMMA";
+               case PROP_COORDS: return "PROP_COORDS";
                case PROP_LAYER: return "PROP_LAYER";
                case PROP_LAYER_MEMBER: return "PROP_LAYER_MEMBER";
                default: {

Modified: trunk/blender/source/blender/makesrna/intern/rna_fcurve.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_fcurve.c   2011-04-08 
12:49:38 UTC (rev 36057)
+++ trunk/blender/source/blender/makesrna/intern/rna_fcurve.c   2011-04-08 
13:32:56 UTC (rev 36058)
@@ -1219,7 +1219,7 @@
        RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, 
NULL);
        
        /* Vector value */
-       prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_NONE); /* keyframes 
are dimensionless */
+       prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* 
keyframes are dimensionless */
        RNA_def_property_float_sdna(prop, NULL, "vec");
        RNA_def_property_array(prop, 2);
        RNA_def_property_ui_text(prop, "Point", "Point coordinates");
@@ -1281,19 +1281,19 @@
        RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL);
        
        /* Vector values */
-       prop= RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_NONE); /* 
keyframes are dimensionless */
+       prop= RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_COORDS); 
/* keyframes are dimensionless */
        RNA_def_property_array(prop, 2);
        RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle1_get", 
"rna_FKeyframe_handle1_set", NULL);
        RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first 
handle");
        RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
        
-       prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_NONE); /* keyframes 
are dimensionless */
+       prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_COORDS); /* 
keyframes are dimensionless */
        RNA_def_property_array(prop, 2);
        RNA_def_property_float_funcs(prop, "rna_FKeyframe_ctrlpoint_get", 
"rna_FKeyframe_ctrlpoint_set", NULL);
        RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the 
control point");
        RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
        
-       prop= RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_NONE); /* 
keyframes are dimensionless */
+       prop= RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_COORDS); 
/* keyframes are dimensionless */
        RNA_def_property_array(prop, 2);
        RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle2_get", 
"rna_FKeyframe_handle2_set", NULL);
        RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second 
handle");

Modified: trunk/blender/source/blender/makesrna/intern/rna_rna.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_rna.c      2011-04-08 
12:49:38 UTC (rev 36057)
+++ trunk/blender/source/blender/makesrna/intern/rna_rna.c      2011-04-08 
13:32:56 UTC (rev 36058)
@@ -967,6 +967,7 @@
                {PROP_QUATERNION, "QUATERNION", 0, "Quaternion", ""},
                {PROP_XYZ, "XYZ", 0, "XYZ", ""},
                {PROP_COLOR_GAMMA, "COLOR_GAMMA", 0, "Gamma Corrected Color", 
""},
+               {PROP_COORDS, "COORDINATES", 0, "Vector Coordinates", ""},
                {PROP_LAYER, "LAYER", 0, "Layer", ""},
                {PROP_LAYER_MEMBER, "LAYER_MEMBERSHIP", 0, "Layer Membership", 
""},
                {0, NULL, 0, NULL, NULL}};

Modified: trunk/blender/source/blender/python/intern/bpy_rna.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_rna.c        2011-04-08 
12:49:38 UTC (rev 36057)
+++ trunk/blender/source/blender/python/intern/bpy_rna.c        2011-04-08 
13:32:56 UTC (rev 36058)
@@ -549,7 +549,7 @@
 
 /* note that PROP_NONE is included as a vector subtype. this is because its 
handy to
  * have x/y access to fcurve keyframes and other fixed size float arrayas of 
length 2-4. */
-#define PROP_ALL_VECTOR_SUBTYPES PROP_NONE: case PROP_TRANSLATION: case 
PROP_DIRECTION: case PROP_VELOCITY: case PROP_ACCELERATION: case PROP_XYZ: case 
PROP_XYZ_LENGTH
+#define PROP_ALL_VECTOR_SUBTYPES PROP_COORDS: case PROP_TRANSLATION: case 
PROP_DIRECTION: case PROP_VELOCITY: case PROP_ACCELERATION: case PROP_XYZ: case 
PROP_XYZ_LENGTH
 
 PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop)
 {

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

Reply via email to