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: diff --git a/__init__.py b/__init__.py index 6ee5ecf..2154e4e 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, 5), + "blender": (4, 1, 0), "warning": "", "doc_url": "https://github.com/Mustard2/MustardUI/wiki", "category": "User Interface", @@ -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 509ccb3..a3dab54 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 = ( @@ -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/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/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_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..1eb4f94 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 @@ -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) @@ -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) 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/menu/menu_warnings.py b/menu/menu_warnings.py index 940b7f7..53a33a1 100644 --- a/menu/menu_warnings.py +++ b/menu/menu_warnings.py @@ -61,8 +61,7 @@ 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" + box.operator("mustardui.updater", icon="WORLD") # Eevee normals enabled in Cycles if check_eevee_normals(context.scene, settings): 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/misc/updater.py b/misc/updater.py index 06a5502..1cd6e4b 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") @@ -79,20 +91,28 @@ 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): 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") + 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="ERROR") + + box = layout.box() row = box.row() row.label(text="Current version: ", icon="RIGHTARROW_THIN") @@ -104,8 +124,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="Blender version required: ", icon="BLENDER") + 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(): 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/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/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/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", diff --git a/settings/rig.py b/settings/rig.py index 4e2d360..eddf09d 100644 --- a/settings/rig.py +++ b/settings/rig.py @@ -64,7 +64,18 @@ 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 is None: + continue + if modifier.node_group.name != "Smooth by Angle": + continue + 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): @@ -277,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: 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()