question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

emissive_color - sequences of dimension 0 should contain 4 items, not 5

See original GitHub issue

Describe the bug

Blender crashes on file

To Reproduce Steps to reproduce the behavior:

  1. Open glb file
  2. See error

Expected behavior Load the glb correctly.

.blend file/ .gltf

Version

Additional context

https://github.com/KhronosGroup/glTF-Blender-IO/blob/2ad329e0fdf89803c09df686ca866ee6782542d0/addons/io_scene_gltf2/blender/imp/gltf2_blender_map_emissive.py#L80-L84

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:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
firecommented, Jan 5, 2020

Thanks for the help.

image

Here’s a cool screenshot.

image

0reactions
scurestcommented, Jan 6, 2020

Ha, I figured. I just thought it was funny 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found