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.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user