Fix #115151, step one: Fallback to `ID_OB` in case of defined unknown ID type.
This is mainly intended to support forward compatibility with future, unknwon ID types. Actual reported issue will be fixed in next commit.
This commit is contained in:
parent
8845dba79d
commit
f0f378d31e
|
@ -644,7 +644,11 @@ static void idprop_ui_data_to_dict_id(IDProperty *property, PyObject *dict)
|
|||
}
|
||||
|
||||
const char *id_type = nullptr;
|
||||
RNA_enum_identifier(rna_enum_id_type_items, id_type_value, &id_type);
|
||||
if (!RNA_enum_identifier(rna_enum_id_type_items, id_type_value, &id_type)) {
|
||||
/* Same fall-back as above, in case it is an unknown ID type (from a future version of Blender
|
||||
* e.g.). */
|
||||
RNA_enum_identifier(rna_enum_id_type_items, ID_OB, &id_type);
|
||||
}
|
||||
PyObject *item = PyUnicode_FromString(id_type);
|
||||
PyDict_SetItemString(dict, "id_type", item);
|
||||
Py_DECREF(item);
|
||||
|
|
Loading…
Reference in New Issue