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:
authorCampbell Barton <ideasman42@gmail.com>2011-01-16 18:02:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-16 18:02:07 +0300
commite025bf3967fc281db09b7a75d9fef2b78ba3181e (patch)
treed9dcb70d7bb24dc7a62792f94c6381e7ec0e1af3 /source/blender/makesrna/intern/rna_internal_types.h
parent5b3bf80dd89ab08abf0f22a7eba636e7127955e2 (diff)
defining types via python gave confusing errors because DefRNA.laststruct was being used for errors when the new property wasn't on the last struct.
added CONTAINER_RNA_ID() define to get the ID from the ContainerRNA type.
Diffstat (limited to 'source/blender/makesrna/intern/rna_internal_types.h')
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index 2bb47643e14..c31c473512a 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -108,7 +108,7 @@ struct FunctionRNA {
/* structs are containers of properties */
ContainerRNA cont;
- /* unique identifier */
+ /* unique identifier, keep after 'cont' */
const char *identifier;
/* various options */
int flag;
@@ -283,13 +283,14 @@ struct StructRNA {
/* structs are containers of properties */
ContainerRNA cont;
+ /* unique identifier, keep after 'cont' */
+ const char *identifier;
+
/* python type, this is a subtype of pyrna_struct_Type but used so each struct can have its own type
* which is useful for subclassing RNA */
void *py_type;
void *blender_type;
- /* unique identifier */
- const char *identifier;
/* various options */
int flag;
@@ -340,4 +341,6 @@ struct BlenderRNA {
ListBase structs;
};
+#define CONTAINER_RNA_ID(cont) (const char *)(((ContainerRNA *)(cont))+1)
+
#endif /* RNA_INTERNAL_TYPES_H */