RNA Types metaclass registration

See mailing list posts for details [1][2][3]

Addons still need to be fixed; Campbell said he'd do it today.

See any of the py files (outside netrender) in this commit for how to do it (it's rather simple).

[1] http://lists.blender.org/pipermail/bf-committers/2010-February/026328.html
[2] http://lists.blender.org/pipermail/bf-committers/2010-August/028311.html
[3] http://lists.blender.org/pipermail/bf-committers/2010-August/028321.html
This commit is contained in:
2010-08-02 02:55:12 +00:00
parent 9f575e5446
commit 5b345524ea
84 changed files with 689 additions and 1603 deletions

View File

@@ -4175,9 +4175,11 @@ static PyObject *pyrna_basetype_getattro( BPy_BaseTypeRNA *self, PyObject *pynam
static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self);
static PyObject *pyrna_basetype_register(PyObject *self, PyObject *py_class);
static PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *py_class);
static PyObject *pyrna_register_immediate(PyObject *self);
static struct PyMethodDef pyrna_basetype_methods[] = {
{"__dir__", (PyCFunction)pyrna_basetype_dir, METH_NOARGS, ""},
{"immediate", (PyCFunction)pyrna_register_immediate, METH_NOARGS, ""},
{"register", (PyCFunction)pyrna_basetype_register, METH_O, ""},
{"unregister", (PyCFunction)pyrna_basetype_unregister, METH_O, ""},
{NULL, NULL, 0, NULL}
@@ -4769,6 +4771,22 @@ void pyrna_free_types(void)
}
static int IMMEDIATE = 0;
void bpy_set_immediate_register(int value)
{
IMMEDIATE = value;
}
static PyObject *pyrna_register_immediate(PyObject *self)
{
if (IMMEDIATE) {
Py_RETURN_TRUE;
} else {
Py_RETURN_FALSE;
}
}
/* Note! MemLeak XXX
*
* There is currently a bug where moving registering a python class does