emissive_color - sequences of dimension 0 should contain 4 items, not 5
See original GitHub issueDescribe the bug
Blender crashes on file
To Reproduce Steps to reproduce the behavior:
- Open glb file
- See error
Expected behavior Load the glb correctly.
.blend file/ .gltf
Version
- OS: linux
- Blender Version 2.81 and https://github.com/KhronosGroup/glTF-Blender-IO/pull/857
Additional context
Should be:
else:
emissive_color = pymaterial.emissive_factor
if len(emissive_color) == 3:
emissive_color.append(1.0) # add alpha
emit.inputs[0].default_value = emissive_color
Stack Trace:
bpy.context.space_data.recent_folders_active = 0
Traceback (most recent call last):
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/__init__.py", line 919, in execute
return self.import_gltf2(context)
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/__init__.py", line 933, in import_gltf2
if self.unit_import(path, import_settings) == {'FINISHED'}:
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/__init__.py", line 956, in unit_import
BlenderGlTF.create(self.gltf_importer)
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py", line 40, in create
BlenderScene.create(gltf)
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_scene.py", line 43, in create
BlenderNode.create_vnode(gltf, 'root')
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 45, in create_vnode
BlenderNode.create_vnode(gltf, child)
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 45, in create_vnode
BlenderNode.create_vnode(gltf, child)
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 45, in create_vnode
BlenderNode.create_vnode(gltf, child)
[Previous line repeated 1 more time]
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 35, in create_vnode
BlenderNode.create_object(gltf, vnode_id)
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 53, in create_object
obj = BlenderNode.create_mesh_object(gltf, pynode, name=vnode.name)
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_node.py", line 178, in create_mesh_object
mesh = BlenderMesh.create(gltf, pynode.mesh, pynode.skin)
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py", line 57, in create
BlenderMaterial.create(gltf, prim.material, vertex_color)
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_material.py", line 96, in create
BlenderEmissiveMap.create(gltf, material_idx, vertex_color, factor_only=True)
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_map_emissive.py", line 30, in create
BlenderEmissiveMap.create_nodetree(gltf, material_idx, vertex_color, factor_only)
File "/home/fedora/Documents/blender-tools/addons/io_scene_gltf2/blender/imp/gltf2_blender_map_emissive.py", line 83, in create_nodetree
emit.inputs[0].default_value = emissive_color
ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 4 items, not 5
location: <unknown location>:-1
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Why does 'diffuse_color' expect four values and not three with ...
These values may stay from 0.0 to 1.0 if the color is interpreted as diffuse. Other wise, it doesn't need to less than...
Read more >bpy_struct: item.attr = val: sequences of dimension 0 should ...
I have a fix for this and Blender > 2.8 errors. I opened a PR for this: #3 you could give it a...
Read more >T71232 X3D Import does not handle Materials
When an X3D file is imported and that file has a Material tag no corresponding ... item.attr = val: sequences of dimension 0...
Read more >Appearance, Material, and Textures - ScienceDirect
This chapter discusses material coloring, transparency, and texturing. Materials apply a variety of colors and shading parameters to make the appearance ...
Read more >Use blender change material color with python - Stack Overflow
It looks like you're modifying the existing "carpaint.Black" material, which would affect all objects using that material.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the help.
Here’s a cool screenshot.
Ha, I figured. I just thought it was funny 😃