From 50fbfeb67aac7a5e6fa670560bdbd2ffd94e9764 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Thu, 2 Mar 2023 11:37:15 +0100 Subject: [PATCH] Fix #105278: IDProperty UI missing library overridable toggle The toggle (for anything but float and int types) was swallowed in bf948b2cef. Also seems ef68a37e5d55e17adf4c discarded `property_overridable_library_set` for bools. Now treat the overridable toggle as a general property for all property types. --- scripts/modules/rna_prop_ui.py | 29 ++++++++++++++--------------- scripts/startup/bl_operators/wm.py | 4 ++-- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/scripts/modules/rna_prop_ui.py b/scripts/modules/rna_prop_ui.py index 8b889d8ca4b..ee4fdeb608d 100644 --- a/scripts/modules/rna_prop_ui.py +++ b/scripts/modules/rna_prop_ui.py @@ -94,22 +94,21 @@ def rna_idprop_ui_create( description=description, default=default, ) - return + else: + if soft_min is None: + soft_min = min + if soft_max is None: + soft_max = max - if soft_min is None: - soft_min = min - if soft_max is None: - soft_max = max - - ui_data.update( - subtype=subtype, - min=min, - max=max, - soft_min=soft_min, - soft_max=soft_max, - description=description, - default=default, - ) + ui_data.update( + subtype=subtype, + min=min, + max=max, + soft_min=soft_min, + soft_max=soft_max, + description=description, + default=default, + ) prop_path = rna_idprop_quote_path(prop) diff --git a/scripts/startup/bl_operators/wm.py b/scripts/startup/bl_operators/wm.py index 78f70b84a96..5b4f1987e86 100644 --- a/scripts/startup/bl_operators/wm.py +++ b/scripts/startup/bl_operators/wm.py @@ -1894,7 +1894,6 @@ class WM_OT_properties_edit(Operator): col.prop(self, "max_float") col = layout.column() - col.prop(self, "is_overridable_library") col.prop(self, "use_soft_limits") col = layout.column(align=True) @@ -1923,7 +1922,6 @@ class WM_OT_properties_edit(Operator): col.prop(self, "max_int") col = layout.column() - col.prop(self, "is_overridable_library") col.prop(self, "use_soft_limits") col = layout.column(align=True) @@ -1949,6 +1947,8 @@ class WM_OT_properties_edit(Operator): else: layout.prop(self, "description") + layout.prop(self, "is_overridable_library") + # Edit the value of a custom property with the given name on the RNA struct at the given data path. # For supported types, this simply acts as a convenient way to create a popup for a specific property -- 2.30.2