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-06-29 23:15:51 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-29 23:15:51 +0400
commite7928dd4b4b797295e2a3c6f73a57cb242c3423e (patch)
tree9db4afda53f2a7afbccdaf05faf4d221be7e0c7f /source/blender/makesrna/RNA_types.h
parent9a7ea9664e27679935adaea3093630d7a6a30b5d (diff)
RNA
Implementation of RNA side of foreach_get/foreach_set, Campbell will do python code. Three functions for efficiently setting some property for all items in a collection. RNA_property_collection_raw_array gives access to the properties as an array with length, stride, and type specified, if this is possible, i.e. not when it uses a ListBase, or if a manual get/set function is implemented. Two other functions take a C array pointer and get/set it using the a collection + property name, using efficient array access if possible, and otherwise using slower RNA iterator. RNA_property_collection_raw_get RNA_property_collection_raw_set The number of type conversion required here got a bit out of hand, it could be more efficient still if checking for more cases, but function is already long enough. Example: http://www.pasteall.org/6362/c
Diffstat (limited to 'source/blender/makesrna/RNA_types.h')
-rw-r--r--source/blender/makesrna/RNA_types.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index 75f52ededd0..923191cba78 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -110,7 +110,9 @@ typedef enum PropertyFlag {
PROP_BUILTIN = 128,
PROP_EXPORT = 256,
PROP_RUNTIME = 512,
- PROP_IDPROPERTY = 1024
+ PROP_IDPROPERTY = 1024,
+ PROP_RAW_ACCESS = 8192,
+ PROP_RAW_ARRAY = 16384,
} PropertyFlag;
typedef struct CollectionPropertyIterator {
@@ -132,6 +134,21 @@ typedef struct CollectionPointerLink {
PointerRNA ptr;
} CollectionPointerLink;
+typedef enum RawPropertyType {
+ PROP_RAW_CHAR,
+ PROP_RAW_SHORT,
+ PROP_RAW_INT,
+ PROP_RAW_FLOAT,
+ PROP_RAW_DOUBLE
+} RawPropertyType;
+
+typedef struct RawArray {
+ void *array;
+ RawPropertyType type;
+ int len;
+ int stride;
+} RawArray;
+
/* Iterator Utility */
typedef struct EnumPropertyItem {