From 96d57ff4c7f843619cde7217f43c7a7d50c67430 Mon Sep 17 00:00:00 2001 From: Mustard Date: Sun, 10 Mar 2024 18:12:31 +0100 Subject: [PATCH 01/14] Changed minimum Blender version --- __init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 6ee5ecf..3a722d8 100644 --- a/__init__.py +++ b/__init__.py @@ -6,8 +6,8 @@ "name": "MustardUI", "description": "Easy-to-use UI for human characters.", "author": "Mustard", - "version": (0, 31, 0, 5), - "blender": (4, 0, 0), + "version": (0, 31, 1, 1), + "blender": (4, 1, 0), "warning": "", "doc_url": "https://github.com/Mustard2/MustardUI/wiki", "category": "User Interface", From 5479fcc17b0ed48fa93009bba25fb6ccb06fc974 Mon Sep 17 00:00:00 2001 From: Mustard Date: Sun, 10 Mar 2024 18:55:10 +0100 Subject: [PATCH 02/14] fixed normal autosmooth in Blender 4.1 --- menu/menu_body.py | 25 ++++++++++++------------- menu/menu_configure.py | 2 +- settings/rig.py | 11 ++++++++++- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/menu/menu_body.py b/menu/menu_body.py index a70effd..220d761 100644 --- a/menu/menu_body.py +++ b/menu/menu_body.py @@ -121,7 +121,6 @@ def draw(self, context): if (rig_settings.body_enable_smoothcorr or rig_settings.body_enable_solidify - or rig_settings.body_enable_norm_autosmooth or rig_settings.body_enable_material_normal_nodes or rig_settings.body_enable_preserve_volume or rig_settings.body_enable_geometry_nodes): @@ -132,13 +131,17 @@ def draw(self, context): if (rig_settings.body_enable_preserve_volume or rig_settings.body_enable_geometry_nodes or rig_settings.body_enable_solidify - or rig_settings.body_enable_smoothcorr): + or rig_settings.body_enable_smoothcorr + or rig_settings.body_enable_norm_autosmooth): col = box.column(align=True) if rig_settings.body_enable_preserve_volume: col.prop(rig_settings, "body_preserve_volume") + if rig_settings.body_enable_norm_autosmooth: + col.prop(rig_settings, "body_norm_autosmooth") + if rig_settings.body_enable_smoothcorr: col.prop(rig_settings, "body_smooth_corr") @@ -148,19 +151,15 @@ def draw(self, context): if rig_settings.body_enable_solidify: col.prop(rig_settings, "body_solidify") - if rig_settings.body_enable_norm_autosmooth or rig_settings.body_enable_material_normal_nodes: + if rig_settings.body_enable_material_normal_nodes: col = box.column(align=True) - if rig_settings.body_enable_norm_autosmooth: - col.prop(rig_settings, "body_norm_autosmooth") - - if rig_settings.body_enable_material_normal_nodes: - row = col.row(align=True) - row.scale_x = 0.94 - if context.scene.render.engine == "CYCLES" and settings.material_normal_nodes: - row.alert = True - row.prop(settings, "material_normal_nodes", text="") - row.label(text="Eevee Optimized Normals") + row = col.row(align=True) + row.scale_x = 0.94 + if context.scene.render.engine == "CYCLES" and settings.material_normal_nodes: + row.alert = True + row.prop(settings, "material_normal_nodes", text="") + row.label(text="Eevee Optimized Normals") if rig_settings.body_enable_subdiv: box = layout.box() diff --git a/menu/menu_configure.py b/menu/menu_configure.py index 897e4a6..5f48f9d 100644 --- a/menu/menu_configure.py +++ b/menu/menu_configure.py @@ -61,11 +61,11 @@ def draw(self, context): col = box.column(align=True) col.prop(rig_settings, "body_enable_subdiv") col.prop(rig_settings, "body_enable_smoothcorr") + col.prop(rig_settings, "body_enable_norm_autosmooth") col.prop(rig_settings, "body_enable_geometry_nodes") col.prop(rig_settings, "body_enable_solidify") col.separator() col.prop(rig_settings, "body_enable_preserve_volume") - col.prop(rig_settings, "body_enable_norm_autosmooth") col.prop(rig_settings, "body_enable_material_normal_nodes") # Custom properties diff --git a/settings/rig.py b/settings/rig.py index 4e2d360..1e66818 100644 --- a/settings/rig.py +++ b/settings/rig.py @@ -64,7 +64,16 @@ def update_smooth_corr(self, context): # Update function for Auto-smooth function def update_norm_autosmooth(self, context): - self.model_body.data.use_auto_smooth = self.body_norm_autosmooth + + if bpy.app.version < (4, 1, 0): + self.model_body.data.use_auto_smooth = self.body_norm_autosmooth + return + + for modifier in [x for x in self.model_body.modifiers if x.type == "NODES"]: + if modifier.node_group.name != "Smooth by Angle": + return + modifier.show_viewport = self.body_norm_autosmooth + modifier.show_render = self.body_norm_autosmooth # Update function for Smooth Correction modifiers def update_solidify(self, context): From e934f92ed675664ce27d5ec3abc005d9cbed9838 Mon Sep 17 00:00:00 2001 From: Mustard Date: Sun, 10 Mar 2024 19:06:13 +0100 Subject: [PATCH 03/14] updated the update function --- __init__.py | 2 +- misc/updater.py | 46 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/__init__.py b/__init__.py index 3a722d8..b9e63a8 100644 --- a/__init__.py +++ b/__init__.py @@ -6,7 +6,7 @@ "name": "MustardUI", "description": "Easy-to-use UI for human characters.", "author": "Mustard", - "version": (0, 31, 1, 1), + "version": (0, 31, 1, 3), "blender": (4, 1, 0), "warning": "", "doc_url": "https://github.com/Mustard2/MustardUI/wiki", diff --git a/misc/updater.py b/misc/updater.py index 06a5502..4f780fa 100644 --- a/misc/updater.py +++ b/misc/updater.py @@ -8,6 +8,7 @@ def mustardui_retrieve_remote_version(): import requests v = [0, 0, 0, 0] + b = [0, 0, 0] data = None # Import the data from the GitHub repository file @@ -15,11 +16,11 @@ def mustardui_retrieve_remote_version(): response = requests.get("https://raw.githubusercontent.com/Mustard2/MustardUI/master/__init__.py") data = response.text except: - return 1, v + return 1, v, b # Fetch version try: - if '"version": (' in data: + if '"version": (' in data and '"blender": (' in data: find = data.split('"version": (', 1)[1] v[0] = int(find.split(',')[0]) v[1] = int(find.split(',')[1]) @@ -27,15 +28,21 @@ def mustardui_retrieve_remote_version(): v[3] = find.split(',')[3] v[3] = int(v[3].split(')')[0]) - return 0, v + find = data.split('"blender": (', 1)[1] + b[0] = int(find.split(',')[0]) + b[1] = int(find.split(',')[1]) + b[2] = find.split(',')[2] + b[2] = int(b[2].split(')')[0]) + + return 0, v, b except: pass - return 2, v + return 2, v, b def mustardui_check_version(): - exit_code, v = mustardui_retrieve_remote_version() + exit_code, v, b = mustardui_retrieve_remote_version() version = (v[0], v[1], v[2], v[3]) if bl_info["version"] < version: print("MustardUI - An update is available.") @@ -51,6 +58,7 @@ class MustardUI_Updater(bpy.types.Operator): bl_options = {'UNDO'} v = [0, 0, 0, 0] + b = [0, 0, 0, 0] @classmethod def poll(cls, context): @@ -59,17 +67,21 @@ def poll(cls, context): def execute(self, context): version = (self.v[0], self.v[1], self.v[2], self.v[3]) + blender = (self.b[0], self.b[1], self.b[2]) if bl_info["version"] >= version: self.report({'INFO'}, "MustardUI: The current version is already up-to-date") else: - bpy.ops.mustardui.openlink(url="github.com/Mustard2/MustardUI/releases/latest") + if bpy.app.version >= blender: + bpy.ops.mustardui.openlink(url="github.com/Mustard2/MustardUI/releases/latest") + else: + bpy.ops.mustardui.openlink(url="blender.org/download/") return {'FINISHED'} def invoke(self, context, event): - exit_code, self.v = mustardui_retrieve_remote_version() + exit_code, self.v, self.b = mustardui_retrieve_remote_version() if exit_code == 1: self.report({'ERROR'}, "MustardUI: Error while retrieving remote version. Check your connection") @@ -86,13 +98,18 @@ def draw(self, context): layout = self.layout version = (self.v[0], self.v[1], self.v[2], self.v[3]) + blender = (self.b[0], self.b[1], self.b[2]) box = layout.box() if bl_info["version"] >= version: box.label(text="The current version seems up-to-date.", icon="INFO") else: - box.label(text="Update available!", icon="INFO") + if bpy.app.version >= blender: + box.label(text="Update available!", icon="INFO") + else: + box.label(text="Update is available for a new Blender version!", icon="INFO") + box.label(text="Update Blender before installing the new MustardUI.", icon="INFO") row = box.row() row.label(text="Current version: ", icon="RIGHTARROW_THIN") @@ -104,8 +121,17 @@ def draw(self, context): text=str(self.v[0]) + '.' + str(self.v[1]) + '.' + str(self.v[2]) + '.' + str(self.v[3])) if bl_info["version"] < version: - box = layout.box() - box.label(text="Click 'OK' to open the latest release page.", icon="ERROR") + if bpy.app.version >= blender: + box = layout.box() + box.label(text="Click 'OK' to open the latest release page.", icon="ERROR") + else: + row = box.row() + row.label(text="Minimum Blender version required: ", icon="WORLD") + row.label( + text=str(self.b[0]) + '.' + str(self.b[1]) + '.' + str(self.b[2])) + + box = layout.box() + box.label(text="Click 'OK' to open the Blender download page.", icon="ERROR") def register(): From c7e1b9e246526cb1d2ad34b9e464239d09986d31 Mon Sep 17 00:00:00 2001 From: Mustard Date: Sun, 10 Mar 2024 19:09:40 +0100 Subject: [PATCH 04/14] changed update warning --- menu/menu_warnings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/menu/menu_warnings.py b/menu/menu_warnings.py index 940b7f7..c0de381 100644 --- a/menu/menu_warnings.py +++ b/menu/menu_warnings.py @@ -61,8 +61,8 @@ def draw(self, context): box = layout.box() col = box.column(align=True) col.label(text="MustardUI update available!", icon="ERROR") - col.label(text="Remember to restart after updating.", icon="BLANK1") - box.operator("mustardui.openlink", icon="URL").url = "github.com/Mustard2/MustardUI/releases/latest" + col.label(text="Restart after updating.", icon="BLANK1") + box.operator("mustardui.updater", icon="WORLD") # Eevee normals enabled in Cycles if check_eevee_normals(context.scene, settings): From 670aee9e190735aaeccba55a6e6e04021cf97bf9 Mon Sep 17 00:00:00 2001 From: Mustard Date: Sun, 10 Mar 2024 19:21:22 +0100 Subject: [PATCH 05/14] added messages to update function --- __init__.py | 2 +- menu/menu_warnings.py | 1 - misc/updater.py | 12 ++++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/__init__.py b/__init__.py index b9e63a8..1b6668d 100644 --- a/__init__.py +++ b/__init__.py @@ -6,7 +6,7 @@ "name": "MustardUI", "description": "Easy-to-use UI for human characters.", "author": "Mustard", - "version": (0, 31, 1, 3), + "version": (0, 31, 1, 2), "blender": (4, 1, 0), "warning": "", "doc_url": "https://github.com/Mustard2/MustardUI/wiki", diff --git a/menu/menu_warnings.py b/menu/menu_warnings.py index c0de381..53a33a1 100644 --- a/menu/menu_warnings.py +++ b/menu/menu_warnings.py @@ -61,7 +61,6 @@ def draw(self, context): box = layout.box() col = box.column(align=True) col.label(text="MustardUI update available!", icon="ERROR") - col.label(text="Restart after updating.", icon="BLANK1") box.operator("mustardui.updater", icon="WORLD") # Eevee normals enabled in Cycles diff --git a/misc/updater.py b/misc/updater.py index 4f780fa..44d984b 100644 --- a/misc/updater.py +++ b/misc/updater.py @@ -13,13 +13,14 @@ def mustardui_retrieve_remote_version(): # Import the data from the GitHub repository file try: - response = requests.get("https://raw.githubusercontent.com/Mustard2/MustardUI/master/__init__.py") + response = requests.get("https://raw.githubusercontent.com/Mustard2/MustardUI/Version-0.31.1/__init__.py") data = response.text except: return 1, v, b # Fetch version try: + print(data) if '"version": (' in data and '"blender": (' in data: find = data.split('"version": (', 1)[1] v[0] = int(find.split(',')[0]) @@ -91,7 +92,7 @@ def invoke(self, context, event): self.report({'ERROR'}, "MustardUI: Can not find the version number of the remote repository") return {'FINISHED'} - return context.window_manager.invoke_props_dialog(self, width=300) + return context.window_manager.invoke_props_dialog(self, width=400) def draw(self, context): @@ -107,9 +108,12 @@ def draw(self, context): else: if bpy.app.version >= blender: box.label(text="Update available!", icon="INFO") + box.label(text="Restart after updating.", icon="ERROR") else: box.label(text="Update is available for a new Blender version!", icon="INFO") - box.label(text="Update Blender before installing the new MustardUI.", icon="INFO") + box.label(text="Update Blender before installing the new MustardUI.", icon="ERROR") + + box = layout.box() row = box.row() row.label(text="Current version: ", icon="RIGHTARROW_THIN") @@ -126,7 +130,7 @@ def draw(self, context): box.label(text="Click 'OK' to open the latest release page.", icon="ERROR") else: row = box.row() - row.label(text="Minimum Blender version required: ", icon="WORLD") + row.label(text="Blender version required: ", icon="BLENDER") row.label( text=str(self.b[0]) + '.' + str(self.b[1]) + '.' + str(self.b[2])) From b02bf14c9cb6819a7abe24f8a84474a6c564993d Mon Sep 17 00:00:00 2001 From: Mustard Date: Sun, 10 Mar 2024 19:22:50 +0100 Subject: [PATCH 06/14] added messages to update function --- __init__.py | 2 +- misc/updater.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 1b6668d..2a04655 100644 --- a/__init__.py +++ b/__init__.py @@ -6,7 +6,7 @@ "name": "MustardUI", "description": "Easy-to-use UI for human characters.", "author": "Mustard", - "version": (0, 31, 1, 2), + "version": (0, 31, 1, 5), "blender": (4, 1, 0), "warning": "", "doc_url": "https://github.com/Mustard2/MustardUI/wiki", diff --git a/misc/updater.py b/misc/updater.py index 44d984b..70e139d 100644 --- a/misc/updater.py +++ b/misc/updater.py @@ -13,7 +13,7 @@ def mustardui_retrieve_remote_version(): # Import the data from the GitHub repository file try: - response = requests.get("https://raw.githubusercontent.com/Mustard2/MustardUI/Version-0.31.1/__init__.py") + response = requests.get("https://raw.githubusercontent.com/Mustard2/MustardUI/master/__init__.py") data = response.text except: return 1, v, b From 67103953cae84315bbda749df0b5ee4cc366d597 Mon Sep 17 00:00:00 2001 From: Mustard Date: Sun, 10 Mar 2024 19:29:54 +0100 Subject: [PATCH 07/14] reverted #141 fix due to Blender bug fix --- menu/menu_configure.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/menu/menu_configure.py b/menu/menu_configure.py index 5f48f9d..6c29e9e 100644 --- a/menu/menu_configure.py +++ b/menu/menu_configure.py @@ -392,18 +392,12 @@ def draw(self, context): row.enabled = not bcoll_settings.outfit_switcher_enable row.prop(bcoll_settings, 'advanced') - # Warning for Blender bug https://projects.blender.org/blender/blender/issues/116061 - if addon_prefs.experimental: - col = box.column(align=True) - row = col.row(align=True) - row.label(text="The feature below might cause", icon="ERROR") - row.operator("mustardui.openlink", icon="URL", text="").url = "https://projects.blender.org/blender/blender/issues/116061" - col.label(text="crashes due to a Blender bug!", icon="BLANK1") - col.prop(bcoll_settings, 'outfit_switcher_enable') - if bcoll_settings.outfit_switcher_enable: - col.prop(bcoll_settings, 'outfit_switcher_collection', text="Collection") - if bcoll_settings.outfit_switcher_collection is not None: - col.prop(bcoll_settings, 'outfit_switcher_object', text="Object") + col = box.column(align=True) + col.prop(bcoll_settings, 'outfit_switcher_enable') + if bcoll_settings.outfit_switcher_enable: + col.prop(bcoll_settings, 'outfit_switcher_collection', text="Collection") + if bcoll_settings.outfit_switcher_collection is not None: + col.prop(bcoll_settings, 'outfit_switcher_object', text="Object") # Physics Settings row = layout.row(align=False) From fd21fbff0a8e7ae9a1e8bc6c460d7aafa629dd14 Mon Sep 17 00:00:00 2001 From: Mustard Date: Tue, 12 Mar 2024 12:43:52 +0100 Subject: [PATCH 08/14] fixed early return --- settings/rig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/rig.py b/settings/rig.py index 1e66818..8e46cdc 100644 --- a/settings/rig.py +++ b/settings/rig.py @@ -71,7 +71,7 @@ def update_norm_autosmooth(self, context): for modifier in [x for x in self.model_body.modifiers if x.type == "NODES"]: if modifier.node_group.name != "Smooth by Angle": - return + continue modifier.show_viewport = self.body_norm_autosmooth modifier.show_render = self.body_norm_autosmooth From d6e0eaa763cfb41b8933a895aabf12cd5935d349 Mon Sep 17 00:00:00 2001 From: Mustard Date: Tue, 12 Mar 2024 12:48:04 +0100 Subject: [PATCH 09/14] fixed autosmooth when a void geometry nodes modifer is available --- settings/rig.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/settings/rig.py b/settings/rig.py index 8e46cdc..5dbc90a 100644 --- a/settings/rig.py +++ b/settings/rig.py @@ -70,6 +70,8 @@ def update_norm_autosmooth(self, context): return for modifier in [x for x in self.model_body.modifiers if x.type == "NODES"]: + if modifier.node_group is None: + continue if modifier.node_group.name != "Smooth by Angle": continue modifier.show_viewport = self.body_norm_autosmooth From 1138f6627577f2fd482ebaff389f5159c38aaa2e Mon Sep 17 00:00:00 2001 From: Mustard Date: Fri, 15 Mar 2024 21:37:47 +0100 Subject: [PATCH 10/14] removed debug line --- misc/updater.py | 1 - 1 file changed, 1 deletion(-) diff --git a/misc/updater.py b/misc/updater.py index 70e139d..1cd6e4b 100644 --- a/misc/updater.py +++ b/misc/updater.py @@ -20,7 +20,6 @@ def mustardui_retrieve_remote_version(): # Fetch version try: - print(data) if '"version": (' in data and '"blender": (' in data: find = data.split('"version": (', 1)[1] v[0] = int(find.split(',')[0]) From 9add8d1a3475d5379a698f617c090dd1ed91a1e2 Mon Sep 17 00:00:00 2001 From: Mustard Date: Fri, 15 Mar 2024 22:13:34 +0100 Subject: [PATCH 11/14] fixed some issues with bone collections --- armature/definitions.py | 2 +- armature/ui_list.py | 2 +- menu/menu_configure.py | 6 +++--- outfits/ops_visibility.py | 2 +- settings/rig.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/armature/definitions.py b/armature/definitions.py index 509ccb3..da3368b 100644 --- a/armature/definitions.py +++ b/armature/definitions.py @@ -81,7 +81,7 @@ def mustardui_armature_visibility_outfits_update(self, context): poll, arm = mustardui_active_object(context, config=0) armature_settings = arm.MustardUI_ArmatureSettings rig_settings = arm.MustardUI_RigSettings - for bcoll in arm.collections: + for bcoll in arm.collections_all: bcoll_settings = bcoll.MustardUI_ArmatureBoneCollection if bcoll_settings.outfit_switcher_enable: check_coll = ( diff --git a/armature/ui_list.py b/armature/ui_list.py index de60050..f53c57b 100644 --- a/armature/ui_list.py +++ b/armature/ui_list.py @@ -17,7 +17,7 @@ def draw_item(self, _context, layout, armature, bcoll, _icon, _active_data, _act row = layout.row(align=True) # Check if the icon should be drawn - for b in armature.collections: + for b in armature.collections_all: if b.MustardUI_ArmatureBoneCollection.icon != "NONE": row.label(text="", icon=bcoll_settings.icon if bcoll_settings.icon != "NONE" else "BLANK1") break diff --git a/menu/menu_configure.py b/menu/menu_configure.py index 6c29e9e..1eb4f94 100644 --- a/menu/menu_configure.py +++ b/menu/menu_configure.py @@ -350,9 +350,9 @@ def draw(self, context): row.template_list( "MUSTARDUI_UL_Armature_UIList", - "collections", + "collections_all", arm, - "collections", + "collections_all", arm.collections, "active_index", rows=rows, @@ -381,7 +381,7 @@ def draw(self, context): if arm.collections.active_index > -1: - bcoll = arm.collections[arm.collections.active_index] + bcoll = arm.collections_all[arm.collections.active_index] bcoll_settings = bcoll.MustardUI_ArmatureBoneCollection col = box.column(align=True) diff --git a/outfits/ops_visibility.py b/outfits/ops_visibility.py index 07498db..9eac724 100644 --- a/outfits/ops_visibility.py +++ b/outfits/ops_visibility.py @@ -60,7 +60,7 @@ def execute(self, context): # Enable/disable armature layers if armature_settings.outfits: - outfit_armature_layers = [x for x in arm.collections if x.MustardUI_ArmatureBoneCollection.outfit_switcher_enable and x.MustardUI_ArmatureBoneCollection.outfit_switcher_collection != None] + outfit_armature_layers = [x for x in arm.collections_all if x.MustardUI_ArmatureBoneCollection.outfit_switcher_enable and x.MustardUI_ArmatureBoneCollection.outfit_switcher_collection != None] for bcoll in outfit_armature_layers: bcoll_settings = bcoll.MustardUI_ArmatureBoneCollection items = bcoll_settings.outfit_switcher_collection.all_objects if rig_settings.outfit_config_subcollections else bcoll_settings.outfit_switcher_collection.objects diff --git a/settings/rig.py b/settings/rig.py index 5dbc90a..eddf09d 100644 --- a/settings/rig.py +++ b/settings/rig.py @@ -288,7 +288,7 @@ def outfits_list_make(self, context): def update_armature_outfit_layers(self, context, armature_settings): poll, arm = mustardui_active_object(context, config=0) - bcolls = [x for x in arm.collections if x.MustardUI_ArmatureBoneCollection.outfit_switcher_enable + bcolls = [x for x in arm.collections_all if x.MustardUI_ArmatureBoneCollection.outfit_switcher_enable and x.MustardUI_ArmatureBoneCollection.outfit_switcher_collection is not None] for bcoll in bcolls: From 72b7a73c34099d507bca4d34bade2ff8ac175bed Mon Sep 17 00:00:00 2001 From: Mustard Date: Tue, 19 Mar 2024 16:56:55 +0100 Subject: [PATCH 12/14] removed unused definition --- settings/addon_prefs.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/settings/addon_prefs.py b/settings/addon_prefs.py index 5e1b970..c633c62 100644 --- a/settings/addon_prefs.py +++ b/settings/addon_prefs.py @@ -22,13 +22,6 @@ def developer_update(self, context): "added to the UI and in the Settings panel", update=developer_update) - # Maintenance tools - developer: BoolProperty(default=False, - name="Developer Tools", - description="Enable Developer Tools.\nVarious developer tools will be " - "added to the UI and in the Settings panel", - update=developer_update) - # Debug mode debug: BoolProperty(default=False, name="Debug Mode", From 3e493d87b19b58e3d8ee0e7f800d95418f36a9e3 Mon Sep 17 00:00:00 2001 From: Mustard Date: Tue, 19 Mar 2024 18:51:12 +0100 Subject: [PATCH 13/14] inverted unregister to avoid some issues while deleting the addon or updating --- __init__.py | 26 +++++++++++++------------- armature/__init__.py | 2 +- armature/definitions.py | 2 +- configuration/__init__.py | 8 ++++---- custom_properties/__init__.py | 14 +++++++------- custom_properties/definitions.py | 2 +- custom_properties/menus.py | 6 +++--- custom_properties/ops_link.py | 2 +- custom_properties/ops_props.py | 4 ++-- custom_properties/ui_list.py | 2 +- diffeomorphic/__init__.py | 6 +++--- diffeomorphic/ops_drivers.py | 2 +- links/__init__.py | 6 +++--- links/ops_preset.py | 2 +- links/ui_list.py | 6 +++--- menu/__init__.py | 28 ++++++++++++++-------------- menu/menu_tools.py | 8 ++++---- misc/__init__.py | 2 +- model_selection/ops_vms.py | 2 +- outfits/__init__.py | 14 +++++++------- outfits/ui_list.py | 2 +- sections/__init__.py | 2 +- sections/ui_list.py | 6 +++--- settings/__init__.py | 12 ++++++------ tools/__init__.py | 12 ++++++------ tools/lattice.py | 4 ++-- tools/physics.py | 12 ++++++------ warnings/__init__.py | 2 +- 28 files changed, 98 insertions(+), 98 deletions(-) diff --git a/__init__.py b/__init__.py index 2a04655..2154e4e 100644 --- a/__init__.py +++ b/__init__.py @@ -47,17 +47,17 @@ def register(): def unregister(): - settings.unregister() - misc.unregister() - model_selection.unregister() - warnings.unregister() - armature.unregister() - tools.unregister() - tools_creators.unregister() - custom_properties.unregister() - sections.unregister() - outfits.unregister() - diffeomorphic.unregister() - configuration.unregister() - links.unregister() menu.unregister() + links.unregister() + configuration.unregister() + diffeomorphic.unregister() + outfits.unregister() + sections.unregister() + custom_properties.unregister() + tools_creators.unregister() + tools.unregister() + armature.unregister() + warnings.unregister() + model_selection.unregister() + misc.unregister() + settings.unregister() diff --git a/armature/__init__.py b/armature/__init__.py index f6068bf..53cf8c2 100644 --- a/armature/__init__.py +++ b/armature/__init__.py @@ -8,5 +8,5 @@ def register(): def unregister(): - definitions.unregister() ui_list.unregister() + definitions.unregister() diff --git a/armature/definitions.py b/armature/definitions.py index da3368b..a3dab54 100644 --- a/armature/definitions.py +++ b/armature/definitions.py @@ -142,5 +142,5 @@ def register(): def unregister(): - bpy.utils.unregister_class(MustardUI_ArmatureBoneCollection) bpy.utils.unregister_class(MustardUI_ArmatureSettings) + bpy.utils.unregister_class(MustardUI_ArmatureBoneCollection) diff --git a/configuration/__init__.py b/configuration/__init__.py index b6a8e03..e7f01c9 100644 --- a/configuration/__init__.py +++ b/configuration/__init__.py @@ -14,8 +14,8 @@ def register(): def unregister(): - ops_configuration.unregister() - ops_smartcheck.unregister() - ops_cleanmodel.unregister() - ops_debug.unregister() ops_removeui.unregister() + ops_debug.unregister() + ops_cleanmodel.unregister() + ops_smartcheck.unregister() + ops_configuration.unregister() diff --git a/custom_properties/__init__.py b/custom_properties/__init__.py index e36e7ff..e1e1805 100644 --- a/custom_properties/__init__.py +++ b/custom_properties/__init__.py @@ -20,11 +20,11 @@ def register(): def unregister(): - definitions.unregister() - ops_props.unregister() - ops_link.unregister() - menus.unregister() - ui_list.unregister() - ops_menu_settings.unregister() - ops_rebuild.unregister() ops_smartcheck.unregister() + ops_rebuild.unregister() + ops_menu_settings.unregister() + ui_list.unregister() + menus.unregister() + ops_link.unregister() + ops_props.unregister() + definitions.unregister() diff --git a/custom_properties/definitions.py b/custom_properties/definitions.py index 1d6aa41..eb53185 100644 --- a/custom_properties/definitions.py +++ b/custom_properties/definitions.py @@ -117,5 +117,5 @@ def register(): def unregister(): - bpy.utils.unregister_class(MustardUI_LinkedProperty) bpy.utils.unregister_class(MustardUI_CustomProperty) + bpy.utils.unregister_class(MustardUI_LinkedProperty) diff --git a/custom_properties/menus.py b/custom_properties/menus.py index d622787..c9642fc 100644 --- a/custom_properties/menus.py +++ b/custom_properties/menus.py @@ -221,10 +221,10 @@ def register(): def unregister(): - for m in menus: + for m in reversed(menus): bpy.utils.unregister_class(m) - from .menus_functions import mustardui_property_menuadd - bpy.types.UI_MT_button_context_menu.remove(mustardui_property_menuadd) from .menus_functions import mustardui_property_link bpy.types.UI_MT_button_context_menu.remove(mustardui_property_link) + from .menus_functions import mustardui_property_menuadd + bpy.types.UI_MT_button_context_menu.remove(mustardui_property_menuadd) diff --git a/custom_properties/ops_link.py b/custom_properties/ops_link.py index b9c3787..9ed78d1 100644 --- a/custom_properties/ops_link.py +++ b/custom_properties/ops_link.py @@ -187,5 +187,5 @@ def register(): def unregister(): - bpy.utils.unregister_class(MustardUI_Property_MenuLink) bpy.utils.unregister_class(MustardUI_Property_RemoveLinked) + bpy.utils.unregister_class(MustardUI_Property_MenuLink) diff --git a/custom_properties/ops_props.py b/custom_properties/ops_props.py index ce9a4ea..08bc13a 100644 --- a/custom_properties/ops_props.py +++ b/custom_properties/ops_props.py @@ -295,6 +295,6 @@ def register(): def unregister(): - bpy.utils.unregister_class(MustardUI_Property_MenuAdd) - bpy.utils.unregister_class(MustardUI_Property_Remove) bpy.utils.unregister_class(MustardUI_Property_Switch) + bpy.utils.unregister_class(MustardUI_Property_Remove) + bpy.utils.unregister_class(MustardUI_Property_MenuAdd) diff --git a/custom_properties/ui_list.py b/custom_properties/ui_list.py index 3e7a3c4..72a166b 100644 --- a/custom_properties/ui_list.py +++ b/custom_properties/ui_list.py @@ -186,5 +186,5 @@ def register(): def unregister(): - for m in menus: + for m in reversed(menus): bpy.utils.unregister_class(m) diff --git a/diffeomorphic/__init__.py b/diffeomorphic/__init__.py index 4c63251..739ff11 100644 --- a/diffeomorphic/__init__.py +++ b/diffeomorphic/__init__.py @@ -12,7 +12,7 @@ def register(): def unregister(): - ops_checkmorphs.unregister() - ops_clearpose.unregister() - ops_defvalue.unregister() ops_drivers.unregister() + ops_defvalue.unregister() + ops_clearpose.unregister() + ops_checkmorphs.unregister() diff --git a/diffeomorphic/ops_drivers.py b/diffeomorphic/ops_drivers.py index b2a5cd0..0b247e8 100644 --- a/diffeomorphic/ops_drivers.py +++ b/diffeomorphic/ops_drivers.py @@ -171,5 +171,5 @@ def register(): def unregister(): - bpy.utils.unregister_class(MustardUI_DazMorphs_DisableDrivers) bpy.utils.unregister_class(MustardUI_DazMorphs_EnableDrivers) + bpy.utils.unregister_class(MustardUI_DazMorphs_DisableDrivers) diff --git a/links/__init__.py b/links/__init__.py index b714b5c..1b6d090 100644 --- a/links/__init__.py +++ b/links/__init__.py @@ -12,7 +12,7 @@ def register(): def unregister(): - definitions.unregister() - ops_link.unregister() - ops_preset.unregister() ui_list.unregister() + ops_preset.unregister() + ops_link.unregister() + definitions.unregister() diff --git a/links/ops_preset.py b/links/ops_preset.py index 95f888e..8919787 100644 --- a/links/ops_preset.py +++ b/links/ops_preset.py @@ -117,5 +117,5 @@ def register(): def unregister(): - bpy.utils.unregister_class(MustardUI_Links_Export) bpy.utils.unregister_class(MustardUI_Links_Import) + bpy.utils.unregister_class(MustardUI_Links_Export) diff --git a/links/ui_list.py b/links/ui_list.py index f020597..45a4f15 100644 --- a/links/ui_list.py +++ b/links/ui_list.py @@ -113,7 +113,7 @@ def register(): def unregister(): - bpy.utils.unregister_class(MustardUI_Links_UIList_Switch) - bpy.utils.unregister_class(MustardUI_Link_Add) - bpy.utils.unregister_class(MustardUI_Link_Remove) bpy.utils.unregister_class(MUSTARDUI_UL_Links_UIList) + bpy.utils.unregister_class(MustardUI_Link_Remove) + bpy.utils.unregister_class(MustardUI_Link_Add) + bpy.utils.unregister_class(MustardUI_Links_UIList_Switch) diff --git a/menu/__init__.py b/menu/__init__.py index 897a0af..e679eb8 100644 --- a/menu/__init__.py +++ b/menu/__init__.py @@ -40,18 +40,18 @@ def register(): def unregister(): - menu_select_model.unregister() - menu_warnings.unregister() - menu_configure.unregister() - menu_tools_creators.unregister() - menu_body.unregister() - menu_morphs.unregister() - menu_outfits.unregister() - menu_hair.unregister() - menu_armature.unregister() - menu_simplify.unregister() - menu_tools_physics.unregister() - menu_tools_lattice.unregister() - menu_tools.unregister() - menu_settings.unregister() menu_links.unregister() + menu_settings.unregister() + menu_tools.unregister() + menu_tools_lattice.unregister() + menu_tools_physics.unregister() + menu_simplify.unregister() + menu_armature.unregister() + menu_hair.unregister() + menu_outfits.unregister() + menu_morphs.unregister() + menu_body.unregister() + menu_tools_creators.unregister() + menu_configure.unregister() + menu_warnings.unregister() + menu_select_model.unregister() diff --git a/menu/menu_tools.py b/menu/menu_tools.py index 18a811b..48f19dc 100644 --- a/menu/menu_tools.py +++ b/menu/menu_tools.py @@ -205,8 +205,8 @@ def register(): def unregister(): - bpy.utils.unregister_class(PANEL_PT_MustardUI_Tools) - bpy.utils.unregister_class(PANEL_PT_MustardUI_Tools_ChildOf) - bpy.utils.unregister_class(PANEL_PT_MustardUI_Tools_LipsShrinkwrap) - bpy.utils.unregister_class(PANEL_PT_MustardUI_Tools_AutoEyelid) bpy.utils.unregister_class(PANEL_PT_MustardUI_Tools_AutoBreath) + bpy.utils.unregister_class(PANEL_PT_MustardUI_Tools_AutoEyelid) + bpy.utils.unregister_class(PANEL_PT_MustardUI_Tools_LipsShrinkwrap) + bpy.utils.unregister_class(PANEL_PT_MustardUI_Tools_ChildOf) + bpy.utils.unregister_class(PANEL_PT_MustardUI_Tools) diff --git a/misc/__init__.py b/misc/__init__.py index 226390f..060c27f 100644 --- a/misc/__init__.py +++ b/misc/__init__.py @@ -8,5 +8,5 @@ def register(): def unregister(): - updater.unregister() ops_fix_missing_UI.unregister() + updater.unregister() diff --git a/model_selection/ops_vms.py b/model_selection/ops_vms.py index 6cb03b8..f3843e8 100644 --- a/model_selection/ops_vms.py +++ b/model_selection/ops_vms.py @@ -60,5 +60,5 @@ def register(): def unregister(): - bpy.utils.unregister_class(MustardUI_ViewportModelSelection) bpy.utils.unregister_class(MustardUI_SwitchModel) + bpy.utils.unregister_class(MustardUI_ViewportModelSelection) diff --git a/outfits/__init__.py b/outfits/__init__.py index 00cf3d3..0eea5e7 100644 --- a/outfits/__init__.py +++ b/outfits/__init__.py @@ -20,11 +20,11 @@ def register(): def unregister(): - ops_add.unregister() - ops_delete.unregister() - ops_remove.unregister() - ops_optimize.unregister() - ops_smartcheck.unregister() - ops_visibility.unregister() - ui_list.unregister() menu.unregister() + ui_list.unregister() + ops_visibility.unregister() + ops_smartcheck.unregister() + ops_optimize.unregister() + ops_remove.unregister() + ops_delete.unregister() + ops_add.unregister() diff --git a/outfits/ui_list.py b/outfits/ui_list.py index be6aa81..8f195ce 100644 --- a/outfits/ui_list.py +++ b/outfits/ui_list.py @@ -57,5 +57,5 @@ def register(): def unregister(): - bpy.utils.unregister_class(MUSTARDUI_UL_Outfits_UIList) bpy.utils.unregister_class(MustardUI_Outfits_UIList_Switch) + bpy.utils.unregister_class(MUSTARDUI_UL_Outfits_UIList) diff --git a/sections/__init__.py b/sections/__init__.py index ef8cc34..81a2354 100644 --- a/sections/__init__.py +++ b/sections/__init__.py @@ -8,5 +8,5 @@ def register(): def unregister(): - ops_assign.unregister() ui_list.unregister() + ops_assign.unregister() diff --git a/sections/ui_list.py b/sections/ui_list.py index 8d4cb0c..7b6e20b 100644 --- a/sections/ui_list.py +++ b/sections/ui_list.py @@ -141,7 +141,7 @@ def register(): def unregister(): - bpy.utils.unregister_class(MustardUI_Section_UIList_Switch) - bpy.utils.unregister_class(MustardUI_Body_AddSection) - bpy.utils.unregister_class(MustardUI_Body_DeleteSection) bpy.utils.unregister_class(MUSTARDUI_UL_Section_UIList) + bpy.utils.unregister_class(MustardUI_Body_DeleteSection) + bpy.utils.unregister_class(MustardUI_Body_AddSection) + bpy.utils.unregister_class(MustardUI_Section_UIList_Switch) diff --git a/settings/__init__.py b/settings/__init__.py index 85f7767..b4eb33e 100644 --- a/settings/__init__.py +++ b/settings/__init__.py @@ -18,10 +18,10 @@ def register(): def unregister(): - addon_prefs.unregister() - addon.unregister() - outfit.unregister() - daz_morph.unregister() - section.unregister() - rig.unregister() geometry_nodes.unregister() + rig.unregister() + section.unregister() + daz_morph.unregister() + outfit.unregister() + addon.unregister() + addon_prefs.unregister() diff --git a/tools/__init__.py b/tools/__init__.py index a5780ee..bd8cfd7 100644 --- a/tools/__init__.py +++ b/tools/__init__.py @@ -18,10 +18,10 @@ def register(): def unregister(): - settings.unregister() - lattice.unregister() - physics.unregister() - eevee_normals.unregister() - childof.unregister() - auto_eyelid.unregister() auto_breath.unregister() + auto_eyelid.unregister() + childof.unregister() + eevee_normals.unregister() + physics.unregister() + lattice.unregister() + settings.unregister() diff --git a/tools/lattice.py b/tools/lattice.py index f9fa586..8425edc 100644 --- a/tools/lattice.py +++ b/tools/lattice.py @@ -287,6 +287,6 @@ def register(): def unregister(): - bpy.utils.unregister_class(MustardUI_Tools_LatticeSetup) - bpy.utils.unregister_class(MustardUI_Tools_LatticeModify) bpy.utils.unregister_class(MustardUI_LatticeSettings) + bpy.utils.unregister_class(MustardUI_Tools_LatticeModify) + bpy.utils.unregister_class(MustardUI_Tools_LatticeSetup) diff --git a/tools/physics.py b/tools/physics.py index f40572d..64aea1a 100644 --- a/tools/physics.py +++ b/tools/physics.py @@ -642,10 +642,10 @@ def register(): def unregister(): - bpy.utils.unregister_class(MustardUI_Tools_Physics_CreateItem) - bpy.utils.unregister_class(MustardUI_Tools_Physics_SimulateObject) - bpy.utils.unregister_class(MustardUI_Tools_Physics_Clean) - bpy.utils.unregister_class(MustardUI_Tools_Physics_ReBind) - bpy.utils.unregister_class(MustardUI_Tools_Physics_DeleteItem) - bpy.utils.unregister_class(MustardUI_PhysicsItem) bpy.utils.unregister_class(MustardUI_PhysicsSettings) + bpy.utils.unregister_class(MustardUI_PhysicsItem) + bpy.utils.unregister_class(MustardUI_Tools_Physics_DeleteItem) + bpy.utils.unregister_class(MustardUI_Tools_Physics_ReBind) + bpy.utils.unregister_class(MustardUI_Tools_Physics_Clean) + bpy.utils.unregister_class(MustardUI_Tools_Physics_SimulateObject) + bpy.utils.unregister_class(MustardUI_Tools_Physics_CreateItem) diff --git a/warnings/__init__.py b/warnings/__init__.py index eb195e9..1a7b342 100644 --- a/warnings/__init__.py +++ b/warnings/__init__.py @@ -8,5 +8,5 @@ def register(): def unregister(): - ops_fix_old_UI.unregister() ops_fix_eevee_normals.unregister() + ops_fix_old_UI.unregister() From 0726e6c3526b22da3426ba99d67c0e92ed36daa3 Mon Sep 17 00:00:00 2001 From: Mustard Date: Tue, 19 Mar 2024 18:58:24 +0100 Subject: [PATCH 14/14] added note for installation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d6251b5..449e70d 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ MustardUI is a Blender script that provides an intuitive and easy-to-use user interface for human models. +**Note: do not download the file from the Code button, use the .zip file on the [latest release](https://github.com/Mustard2/MustardUI/releases/latest) instead.** + ## Features The main features are: