[Bf-blender-cvs] [2884ae971ab] master: Custom Properties: fix the tooltip field not initialized in edit dialog.

Alexander Gavrilov noreply at git.blender.org
Wed Sep 22 12:27:19 CEST 2021


Commit: 2884ae971ab56301fbddb053802ff947f934bf7c
Author: Alexander Gavrilov
Date:   Wed Sep 22 13:12:48 2021 +0300
Branches: master
https://developer.blender.org/rB2884ae971ab56301fbddb053802ff947f934bf7c

Custom Properties: fix the tooltip field not initialized in edit dialog.

Initializing the description property was completely forgotten.
It also seems it may be missing sometimes, so use `get`.

Also, clean values when there is no data, and correctly use
the return value of `get_value_eval` in one instance.

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

M	release/scripts/startup/bl_operators/wm.py

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

diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 6af86e75b8a..a386df5c428 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1556,11 +1556,18 @@ class WM_OT_properties_edit(Operator):
                 self.max != self.soft_max
             )
             self.default = str(rna_data["default"])
-        if prop_type == str and not is_array and not value_failed: # String arrays do not support UI data.
+            self.description = rna_data.get("description", "")
+        elif prop_type == str and not is_array and not value_failed: # String arrays do not support UI data.
             ui_data = item.id_properties_ui(prop)
             rna_data = ui_data.as_dict()
             self.subtype =  rna_data["subtype"]
             self.default = str(rna_data["default"])
+            self.description = rna_data.get("description", "")
+        else:
+            self.min = self.soft_min = 0
+            self.max = self.soft_max = 1
+            self.use_soft_limits = False
+            self.description = ""
 
         self._init_subtype(prop_type, is_array, self.subtype)
 
@@ -1611,7 +1618,7 @@ class WM_OT_properties_edit(Operator):
         layout.prop(self, "property")
         layout.prop(self, "value")
 
-        value = self.get_value_eval()
+        value, value_failed = self.get_value_eval()
         proptype, is_array = rna_idprop_value_item_type(value)
 
         row = layout.row()



More information about the Bf-blender-cvs mailing list