2.5 Python

Merging changes made by Arystanbek in the soc-2009-kazanbas branch,
plus some things modified and added by me.

* Operator exec is called execute in python now, due to conflicts
  with python exec keyword.
* Operator invoke/execute now get context argument.
* Fix crash executing operators due to bpy_import_main_set not being
  set with Main pointer.
* The bpy.props module now has the FloatProperty/IntProperty/
  StringProperty/BoolProperty functions to define RNA properties for
  operators.
* Operators now have an __operator__ property to get the actual RNA
  operator pointers, this is only temporary though.
* bpy.ops.add now allows the operator to be already registered, it
  will simply overwrite the existing one.
* Both the ui and io directories are now scanned and run on startup.
This commit is contained in:
2009-06-18 19:51:22 +00:00
parent 4cd24cf058
commit 94dbb3bbdd
6 changed files with 197 additions and 85 deletions

View File

@@ -63,6 +63,7 @@ typedef struct {
PyObject *BPY_rna_module( void );
/*PyObject *BPY_rna_doc( void );*/
PyObject *BPY_rna_types( void );
PyObject *BPY_rna_props( void );
PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr );
PyObject *pyrna_prop_CreatePyObject( PointerRNA *ptr, PropertyRNA *prop );
@@ -76,6 +77,7 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop);
PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw);
PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw);
PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw);
PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw);
/* function for registering types */
PyObject *pyrna_basetype_register(PyObject *self, PyObject *args);