I'm trying to change the new Preset Menu UI to display the selected Preset name in the Properties Header like it appeared in the previous versions (2.79-). I know how to do it successfully, but I have to change the original Blender UI startup script, which I know we should not do. I only need to change 3 variable assignments in a Class method. If I change the original script, I will have to make the same changes every time I download a new version. How do I implement the changes so they are not overridden by new versions?
Here is the script that needs changing - its in /scripts/startup/bl_ui/utils.py
My changes are in the draw_panel_header method.
def draw_panel_header(cls, layout): layout.emboss = 'NORMAL' layout.popover( panel=cls.__name__, icon='NONE', text=cls.bl_label, )
from bpy.types import Menu # Panel mix-in class (don't register). class PresetPanel: bl_space_type = 'PROPERTIES' bl_region_type = 'HEADER' bl_label = "Presets" path_menu = Menu.path_menu @classmethod def draw_panel_header(cls, layout): layout.emboss = 'NONE' layout.popover( panel=cls.__name__, icon='PRESET', text="", ) @classmethod def draw_menu(cls, layout, text=None): if text is None: text = cls.bl_label layout.popover( panel=cls.__name__, icon='PRESET', text=text, ) def draw(self, context): layout = self.layout layout.emboss = 'PULLDOWN_MENU' layout.operator_context = 'EXEC_DEFAULT' Menu.draw_preset(self, context)