godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.05k stars 21.18k forks source link

Importing GLTF 2.0 from blender to Godot not working #16910

Closed maikramer closed 6 years ago

maikramer commented 6 years ago

Godot version:

3.1.dev.custom_build.mono.575c61d (Today), but tried with 3.0 stable

OS/device including version:

Ubuntu 18.04 and Mesa-git

Issue description:

Trying to export from blender to gltf without sucess, tried everything the two exporters available, khronos and kupoman, i always get the same errors, exported with collada, working ok, then there is nothing wrong with my model.

GLTF file attached. nave2originalv3.zip

Console messages:

ERROR: mesh_add_surface: Condition ' !(p_format & VisualServer::ARRAY_FORMAT_VERTEX) ' is true. At: drivers/gles3/rasterizer_storage_gles3.cpp:2672. ERROR: instance_set_surface_material: Index p_surface=0 out of size (instance->materials.size()=0) At: servers/visual/visual_server_scene.cpp:604. ERROR: mesh_surface_get_primitive_type: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3300. node 0: (mesh:0), (name:Ship), (rotation:[0, 0, 0, 1]), (scale:[1, 1, 1]), (translation:[0, 0, 0]) node 1: (children:[0]), (matrix:[1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1]), (name:Scene_root) ERROR: get_file_as_array: Condition ' !f ' is true. returned: Vector() At: core/os/file_access.cpp:538. total buffers: 1 total buffer views: 3 total accessors: 3 on mesh: 0 accessor offset0 view offset: 0 total buffer len: 0 view len 94464 ERROR: _decode_buffer_view: Condition ' (int)(offset + buffer_end) > buffer.size() ' is true. returned: ERR_PARSE_ERROR At: editor/import/editor_scene_importer_gltf.cpp:511. accessor offset0 view offset: 94464 total buffer len: 0 view len 94464 ERROR: _decode_buffer_view: Condition ' (int)(offset + buffer_end) > buffer.size() ' is true. returned: ERR_PARSE_ERROR At: editor/import/editor_scene_importer_gltf.cpp:511. accessor offset0 view offset: 188928 total buffer len: 0 view len 22660 ERROR: _decode_buffer_view: Condition ' (int)(offset + buffer_end) > buffer.size() ' is true. returned: ERR_PARSE_ERROR At: editor/import/editor_scene_importer_gltf.cpp:511. ERROR: mesh_add_surface_from_arrays: Condition ' array_len == 0 ' is true. At: servers/visual_server.cpp:835. ERROR: add_surface_from_arrays: Condition ' len == 0 ' is true. At: scene/resources/mesh.cpp:775. total meshes: 1 node: Scene Root node: Scene_root node: Ship SAVING TO: res://.import/nave2smooth4.gltf-49c103bcbb24b2cbd60d5211b81f44fe.scn ERROR: mesh_surface_get_array: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3236. ERROR: mesh_surface_get_array_len: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3219. ERROR: mesh_surface_get_index_array: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3261. ERROR: mesh_surface_get_array_index_len: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3227. ERROR: mesh_surface_get_primitive_type: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3300. ERROR: mesh_surface_get_format: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3291. ERROR: mesh_surface_get_aabb: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3309. ERROR: mesh_surface_get_skeleton_aabb: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3348. ERROR: mesh_surface_get_blend_shapes: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3317. ERROR: mesh_surface_get_array: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3236. ERROR: mesh_surface_get_array_len: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3219. ERROR: mesh_surface_get_index_array: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3261. ERROR: mesh_surface_get_array_index_len: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3227. ERROR: mesh_surface_get_primitive_type: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3300. ERROR: mesh_surface_get_format: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3291. ERROR: mesh_surface_get_aabb: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3309. ERROR: mesh_surface_get_skeleton_aabb: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3348. ERROR: mesh_surface_get_blend_shapes: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3317. MUST RELOAD? 1 ERROR: mesh_add_surface: Condition ' !(p_format & VisualServer::ARRAY_FORMAT_VERTEX) ' is true. At: drivers/gles3/rasterizer_storage_gles3.cpp:2672. ERROR: instance_set_surface_material: Index p_surface=0 out of size (instance->materials.size()=0) At: servers/visual/visual_server_scene.cpp:604. ERROR: mesh_surface_get_primitive_type: Index p_surface=0 out of size (mesh->surfaces.size()=0) At: drivers/gles3/rasterizer_storage_gles3.cpp:3300.

Steps to reproduce: Export a model to GLTF 2.0 using blender 2.79 with Khronos git exporter. Import to godot.

Minimal reproduction project:

maikramer commented 6 years ago

Pull request #17622 fixed this issue. Working Almost perfectly, but, point light should be imported as omnilight and Camera is imported as a simple spatial. BUT, works perfectly now, thanks.