Merged changes in the trunk up to revision 35828.

Conflicts resolved:
source/blender/makesrna/RNA_enum_types.h

According to the changes in revision 35667, the Freestyle-related code
in release/scripts/ui/ was moved to release/scripts/startup/bl_ui/.
This commit is contained in:
2011-03-27 23:11:22 +00:00
395 changed files with 7190 additions and 17515 deletions

View File

@@ -40,6 +40,7 @@
#include "bpy_operator_wrap.h"
#include "bpy_rna.h" /* for setting arg props only - pyrna_py_to_prop() */
#include "bpy_util.h"
#include "../generic/bpy_internal_import.h"
#include "BLI_utildefines.h"
@@ -118,7 +119,7 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args)
static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
{
wmOperatorType *ot;
int error_val = 0;
int error_val= 0;
PointerRNA ptr;
int operator_ret= OPERATOR_CANCELLED;
@@ -132,7 +133,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
int context= WM_OP_EXEC_DEFAULT;
// XXX Todo, work out a better solution for passing on context, could make a tuple from self and pack the name and Context into it...
bContext *C = (bContext *)BPy_GetContext();
bContext *C= (bContext *)BPy_GetContext();
if(C==NULL) {
PyErr_SetString(PyExc_RuntimeError, "Context is None, cant poll any operators");
@@ -194,7 +195,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
ReportList *reports;
reports= MEM_mallocN(sizeof(ReportList), "wmOperatorReportList");
BKE_reports_init(reports, RPT_STORE);
BKE_reports_init(reports, RPT_STORE | RPT_OP_HOLD); /* own so these dont move into global reports */
operator_ret= WM_operator_call_py(C, ot, context, &ptr, reports);
@@ -246,6 +247,8 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
* function corrects bpy.data (internal Main pointer) */
BPY_modules_update(C);
/* needed for when WM_OT_read_factory_settings us called fro within a script */
bpy_import_main_set(CTX_data_main(C));
/* return operator_ret as a bpy enum */
return pyrna_enum_bitfield_to_py(operator_return_items, operator_ret);
@@ -259,10 +262,10 @@ static PyObject *pyop_as_string(PyObject *UNUSED(self), PyObject *args)
char *opname;
PyObject *kw= NULL; /* optional args */
int all_args = 1;
int all_args= 1;
int error_val= 0;
char *buf = NULL;
char *buf= NULL;
PyObject *pybuf;
bContext *C= (bContext *)BPy_GetContext();
@@ -311,11 +314,11 @@ static PyObject *pyop_as_string(PyObject *UNUSED(self), PyObject *args)
static PyObject *pyop_dir(PyObject *UNUSED(self))
{
PyObject *list = PyList_New(0), *name;
PyObject *list= PyList_New(0), *name;
wmOperatorType *ot;
for(ot= WM_operatortype_first(); ot; ot= ot->next) {
name = PyUnicode_FromString(ot->idname);
name= PyUnicode_FromString(ot->idname);
PyList_Append(list, name);
Py_DECREF(name);
}
@@ -353,7 +356,7 @@ static PyObject *pyop_getrna(PyObject *UNUSED(self), PyObject *value)
return (PyObject *)pyrna;
}
static struct PyMethodDef bpy_ops_methods[] = {
static struct PyMethodDef bpy_ops_methods[]= {
{"poll", (PyCFunction) pyop_poll, METH_VARARGS, NULL},
{"call", (PyCFunction) pyop_call, METH_VARARGS, NULL},
{"as_string", (PyCFunction) pyop_as_string, METH_VARARGS, NULL},
@@ -363,7 +366,7 @@ static struct PyMethodDef bpy_ops_methods[] = {
{NULL, NULL, 0, NULL}
};
static struct PyModuleDef bpy_ops_module = {
static struct PyModuleDef bpy_ops_module= {
PyModuleDef_HEAD_INIT,
"_bpy.ops",
NULL,