Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-08-11 01:31:05 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-08-11 01:31:05 +0400
commitf6682ab773c91ef0f760efdbe69f1a599cc1ac95 (patch)
tree94cd702de42afc5607e3159b54ee1698d4233347 /source/blender/makesrna/RNA_types.h
parent6e5b78a2774b3d10226e3c48e558a9059086e416 (diff)
RNA: subtypes and units
* Reviewed subtypes, making them more specific and adding new ones. * Subtypes now have an associated type of units (length, area, volume, mass, rotation, time, velocity, acceleration). These are not used yet anywhere. * Centralized code that decides the name of array items based on subtype (XYZ, RGB), was copied in 3 places. * RNA_def_float etc functions still need to be update, will do this later together with another change.
Diffstat (limited to 'source/blender/makesrna/RNA_types.h')
-rw-r--r--source/blender/makesrna/RNA_types.h50
1 files changed, 41 insertions, 9 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index a1e98ae8a17..0a641ecebe9 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -66,17 +66,49 @@ typedef enum PropertyType {
PROP_COLLECTION = 6
} PropertyType;
+typedef enum PropertyUnit {
+ PROP_UNIT_NONE = (0<<16),
+ PROP_UNIT_LENGTH = (1<<16), /* m */
+ PROP_UNIT_AREA = (2<<16), /* m^2 */
+ PROP_UNIT_VOLUME = (3<<16), /* m^3 */
+ PROP_UNIT_MASS = (4<<16), /* kg */
+ PROP_UNIT_ROTATION = (5<<16), /* rad */
+ PROP_UNIT_TIME = (6<<16), /* frame */
+ PROP_UNIT_VELOCITY = (7<<16), /* m/s */
+ PROP_UNIT_ACCELERATION = (8<<16) /* m/(s^2) */
+} PropertyUnit;
+
+#define RNA_SUBTYPE_UNIT(subtype) (subtype & 0x00FF0000)
+
+/* also update rna_property_subtypename when you change this */
typedef enum PropertySubType {
PROP_NONE = 0,
- PROP_UNSIGNED = 1,
- PROP_FILEPATH = 2,
- PROP_DIRPATH = 3,
- PROP_COLOR = 4,
- PROP_VECTOR = 5,
- PROP_MATRIX = 6,
- PROP_ROTATION = 7,
- PROP_NEVER_NULL = 8,
- PROP_PERCENTAGE = 9
+
+ /* strings */
+ PROP_FILEPATH = 1,
+ PROP_DIRPATH = 2,
+
+ /* numbers */
+ PROP_UNSIGNED = 13,
+ PROP_PERCENTAGE = 14,
+ PROP_ANGLE = 15|PROP_UNIT_ROTATION,
+ PROP_TIME = 16|PROP_UNIT_TIME,
+ PROP_DISTANCE = 17|PROP_UNIT_LENGTH,
+
+ /* number arrays */
+ PROP_COLOR = 20,
+ PROP_TRANSLATION = 21|PROP_UNIT_LENGTH,
+ PROP_DIRECTION = 22,
+ PROP_VELOCITY = 23|PROP_UNIT_VELOCITY,
+ PROP_ACCELERATION = 24|PROP_UNIT_ACCELERATION,
+ PROP_MATRIX = 25,
+ PROP_EULER = 26|PROP_UNIT_ROTATION,
+ PROP_QUATERNION = 27,
+ PROP_XYZ = 28,
+ PROP_RGB = 29,
+
+ /* pointers */
+ PROP_NEVER_NULL = 30,
} PropertySubType;
typedef enum PropertyFlag {