diff options
author | Hans Goudey <h.goudey@me.com> | 2020-06-09 20:41:50 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-06-09 20:41:50 +0300 |
commit | 819ebc990144c516e1ae393b6e6ecdf98a184811 (patch) | |
tree | f6db64abcc19e0d55e03b79ee478901a8e9b49b3 | |
parent | cb9de95d61b32f90788875f20e046095bb6310ad (diff) |
UI: Set modifier panel expansion on every redraw
This will fix situations where the modifier epansion was set elsewhere
besides the UI, like from the python console, solving the drawing part
of T77502.
Also adds update tags to the show_expanded property, which means
the properties window redraws when the property changes.
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 1d55e2b3e4b..6295f51f01e 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1860,6 +1860,13 @@ void uiTemplateModifiers(uiLayout *UNUSED(layout), bContext *C) } } } + else { + /* The expansion might have been changed elsewhere, so we still need to set it. */ + LISTBASE_FOREACH (Panel *, panel, ®ion->panels) { + if ((panel->type != NULL) && (panel->type->flag & PNL_INSTANCED)) + UI_panel_set_expand_from_list_data(C, panel); + } + } } /** \} */ diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index a0026797c68..92eec6190da 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -6877,6 +6877,7 @@ void RNA_def_modifier(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface"); RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); + RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); prop = RNA_def_property(srna, "use_apply_on_spline", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_ApplyOnSpline); |