[Bf-blender-cvs] [abd1a2d07d6] master: Gizmo: report error when property isn't found

Campbell Barton noreply at git.blender.org
Mon Aug 26 09:07:34 CEST 2019


Commit: abd1a2d07d677f0729acbe99de5d489d4ced6962
Author: Campbell Barton
Date:   Mon Aug 26 16:57:52 2019 +1000
Branches: master
https://developer.blender.org/rBabd1a2d07d677f0729acbe99de5d489d4ced6962

Gizmo: report error when property isn't found

Also add assert so this doesn't go unnoticed, see: T69153

===================================================================

M	source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c

===================================================================

diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c
index f5ae5427ac7..094fdf3f514 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.c
@@ -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);
 }



More information about the Bf-blender-cvs mailing list