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>2008-12-26 23:38:52 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-26 23:38:52 +0300
commit82cf2aebba1c340c1c4fffde1e89fc80a4591fea (patch)
tree18d58c3ce61401b4fcd077f902e06235cab737be /source/blender/makesrna/RNA_define.h
parent254fc41b56e8c4f828e9721a045c8c5108044d0a (diff)
RNA:
* Added support for using pointers + collections as operator properties, but with the restriction that they must point to other type derived from ID property groups. The "add" function for these properties will allocate a new ID property group and point to that. * Added support for arrays with type IDP_GROUP in ID properties. * Fix bug getting/setting float array values. Example code for collections, note the "OperatorMousePath" type is defined in rna_wm.c and has a float[2] property named "loc". Defining the operator property: prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath); Adding values: PointerRNA itemptr; float loc[2] = {1, 1}, RNA_collection_add(op->ptr, "path", &itemptr); RNA_float_set_array(&itemptr, "loc", loc); Iterating: RNA_BEGIN(op->ptr, itemptr, "path") { float loc[2]; RNA_float_get_array(&itemptr, "loc", loc); printf("Location: %f %f\n", loc[0], loc[1]); } RNA_END;
Diffstat (limited to 'source/blender/makesrna/RNA_define.h')
-rw-r--r--source/blender/makesrna/RNA_define.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index d7df58ca61c..12711a1b95d 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -69,6 +69,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max);
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item);
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength);
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type);
+void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type);
void RNA_def_property_boolean_default(PropertyRNA *prop, int value);
void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array);