Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_ops.cc
| Show First 20 Lines • Show All 992 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* Skip non-existing properties on link. This was previously covered with the `lprop != prop` | /* Skip non-existing properties on link. This was previously covered with the `lprop != prop` | ||||
| * check but we are now more permissive when it comes to ID properties, see below. */ | * check but we are now more permissive when it comes to ID properties, see below. */ | ||||
| if (lprop == nullptr) { | if (lprop == nullptr) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| const char *prop_id = RNA_property_identifier(prop); | |||||
| if (!RNA_struct_type_find_property(lptr.type, prop_id)) { | |||||
mont29: This should rather use `RNA_struct_contains_property` I think? That way you check that the RNA… | |||||
| return false; | |||||
| } | |||||
| if (RNA_property_type(lprop) != RNA_property_type(prop)) { | if (RNA_property_type(lprop) != RNA_property_type(prop)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* Check property pointers matching. | /* Check property pointers matching. | ||||
| * For ID properties, these pointers match: | * For ID properties, these pointers match: | ||||
| * - If the property is API defined on an existing class (and they are equally named). | * - If the property is API defined on an existing class (and they are equally named). | ||||
| * - Never for ID properties on specific ID (even if they are equally named). | * - Never for ID properties on specific ID (even if they are equally named). | ||||
| ▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines | |||||
This should rather use RNA_struct_contains_property I think? That way you check that the RNA pointer do have that property, since by definition custom properties are not part of the RNA struct type...