[Bf-blender-cvs] [b8b7b47a006] blender-v2.93-release: Fix T85223: Some modifier panels can dissapear in old files

Hans Goudey noreply at git.blender.org
Mon Apr 19 19:25:36 CEST 2021


Commit: b8b7b47a0062ec5cc95818e9fc6bf34d07a268b0
Author: Hans Goudey
Date:   Mon Apr 19 12:25:25 2021 -0500
Branches: blender-v2.93-release
https://developer.blender.org/rBb8b7b47a0062ec5cc95818e9fc6bf34d07a268b0

Fix T85223: Some modifier panels can dissapear in old files

The problem is that each uiBlock needs to be assigned a unique name,
but when there can be multiple modifiers of the same type, we use the
panel sort order for the unique part of the string. However, the most
recent test file has 1200+ panels in the property editor, so 4
characters isn't enough for a unique string.

That's not a situation I expected, but it makes sense, because we don't
remove legacy panels with unused types when loading old files. So they
tend to accumulate a bunch of unused panels. That's why this works fine
with a new property editor, it doesn't all of the extra old panels.

These panels must be stored for the expansion status and order, but
arguably we could cull unused panels on save. However, simply increasing
the length of the unique panel string is a valid fix in this situation.
In the future, we can look into removing unused panels when saving.

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

M	source/blender/editors/include/UI_interface.h

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

diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 7a189139358..81872428038 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -1729,7 +1729,7 @@ struct Panel *UI_panel_add_instanced(const struct bContext *C,
                                      struct PointerRNA *custom_data);
 void UI_panels_free_instanced(const struct bContext *C, struct ARegion *region);
 
-#define INSTANCED_PANEL_UNIQUE_STR_LEN 4
+#define INSTANCED_PANEL_UNIQUE_STR_LEN 16
 void UI_list_panel_unique_str(struct Panel *panel, char *r_name);
 
 typedef void (*uiListPanelIDFromDataFunc)(void *data_link, char *r_idname);



More information about the Bf-blender-cvs mailing list