supertuxkart / stk-blender

Blender 2.80 exporter
MIT License
23 stars 19 forks source link

Blender 4.0 fail import SPM #25

Closed ZAQraven closed 6 months ago

ZAQraven commented 8 months ago

Currently using stk-blender with commit 88ff5df.

Python: Traceback (most recent call last):
  File "/home/zaqraven/.config/blender/4.0/scripts/addons/io_scene_spm/__init__.py", line 62, in execute
    import_spm.loadSPM(context, **keywords)
  File "/home/zaqraven/.config/blender/4.0/scripts/addons/io_scene_spm/import_spm.py", line 260, in loadSPM
    material = create_material(tex_fname_1, tex_fname_2, tex_name_1, tex_name_2)
  File "/home/zaqraven/.config/blender/4.0/scripts/addons/io_scene_spm/import_spm.py", line 40, in create_material
    principled_node.inputs["Specular"].default_value = 0
KeyError: 'bpy_prop_collection[key]: key "Specular" not found'
ernugrahaDev commented 7 months ago

Maybe because not supported on blender 4.0

ernugrahaDev commented 7 months ago

i just happen like that

ZAQraven commented 6 months ago
File "/home/zaqraven/.config/blender/4.0/scripts/addons/io_scene_spm/import_spm.py", line 40, in create_material
    principled_node.inputs["Specular"].default_value = 0
KeyError: 'bpy_prop_collection[key]: key "Specular" not found'

As the release notes of Blender 4.0 was written:

Specular reflection and transmission are now primarily controlled by a single index of refraction input. For texturing, a new IOR Level input adjusts the amount of specular reflection. For artistic purposes, specular tint be can set to an arbitrary color.

To avoid import failure, change 'Specular' to 'Metallic' in line 40.