KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.5k stars 319 forks source link

expoet Z-Anatomy to gltf/glb has IndexError: list out of range, this is why? #2367

Closed weili96 closed 1 week ago

weili96 commented 1 month ago

image

weili96 commented 1 month ago

image

julienduroure commented 1 month ago

Hello, As requested in the issue template that you deleted, please provide the .blend file. I can't investigate without it. Thanks!

weili96 commented 1 month ago

https://drive.google.com/drive/folders/18M7IuH2ai2fl21Ud0YH1mSlNEPPmcZzq

weili96 commented 1 month ago

Z-Anatomy_Template.zip, load it into blender of application template, then open a file from it , then export some thing to gltf, but has indexerror

weili96 commented 1 month ago

https://www.z-anatomy.com/

weili96 commented 1 month ago

Python: Traceback (most recent call last): File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2__init.py", line 1288, in execute res = gltf2_blender_export.save(context, export_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 37, in save json, buffer = export(export_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 55, in export gather_gltf(exporter, export_settings) File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 202, in gather_gltf active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather.py", line 31, in gather_gltf2 scenes.append(__gather_scene(blender_scene, export_settings)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 37, in wrapper_cached result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather.py", line 94, in gather_scene node = gltf2_blender_gather_nodes.gather_node( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 48, in gather_node children=gather_children(vnode, export_settings), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 104, in gather_children node = gather_node(c, export_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 48, in gather_node children=gather_children(vnode, export_settings), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 104, in gather_children node = gather_node(c, export_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 42, in gather_node mesh = gather_mesh(vnode, blender_object, export_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_nodes.py", line 335, in __gather_mesh result = gltf2_blender_gather_mesh.gather_mesh(blender_mesh, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 37, in wrapper_cached result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_mesh.py", line 59, in gather_mesh blender_mesh, vertex_groups, modifiers, export_settings), primitives=gather_primitives( ^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_mesh.py", line 136, in gather_primitives return gltf2_blender_gather_primitives.gather_primitives(blender_mesh, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 37, in wrapper_cached result = func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_primitives.py", line 57, in gather_primitives blender_primitives, addional_materials_udim = __gather_cache_primitives( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 37, in wrapper_cached result = func(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_primitives.py", line 140, in gather_cache_primitives blender_primitives, additional_materials_udim, shared_attributes = gltf2_blender_gather_primitives_extract.extract_primitives( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_primitives_extract.py", line 41, in extract_primitives primitive_creator.manage_material_info() # UVMap & Vertex Color ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_primitives_extract.py", line 436, in manage_material_info base_material, material_info = get_base_material(material_idx, self.materials, self.export_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\material\gltf2_blender_gather_materials.py", line 697, in get_base_material material, material_info = gather_material( ^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 37, in wrapper_cached result = func(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\material\gltf2_blender_gather_materials.py", line 89, in gather_material pbr_metallic_roughness, uvmap_info_pbr_metallic_roughness, vc_info, udim_info_prb_mr = gather_pbr_metallic_roughness( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\material\gltf2_blender_gather_materials.py", line 465, in __gather_pbr_metallic_roughness return gltf2_blender_gather_materials_pbr_metallic_roughness.gather_material_pbr_metallic_roughness( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 37, in wrapper_cached result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\material\gltf2_blender_gather_materials_pbr_metallic_roughness.py", line 30, in gather_material_pbr_metallic_roughness base_color_texture, uvmap_info, udim_infobc, = gather_base_color_texture(blender_material, export_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\material\gltf2_blender_gather_materials_pbr_metallic_roughness.py", line 143, in __gather_base_color_texture inputs = tuple( ^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\material\gltf2_blender_gather_materials_pbr_metallic_roughness.py", line 145, in if socket.socket is not None and has_image_node_from_socket(socket, export_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\material\gltf2_blender_search_node_tree.py", line 142, in has_image_node_from_socket result = get_texture_node_from_socket(socket, export_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\gltf2_blender_gather_cache.py", line 37, in wrapper_cached result = func(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\material\gltf2_blender_search_node_tree.py", line 131, in get_texture_node_from_socket result = from_socket( ^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\material\gltf2_blender_search_node_tree.py", line 126, in from_socket return search_from_socket(start_socket.socket, shader_node_filter, [], start_socket.group_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\material\gltf2_blender_search_node_tree.py", line 110, in search_from_socket linked_results = __search_from_socket( ^^^^^^^^^^^^^^^^^^^^^ File "D:\software\blender\4.2\scripts\addons_core\io_scene_gltf2\blender\exp\material\gltf2_blender_search_node_tree.py", line 97, in __search_from_socket socket = [sock for sock in group_path[-1].inputs if sock.name == link.from_socket.name][0]


IndexError: list index out of range
weili96 commented 1 month ago

Hello, As requested in the issue template that you deleted, please provide the .blend file. I can't investigate without it. Thanks!

hi, can have some solution to this problem? thanks very much!

julienduroure commented 1 month ago

I am currently not able to reproduce it on Blender 4.2.2 or current main branch (Blender 4.4 alpha). Do you use some non default option at export?

weili96 commented 1 month ago

I am currently not able to reproduce it on Blender 4.2.2 or current main branch (Blender 4.4 alpha). Do you use some non default option at export?

yes,i only export selected things

weili96 commented 1 month ago

i install 4.4.2 to try, now i am in 4.2.1

weili96 commented 1 month ago

install 4.2.2

weili96 commented 1 month ago

I am currently not able to reproduce it on Blender 4.2.2 or current main branch (Blender 4.4 alpha). Do you use some non default option at export?

when i am in 4.2.2,and default option also has this error ! so i not know what to do and I feel very downhearted

weili96 commented 1 month ago

how are you export ,can you tell me

weili96 commented 1 month ago

image

weili96 commented 1 month ago

I am currently not able to reproduce it on Blender 4.2.2 or current main branch (Blender 4.4 alpha). Do you use some non default option at export?

pleases, i am try may times but alse has this error, can you tell me how you export https://drive.google.com/drive/folders/18M7IuH2ai2fl21Ud0YH1mSlNEPPmcZzq of Z-Anatomy_Template.zip to gltf data, thanks very much.

weili96 commented 1 month ago

I am currently not able to reproduce it on Blender 4.2.2 or current main branch (Blender 4.4 alpha). Do you use some non default option at export?

hi, are you see my need help, i am waiting your replay, pleases!

julienduroure commented 1 month ago

Still not able to reproduce with the 2 provided .blend files on current main

julienduroure commented 1 week ago

Hello, More than a month without any answer, and there is still no clear instruction provided to be able to reproduce the issue. Closing this ticket. If you have more information, please free to comment again