diff options
author | Joseph Eagar <joeedh@gmail.com> | 2010-09-04 09:31:25 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2010-09-04 09:31:25 +0400 |
commit | bb7339a7aec37bdb2ee8a21599e6c65b37ef1277 (patch) | |
tree | 6fb8da94c6e43098c606f768e722484b04b8645c /source/blender/python/intern/bpy_operator_wrap.c | |
parent | 37f2c8a64c3277f100ab084ef1bb3846bc7b2c62 (diff) | |
parent | 8a320974f1b3e6004db3b3ad64f97742f878cbee (diff) |
merge with trunk at r31523
Diffstat (limited to 'source/blender/python/intern/bpy_operator_wrap.c')
-rw-r--r-- | source/blender/python/intern/bpy_operator_wrap.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 48a2655ecb2..c1698a8d751 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -33,22 +33,15 @@ static void operator_properties_init(wmOperatorType *ot) { PyObject *py_class = ot->ext.data; - PyObject *item= ((PyTypeObject*)py_class)->tp_dict; /* getattr(..., "__dict__") returns a proxy */ - RNA_struct_blender_type_set(ot->ext.srna, ot); - if(item) { - /* only call this so pyrna_deferred_register_props gives a useful error - * WM_operatortype_append_ptr will call RNA_def_struct_identifier - * later */ - RNA_def_struct_identifier(ot->srna, ot->idname); + /* only call this so pyrna_deferred_register_class gives a useful error + * WM_operatortype_append_ptr will call RNA_def_struct_identifier + * later */ + RNA_def_struct_identifier(ot->srna, ot->idname); - if(pyrna_deferred_register_props(ot->srna, item) != 0) { - PyErr_Print(); /* failed to register operator props */ - PyErr_Clear(); - } - } - else { + if(pyrna_deferred_register_class(ot->srna, py_class) != 0) { + PyErr_Print(); /* failed to register operator props */ PyErr_Clear(); } } @@ -104,7 +97,7 @@ PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "Os:_bpy.ops.macro_define", ¯o, &opname)) return NULL; - if (WM_operatortype_exists(opname) == NULL) { + if (WM_operatortype_find(opname, TRUE) == NULL) { PyErr_Format(PyExc_ValueError, "Macro Define: '%s' is not a valid operator id", opname); return NULL; } @@ -113,7 +106,7 @@ PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args) srna= srna_from_self(macro, "Macro Define:"); macroname = RNA_struct_identifier(srna); - ot = WM_operatortype_exists(macroname); + ot = WM_operatortype_find(macroname, TRUE); if (!ot) { PyErr_Format(PyExc_ValueError, "Macro Define: '%s' is not a valid macro or hasn't been registered yet", macroname); |