exclude self references from the ID search list when PROP_ID_SELF_CHECK is set, also raise an error from python if this is attempted
This commit is contained in:
@@ -886,6 +886,9 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v
|
||||
} else if((flag & PROP_NEVER_NULL) && value == Py_None) {
|
||||
PyErr_Format(PyExc_TypeError, "%.200s does not support a 'None' assignment %.200s type", error_prefix, RNA_struct_identifier(ptype));
|
||||
return -1;
|
||||
} else if(value != Py_None && ((flag & PROP_ID_SELF_CHECK) && ptr->id.data == ((BPy_StructRNA*)value)->ptr.id.data)) {
|
||||
PyErr_Format(PyExc_TypeError, "%.200s ID type does not support assignment to its self", error_prefix);
|
||||
return -1;
|
||||
} else {
|
||||
BPy_StructRNA *param= (BPy_StructRNA*)value;
|
||||
int raise_error= FALSE;
|
||||
|
||||
Reference in New Issue
Block a user