Merged changes in the trunk up to revision 36757.
This commit is contained in:
@@ -76,7 +76,7 @@ static void bpy_lib_dealloc(BPy_Library *self)
|
||||
}
|
||||
|
||||
|
||||
PyTypeObject bpy_lib_Type= {
|
||||
static PyTypeObject bpy_lib_Type= {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"bpy_lib", /* tp_name */
|
||||
sizeof(BPy_Library), /* tp_basicsize */
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "RNA_types.h"
|
||||
|
||||
#include "BPY_extern.h"
|
||||
#include "bpy_operator.h"
|
||||
#include "bpy_operator_wrap.h"
|
||||
#include "bpy_rna.h" /* for setting arg props only - pyrna_py_to_prop() */
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
|
||||
@@ -6040,17 +6040,18 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
|
||||
bpy_context_set(C, &gilstate);
|
||||
|
||||
if (!is_static) {
|
||||
/* exception, operators store their PyObjects for re-use */
|
||||
/* some datatypes (operator, render engine) can store PyObjects for re-use */
|
||||
if(ptr->data) {
|
||||
if(RNA_struct_is_a(ptr->type, &RNA_Operator)) {
|
||||
wmOperator *op= ptr->data;
|
||||
if(op->py_instance) {
|
||||
py_class_instance= op->py_instance;
|
||||
void **instance = RNA_struct_instance(ptr);
|
||||
|
||||
if(instance) {
|
||||
if(*instance) {
|
||||
py_class_instance= *instance;
|
||||
Py_INCREF(py_class_instance);
|
||||
}
|
||||
else {
|
||||
/* store the instance here once its created */
|
||||
py_class_instance_store= &op->py_instance;
|
||||
py_class_instance_store= instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6418,7 +6419,7 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class
|
||||
|
||||
identifier= ((PyTypeObject*)py_class)->tp_name;
|
||||
|
||||
srna_new= reg(C, &reports, py_class, identifier, bpy_class_validate, bpy_class_call, bpy_class_free);
|
||||
srna_new= reg(CTX_data_main(C), &reports, py_class, identifier, bpy_class_validate, bpy_class_call, bpy_class_free);
|
||||
|
||||
if(BPy_reports_to_error(&reports, PyExc_RuntimeError, TRUE) == -1)
|
||||
return NULL;
|
||||
@@ -6568,7 +6569,7 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla
|
||||
C= BPy_GetContext();
|
||||
|
||||
/* call unregister */
|
||||
unreg(C, srna); /* calls bpy_class_free, this decref's py_class */
|
||||
unreg(CTX_data_main(C), srna); /* calls bpy_class_free, this decref's py_class */
|
||||
|
||||
PyDict_DelItemString(((PyTypeObject *)py_class)->tp_dict, "bl_rna");
|
||||
if(PyErr_Occurred())
|
||||
|
||||
@@ -187,12 +187,8 @@ int pyrna_write_check(void);
|
||||
int pyrna_struct_validity_check(BPy_StructRNA *pysrna);
|
||||
int pyrna_prop_validity_check(BPy_PropertyRNA *self);
|
||||
|
||||
void BPY_modules_update(struct bContext *C); //XXX temp solution
|
||||
|
||||
/* bpy.utils.(un)register_class */
|
||||
extern PyMethodDef meth_bpy_register_class;
|
||||
extern PyMethodDef meth_bpy_unregister_class;
|
||||
|
||||
void BPY_id_release(struct ID *id);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user