Files
test2/source/blender
Brecht Van Lommel 82cf2aebba 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;
2008-12-26 20:38:52 +00:00
..
2008-12-23 21:20:34 +00:00
2008-12-26 20:38:52 +00:00
2008-12-23 21:20:34 +00:00
2008-12-26 20:38:52 +00:00
2008-12-23 21:20:34 +00:00
2008-12-23 21:20:34 +00:00
2008-12-23 21:20:34 +00:00
2008-12-23 21:20:34 +00:00
2.5
2008-12-26 18:15:46 +00:00
2008-12-26 20:38:52 +00:00
2008-12-23 21:20:34 +00:00
2008-12-23 21:20:34 +00:00
2008-12-23 21:20:34 +00:00
2008-12-23 16:07:24 +00:00
2.5
2008-12-26 19:07:31 +00:00
2008-11-12 21:16:53 +00:00
2008-11-12 21:16:53 +00:00