diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2021-09-22 13:12:48 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2021-09-22 13:22:42 +0300 |
commit | 2884ae971ab56301fbddb053802ff947f934bf7c (patch) | |
tree | f9ed97820fb85c07623f99426e8c1b70321f7d8e /release/scripts/startup/bl_operators | |
parent | 90b485845caf5ea9177be50cdd6d7117153f844e (diff) |
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.
Diffstat (limited to 'release/scripts/startup/bl_operators')
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 11 |
1 files changed, 9 insertions, 2 deletions
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() |