diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-23 15:44:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-23 15:44:22 +0300 |
commit | f87b37b3ef679dad8f492e223f20fecc7e9fa5da (patch) | |
tree | 41c06a4571ca9f7cdec07afb6bf65c84ead5d360 /source/blender/python/intern | |
parent | f35c3966766ad62a90a00b4473c79766be9b2139 (diff) |
allow unregistered rna classes to have rna properties assigned before registration.
this is useful for the register() class method which is called before the class gets structRNA assigned.
eg:
class MyClass(bpy.types.PropertyGroup):
@classmethod
def register(cls):
cls.name = StringProperty() # assigned but registration is delayed.
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 0dfc98de487..a8c504e775b 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2993,11 +2993,13 @@ static int pyrna_struct_meta_idprop_setattro(PyObject *cls, PyObject *attr, PyOb } if(srna == NULL) { + /* allow setting on unregistered classes which can be registered later on */ + /* if(value && is_deferred_prop) { PyErr_Format(PyExc_AttributeError, "pyrna_struct_meta_idprop_setattro() unable to get srna from class '%.200s'", ((PyTypeObject *)cls)->tp_name); return -1; } - + */ /* srna_from_self may set an error */ PyErr_Clear(); return PyType_Type.tp_setattro(cls, attr, value); |