Fix #126156: Do not allow to assign embedded IDs to IDProperties.
This is just not supported, and typically not doable from Blender UI (since embedded IDs won't be listed in ID template list). Add asserts to IDProp code itself, and checks & error reports in relevant BPY and RNA setters.
This commit is contained in:
@@ -980,6 +980,12 @@ static IDProperty *idp_from_DatablockPointer(IDProperty *prop_exist,
|
||||
IDProperty *prop = nullptr;
|
||||
ID *value = nullptr;
|
||||
pyrna_id_FromPyObject(ob, &value);
|
||||
|
||||
if (value && (value->flag & ID_FLAG_EMBEDDED_DATA) != 0) {
|
||||
PyErr_SetString(PyExc_ValueError, "Cannot assign an embedded ID pointer to an id-property");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (prop_exist) {
|
||||
if (prop_exist->type == IDP_ID) {
|
||||
IDP_AssignID(prop_exist, value, 0);
|
||||
|
||||
Reference in New Issue
Block a user