Blender Git Loki
Git Commits -> Revision 0714d28
Revision 0714d28 by Campbell Barton (master) December 27, 2008, 14:52 (GMT) |
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 |
Commit Details:
Full Hash: 0714d28236e66b258de90bcbb8a1a821ee424a71
SVN Revision: 18097
Parent Commit: 86886cb
Lines Changed: +362, -4
2 Added Paths:
/source/blender/python/intern/bpy_opwrapper.c (+252, -0) (View)
/source/blender/python/intern/bpy_opwrapper.h (+41, -0) (View)
/source/blender/python/intern/bpy_opwrapper.h (+41, -0) (View)
8 Modified Paths:
/source/blender/makesdna/DNA_windowmanager_types.h (+4, -0) (Diff)
/source/blender/makesrna/intern/rna_define.c (+6, -0) (Diff)
/source/blender/makesrna/RNA_define.h (+1, -1) (Diff)
/source/blender/python/intern/bpy_operator.c (+28, -1) (Diff)
/source/blender/python/intern/bpy_rna.c (+1, -1) (Diff)
/source/blender/python/intern/bpy_rna.h (+1, -1) (Diff)
/source/blender/windowmanager/intern/wm_operators.c (+26, -0) (Diff)
/source/blender/windowmanager/WM_api.h (+2, -0) (Diff)
/source/blender/makesrna/intern/rna_define.c (+6, -0) (Diff)
/source/blender/makesrna/RNA_define.h (+1, -1) (Diff)
/source/blender/python/intern/bpy_operator.c (+28, -1) (Diff)
/source/blender/python/intern/bpy_rna.c (+1, -1) (Diff)
/source/blender/python/intern/bpy_rna.h (+1, -1) (Diff)
/source/blender/windowmanager/intern/wm_operators.c (+26, -0) (Diff)
/source/blender/windowmanager/WM_api.h (+2, -0) (Diff)