taniwha / io_object_mu

Python .mu reader/writer and blender import/export addon
GNU General Public License v2.0
120 stars 51 forks source link

AttributeError: 'ShaderNodeTree' object has no attribute 'inputs' #77

Closed twoexem closed 2 months ago

twoexem commented 9 months ago

When trying to import any models, I get the following error:

Traceback (most recent call last): File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/import_craft/import_craft.py", line 106, in execute return import_craft_op(self, context, **keywords) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/import_craft/import_craft.py", line 80, in import_craft_op obj = import_craft(filepath) ^^^^^^^^^^^^^^^^^^^^^^ File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/import_craft/import_craft.py", line 60, in import_craft part = gamedata.parts[pname].get_model() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/import_craft/part.py", line 63, in get_model self.model = compile_model(self.db, self.path, "part", self.name, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/model/model.py", line 48, in compile_model mdl = db.model(submodelname) ^^^^^^^^^^^^^^^^^^^^^^ File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/import_craft/gamedata.py", line 153, in model self.models[url] = Model(path, url) ^^^^^^^^^^^^^^^^ File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/model/model.py", line 106, in init obj, mu = import_mu(model, path, False, False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/import_mu/import_mu.py", line 203, in import_mu return process_mu(mu, os.path.dirname(filepath)), mu ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/import_mu/import_mu.py", line 186, in process_mu create_materials(mu) File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/import_mu/import_mu.py", line 165, in create_materials mumat.material = make_shader(mumat, mu) ^^^^^^^^^^^^^^^^^^^^^^ File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/shader/shader.py", line 246, in make_shader return make_shader4(mumat, mu) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/shader/shader.py", line 233, in make_shader4 create_nodes(mat) File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/shader/shader.py", line 212, in create_nodes build_nodes(mat.name, node_tree, extra) File "/home/mm/.config/blender/4.0/scripts/addons/io_object_mu-master/shader/shader.py", line 93, in build_nodes input = node_tree.inputs.new(type, name) ^^^^^^^^^^^^^^^^ AttributeError: 'ShaderNodeTree' object has no attribute 'inputs'

calfunter commented 8 months ago

same here, have you found a solution?

twoexem commented 8 months ago

No, sadly not. Still waiting for @taniwha to check in on this.

boingusdoingus commented 8 months ago

I fixed the issue by downgrading blender to version 3.3

twoexem commented 8 months ago

Good to know! Have you tried importing the craft in 3.3 and then loading the .blend file in 4.0?

marklinmax commented 7 months ago

A quick search on the web tells us some breaking changes were brought to the node groups API in Blender 4.0. This is one of those. Replacing node_tree.inputs.new(type, name) by node_tree.interface.new_socket(name, in_out="INPUT") and node_tree.outputs.new(type, name) by node_tree.interface.new_socket(name, in_out="OUTPUT") should solve this error.

I still face other errors I haven't been able to tackle though, so the script is not working for me.

taniwha commented 2 months ago

Fixed in 021b04b