Closed 64blit closed 9 months ago
Do you have enabled Cycles Render Plugin? This required for some functions of ACT.
I get the same error, and the Cycles Renderer Plugin comes enabled by default in Blender. I am using Blender 3.6.5.
I think it has to do with in what order the Cycles addon is unregistered, as if you enable the Cycles addon after ACT it complains about no 'CYCLES_PT_context_material' since it doesn't exist yet, and if you enable the ACT after the Cycles addon (which is the default) it complains because 'CYCLES_PT_context_material' no longer exists. I don't know if you can do a test in the modules register (this one would cause issues as ACT would have the proper modles registered.) and unregister methods to see if 'CYCLES_PT_context_material' exitsts and just bypass its unregistering or if that would add a lot of overhead.
The best thing I think you can do is handle the error gracefully.
Save the git repo patch to a location on your disk then test with
patch -u -b --dry-run --verbose Asset_Creation_Toolset_2023_1_Bl361/material_tools.py -i path/to/where/you/saved/the.patch
Then apply with
patch -u -b --verbose Asset_Creation_Toolset_2023_1_Bl361/material_tools.py -i path/to/where/you/saved/the.patch
Patch for git repo
From 48d99f8d10637b498c815a5e17ebd7b14f3bdb73 Mon Sep 17 00:00:00 2001
From: EWomer <ewomer@hotmail.com>
Date: Sat, 28 Oct 2023 21:48:44 -0400
Subject: [PATCH] Handle Cycles addon unregistering gracefully
---
.../material_tools.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/Asset_Creation_Toolset_2023_1_Bl361/material_tools.py b/Asset_Creation_Toolset_2023_1_Bl361/material_tools.py
index 3185090..59546f1 100644
--- a/Asset_Creation_Toolset_2023_1_Bl361/material_tools.py
+++ b/Asset_Creation_Toolset_2023_1_Bl361/material_tools.py
@@ -1043,8 +1043,15 @@ def register():
def unregister():
- bpy.types.CYCLES_PT_context_material.remove(Material_Menu_Panel)
- bpy.types.EEVEE_MATERIAL_PT_context_material.remove(Material_Menu_Panel)
+ try:
+ bpy.types.CYCLES_PT_context_material.remove(Material_Menu_Panel)
+ except AttributeError as err:
+ print(err)
+ try:
+ bpy.types.EEVEE_MATERIAL_PT_context_material.remove(Material_Menu_Panel)
+ except AttributeError as err:
+ print(err)
for cls in reversed(classes):
- bpy.utils.unregister_class(cls)
\ No newline at end of file
+ bpy.utils.unregister_class(cls)
+
--
2.39.2
For the non git repo patch file
Save the non git repo patch to a location on your disk then test with
patch -u -b --dry-run --verbose material_tools.py -i path/to/where/you/saved/the.patch
Then apply with
patch -u -b --verbose material_tools.py -i path/to/where/you/saved/the.patch
Patch for downloaded addon
diff --git a/material_tools.py b/material_tools.py
index 3185090..59546f1 100644
--- a/material_tools.py
+++ b/material_tools.py
@@ -1043,8 +1043,15 @@ def register():
def unregister():
- bpy.types.CYCLES_PT_context_material.remove(Material_Menu_Panel)
- bpy.types.EEVEE_MATERIAL_PT_context_material.remove(Material_Menu_Panel)
+ try:
+ bpy.types.CYCLES_PT_context_material.remove(Material_Menu_Panel)
+ except AttributeError as err:
+ print(err)
+ try:
+ bpy.types.EEVEE_MATERIAL_PT_context_material.remove(Material_Menu_Panel)
+ except AttributeError as err:
+ print(err)
for cls in reversed(classes):
- bpy.utils.unregister_class(cls)
+ bpy.utils.unregister_class(cls)
+
@ericwomer Thank You for solution! Added in 8405ca21bf0801c213ca92b82f7688a8825c1b71
Thanks for this awesome tool, just wanted to share this small bug I've seen on windows with blender versions 2.9 - 3.1
Not sure proper procedure for bug reporting, let me know if this is alright. Thanks again :-)