Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon doesn't appear to install anymore as of Blender v4.0 #6

Open
SuperFromND opened this issue Nov 23, 2023 · 1 comment
Open

Addon doesn't appear to install anymore as of Blender v4.0 #6

SuperFromND opened this issue Nov 23, 2023 · 1 comment

Comments

@SuperFromND
Copy link

SuperFromND commented Nov 23, 2023

Hihi, great tools you've got here! I'm trying to install this addon in Blender 4.0, but it appears to simply not want to install for whatever reason as of 4.0. I'm not sure if there's just been some plugin format changes between when 1.0 of this plugin came out and 4.0's release or what, but it seems to have rendered it impossible to install this addon.

Blender claims to successfully install the addon, but the addon doesn't appear in the addons list and Blender reports its name as simply () in the console.

Using Blender 4.0 and I've attempted installing both release 1.0 and the latest commit on this repo.
Tried installing via both the Edit -> Preferences tab and manually installing by creating an io_import_glr folder and dragging the two .py files into it.

@scurest
Copy link
Contributor

scurest commented Jan 30, 2024

The addon installs fine for me in 4.0. Are you sure you're installing it correctly?

It will throw an exception when you try to import a file though, because of API changes for node groups. This patch will fix it, but the addon won't work anymore on versions <4.0.

Patch
diff --git a/io_import_glr/import_glr.py b/io_import_glr/import_glr.py
index 8977304..86e15a3 100644
--- a/io_import_glr/import_glr.py
+++ b/io_import_glr/import_glr.py
@@ -727,19 +727,20 @@ def create_combiner_group():
     # should be sRGB?
 
     group = bpy.data.node_groups.new('RDP Color Combiner', 'ShaderNodeTree')
+    iface = group.interface
     nodes = group.nodes
     links = group.links
 
-    group.inputs.new('NodeSocketColor', 'Color A')
-    group.inputs.new('NodeSocketColor', 'Color B')
-    group.inputs.new('NodeSocketColor', 'Color C')
-    group.inputs.new('NodeSocketColor', 'Color D')
-    group.inputs.new('NodeSocketFloat', 'Alpha A')
-    group.inputs.new('NodeSocketFloat', 'Alpha B')
-    group.inputs.new('NodeSocketFloat', 'Alpha C')
-    group.inputs.new('NodeSocketFloat', 'Alpha D')
-    group.outputs.new('NodeSocketColor', 'Color')
-    group.outputs.new('NodeSocketFloat', 'Alpha')
+    iface.new_socket(name='Color A', in_out='INPUT', socket_type='NodeSocketColor')
+    iface.new_socket(name='Color B', in_out='INPUT', socket_type='NodeSocketColor')
+    iface.new_socket(name='Color C', in_out='INPUT', socket_type='NodeSocketColor')
+    iface.new_socket(name='Color D', in_out='INPUT', socket_type='NodeSocketColor')
+    iface.new_socket(name='Alpha A', in_out='INPUT', socket_type='NodeSocketFloat')
+    iface.new_socket(name='Alpha B', in_out='INPUT', socket_type='NodeSocketFloat')
+    iface.new_socket(name='Alpha C', in_out='INPUT', socket_type='NodeSocketFloat')
+    iface.new_socket(name='Alpha D', in_out='INPUT', socket_type='NodeSocketFloat')
+    iface.new_socket(name='Color', in_out='OUTPUT', socket_type='NodeSocketColor')
+    iface.new_socket(name='Alpha', in_out='OUTPUT', socket_type='NodeSocketFloat')
 
     node_input = nodes.new('NodeGroupInput')
     node_subc = nodes.new('ShaderNodeMixRGB')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants