RNA define: check and report invalid usages of ID pointers properties.
Some RNA structs, like operators or keymaps, are not allowed to have ID pointer properties. now this check will ignore those, and report an error message in the console. Related to T82597.
This commit is contained in:
parent
b78bebb2af
commit
f39fbb3e60
Notes:
blender-bot
2023-02-14 05:50:03 +01:00
Referenced by commit c1d8df47f6
, Revert "RNA define: check and report invalid usages of ID pointers properties."
|
@ -1823,6 +1823,13 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type)
|
|||
|
||||
switch (prop->type) {
|
||||
case PROP_POINTER: {
|
||||
if ((srna->flag & STRUCT_NO_DATABLOCK_IDPROPERTIES) != 0 && (type->flag & STRUCT_ID) != 0) {
|
||||
CLOG_ERROR(&LOG,
|
||||
"Struct \"%s\" (probably an operator or keymap) does not allow pointer "
|
||||
"properties to ID datablocks.",
|
||||
srna->identifier);
|
||||
return;
|
||||
}
|
||||
PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop;
|
||||
pprop->type = type;
|
||||
|
||||
|
|
Loading…
Reference in New Issue