diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-12-27 17:52:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-12-27 17:52:49 +0300 |
commit | 0714d28236e66b258de90bcbb8a1a821ee424a71 (patch) | |
tree | f7b99bdec9e093e0e2ecf1b00229f37d1ca2687c /source/blender/makesrna/RNA_define.h | |
parent | 86886cbc55c036af44833fd861cfd276fbec256a (diff) |
python operators (in bpy_opwrapper.*)
This means you can define an operator in python that is called from C or Python - like any other operator.
Python functions for invoke and exec can be registered with an operator name.
keywords are read from the python exec() function, then used to create operator properties. The default python values are used to set the property type and defaults.
def exec(size=2.0, text="blah"): ...
is equivalent to...
prop = RNA_def_property(ot->srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_default(prop, 2.0f);
prop = RNA_def_property(ot->srna, "size", PROP_STRING, PROP_NONE);
RNA_def_property_string_default(prop, "blah");
TODO -
* make use of events
* return OPERATOR_CANCELLED/OPERATOR_FINISHED.. etc
* add support for array args
* more testing
Diffstat (limited to 'source/blender/makesrna/RNA_define.h')
-rw-r--r-- | source/blender/makesrna/RNA_define.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 12711a1b95d..359e387ebd8 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -47,7 +47,7 @@ void RNA_def_struct_flag(StructRNA *srna, int flag); void RNA_def_struct_funcs(StructRNA *srna, const char *notify, const char *refine); void RNA_def_struct_identifier(StructRNA *srna, const char *identifier); void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description); - +void RNA_struct_free(BlenderRNA *brna, StructRNA *srna); /* Property */ PropertyRNA *RNA_def_property(StructRNA *srna, const char *identifier, int type, int subtype); |