From 0714d28236e66b258de90bcbb8a1a821ee424a71 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 27 Dec 2008 14:52:49 +0000 Subject: 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 --- source/blender/python/intern/bpy_rna.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/python/intern/bpy_rna.h') diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index f707ebb774b..2cf4a57f76d 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -51,5 +51,5 @@ PyObject *pyrna_prop_CreatePyObject( PointerRNA *ptr, PropertyRNA *prop ); /* operators also need this to set args */ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, PyObject *value); - +PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop); #endif -- cgit v1.2.3