=bmesh= merge from trunk at r36153
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
@@ -22,6 +22,11 @@
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
/** \file blender/python/intern/bpy_operator_wrap.c
|
||||
* \ingroup pythonintern
|
||||
*/
|
||||
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#include "bpy_operator_wrap.h"
|
||||
@@ -30,13 +35,14 @@
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "RNA_access.h"
|
||||
#include "RNA_define.h"
|
||||
|
||||
#include "bpy_rna.h"
|
||||
|
||||
static void operator_properties_init(wmOperatorType *ot)
|
||||
{
|
||||
PyObject *py_class = ot->ext.data;
|
||||
PyObject *py_class= ot->ext.data;
|
||||
RNA_struct_blender_type_set(ot->ext.srna, ot);
|
||||
|
||||
/* only call this so pyrna_deferred_register_class gives a useful error
|
||||
@@ -54,7 +60,7 @@ void operator_wrapper(wmOperatorType *ot, void *userdata)
|
||||
{
|
||||
/* take care not to overwrite anything set in
|
||||
* WM_operatortype_append_ptr before opfunc() is called */
|
||||
StructRNA *srna = ot->srna;
|
||||
StructRNA *srna= ot->srna;
|
||||
*ot= *((wmOperatorType *)userdata);
|
||||
ot->srna= srna; /* restore */
|
||||
|
||||
@@ -65,7 +71,7 @@ void operator_wrapper(wmOperatorType *ot, void *userdata)
|
||||
PropertyRNA *prop;
|
||||
|
||||
RNA_pointer_create(NULL, ot->srna, NULL, &ptr);
|
||||
prop = RNA_struct_find_property(&ptr, "type");
|
||||
prop= RNA_struct_find_property(&ptr, "type");
|
||||
if(prop)
|
||||
ot->prop= prop;
|
||||
}
|
||||
@@ -73,16 +79,16 @@ void operator_wrapper(wmOperatorType *ot, void *userdata)
|
||||
|
||||
void macro_wrapper(wmOperatorType *ot, void *userdata)
|
||||
{
|
||||
wmOperatorType *data = (wmOperatorType *)userdata;
|
||||
wmOperatorType *data= (wmOperatorType *)userdata;
|
||||
|
||||
/* only copy a couple of things, the rest is set by the macro registration */
|
||||
ot->name = data->name;
|
||||
ot->idname = data->idname;
|
||||
ot->description = data->description;
|
||||
ot->name= data->name;
|
||||
ot->idname= data->idname;
|
||||
ot->description= data->description;
|
||||
ot->flag |= data->flag; /* append flags to the one set by registration */
|
||||
ot->pyop_poll = data->pyop_poll;
|
||||
ot->ui = data->ui;
|
||||
ot->ext = data->ext;
|
||||
ot->pyop_poll= data->pyop_poll;
|
||||
ot->ui= data->ui;
|
||||
ot->ext= data->ext;
|
||||
|
||||
operator_properties_init(ot);
|
||||
}
|
||||
@@ -108,16 +114,16 @@ PyObject *PYOP_wrap_macro_define(PyObject *UNUSED(self), PyObject *args)
|
||||
|
||||
/* identifiers */
|
||||
srna= srna_from_self(macro, "Macro Define:");
|
||||
macroname = RNA_struct_identifier(srna);
|
||||
macroname= RNA_struct_identifier(srna);
|
||||
|
||||
ot = WM_operatortype_find(macroname, TRUE);
|
||||
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);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
otmacro = WM_operatortype_macro_define(ot, opname);
|
||||
otmacro= WM_operatortype_macro_define(ot, opname);
|
||||
|
||||
RNA_pointer_create(NULL, &RNA_OperatorTypeMacro, otmacro, &ptr_otmacro);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user