[Bf-blender-cvs] [819ebc99014] master: UI: Set modifier panel expansion on every redraw
Hans Goudey
noreply at git.blender.org
Tue Jun 9 19:41:56 CEST 2020
Commit: 819ebc990144c516e1ae393b6e6ecdf98a184811
Author: Hans Goudey
Date: Tue Jun 9 13:41:50 2020 -0400
Branches: master
https://developer.blender.org/rB819ebc990144c516e1ae393b6e6ecdf98a184811
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.
===================================================================
M source/blender/editors/interface/interface_templates.c
M source/blender/makesrna/intern/rna_modifier.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list