merge with trunk at r31523
[blender.git] / source / blender / python / intern / bpy_operator_wrap.c
index 08ccadf141dfcc5b0788a80870cfd2dafe842088..c1698a8d7517f9b73c55f94524ea38281cc1ea0d 100644 (file)
@@ -1,4 +1,3 @@
-
 /**
  * $Id$
  *
@@ -16,7 +15,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
  * Contributor(s): Campbell Barton
  *
  */
 
 #include "bpy_operator_wrap.h"
-#include "BKE_context.h"
 #include "WM_api.h"
 #include "WM_types.h"
 
 #include "RNA_define.h"
 
 #include "bpy_rna.h"
-#include "bpy_props.h"
-#include "bpy_util.h"
 
 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();
        }
 }
@@ -108,16 +97,16 @@ PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "Os:_bpy.ops.macro_define", &macro, &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;
        }
 
        /* identifiers */
-       srna= srna_from_self(macro);
+       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);