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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user