Gizmo: report error when property isn't found

Also add assert so this doesn't go unnoticed, see: T69153
This commit is contained in:
Campbell Barton 2019-08-26 16:57:52 +10:00
parent db851c78b4
commit abd1a2d07d
1 changed files with 4 additions and 0 deletions

View File

@ -84,6 +84,7 @@ void WM_gizmo_target_property_def_rna_ptr(wmGizmo *gz,
/* if gizmo evokes an operator we cannot use it for property manipulation */
BLI_assert(gz->op_data == NULL);
BLI_assert(prop != NULL);
gz_prop->type = gz_prop_type;
@ -101,6 +102,9 @@ void WM_gizmo_target_property_def_rna(
{
const wmGizmoPropertyType *gz_prop_type = WM_gizmotype_target_property_find(gz->type, idname);
PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
if (prop == NULL) {
RNA_warning("%s: %s.%s not found", __func__, RNA_struct_identifier(ptr->type), propname);
}
WM_gizmo_target_property_def_rna_ptr(gz, gz_prop_type, ptr, prop, index);
}