Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLTF compatibility between v0.5.0 and Wings3D 2.2.25 #2133

Closed
dvogel opened this issue May 9, 2021 · 2 comments
Closed

GLTF compatibility between v0.5.0 and Wings3D 2.2.25 #2133

dvogel opened this issue May 9, 2021 · 2 comments
Labels
A-Assets Load files from disk to use for things like images, models, and sounds A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior

Comments

@dvogel
Copy link

dvogel commented May 9, 2021

Bevy version

v0.5.0

Operating system & version

Debian/testing

What you did

  1. Ran cargo run --example load_gltf -- observed helmet rendered in the window.
  2. Opened Wings3D
  3. Imported FlightHelmet.gltf into the scene.
  4. Exported the scene back to FlightHelmet.gltf
  5. Ran cargo run --example load_gltf -- observed segfault without the model being rendered in the window.

What you expected to happen

I'm hopeful for full Wings3D compatibility but I'll settle for a more actionable error and controlled crash when the file cannot be loaded.

What actually happened

Segfault. Here's a backtrace:

$ RUST_BACKTRACE=1 cargo run --example load_gltf
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/examples/load_gltf`
thread 'Compute Task Pool (0)' panicked at 'Attribute Vertex_Tangent is required by shader, but not supplied by mesh. Either remove the attribute from the shader or supply the attribute (Vertex_Tangent) to the mesh.', crates/bevy_render/src/pipeline/pipeline_compiler.rs:231:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/std/src/panicking.rs:493:5
   1: std::panicking::begin_panic_fmt
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/std/src/panicking.rs:435:5
   2: bevy_render::pipeline::pipeline_compiler::PipelineCompiler::compile_pipeline
             at ./crates/bevy_render/src/pipeline/pipeline_compiler.rs:231:17
   3: bevy_render::draw::DrawContext::set_pipeline
             at ./crates/bevy_render/src/draw.rs:200:13
   4: bevy_render::pipeline::render_pipelines::draw_render_pipelines_system
             at ./crates/bevy_render/src/pipeline/render_pipelines.rs:147:13
   5: core::ops::function::Fn::call
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/ops/function.rs:70:5
   6: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &F>::call_mut
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/ops/function.rs:247:13
   7: <Func as bevy_ecs::system::into_system::SystemParamFunction<(),Out,(F0,F1,F2,F3,F4),()>>::run
             at ./crates/bevy_ecs/src/system/into_system.rs:207:21
   8: <bevy_ecs::system::into_system::FunctionSystem<In,Out,Param,Marker,F> as bevy_ecs::system::system::System>::run_unsafe
             at ./crates/bevy_ecs/src/system/into_system.rs:147:19
   9: bevy_ecs::schedule::executor_parallel::ParallelExecutor::prepare_systems::{{closure}}
             at ./crates/bevy_ecs/src/schedule/executor_parallel.rs:200:30
  10: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/future/mod.rs:80:19
  11: async_executor::Executor::spawn::{{closure}}
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:144:13
  12: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/future/mod.rs:80:19
  13: async_task::raw::RawTask<F,T,S>::run
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/raw.rs:489:20
  14: async_task::runnable::Runnable::run
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/runnable.rs:309:18
  15: async_executor::Executor::run::{{closure}}::{{closure}}
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:235:21
  16: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/future/mod.rs:80:19
  17: <futures_lite::future::Or<F1,F2> as core::future::future::Future>::poll
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.11.3/src/future.rs:529:33
  18: async_executor::Executor::run::{{closure}}
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:242:9
  19: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/future/mod.rs:80:19
  20: futures_lite::future::block_on::{{closure}}
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.11.3/src/future.rs:89:27
  21: std::thread::local::LocalKey<T>::try_with
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/std/src/thread/local.rs:376:16
  22: std::thread::local::LocalKey<T>::with
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/std/src/thread/local.rs:352:9
  23: futures_lite::future::block_on
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.11.3/src/future.rs:79:5
  24: bevy_tasks::task_pool::TaskPool::new_internal::{{closure}}::{{closure}}
             at ./crates/bevy_tasks/src/task_pool.rs:139:25
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at 'task has failed', /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/task.rs:368:45
stack backtrace:
   0: rust_begin_unwind
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/panicking.rs:92:14
   2: core::option::expect_failed
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/option.rs:1241:5
   3: core::option::Option<T>::expect
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/option.rs:349:21
   4: <async_task::task::Task<T> as core::future::future::Future>::poll
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/task.rs:368:43
   5: bevy_tasks::task_pool::TaskPool::scope::{{closure}}::{{closure}}
             at ./crates/bevy_tasks/src/task_pool.rs:194:38
   6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/future/mod.rs:80:19
   7: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/future/future.rs:120:9
   8: async_executor::LocalExecutor::spawn::{{closure}}
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:376:13
   9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/future/mod.rs:80:19
  10: async_task::raw::RawTask<F,T,S>::run
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/raw.rs:489:20
  11: async_task::runnable::Runnable::run
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.0.3/src/runnable.rs:309:18
  12: async_executor::Executor::try_tick
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:181:17
  13: async_executor::LocalExecutor::try_tick
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:405:9
  14: bevy_tasks::task_pool::TaskPool::scope::{{closure}}
             at ./crates/bevy_tasks/src/task_pool.rs:223:21
  15: std::thread::local::LocalKey<T>::try_with
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/std/src/thread/local.rs:376:16
  16: std::thread::local::LocalKey<T>::with
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/std/src/thread/local.rs:352:9
  17: bevy_tasks::task_pool::TaskPool::scope
             at ./crates/bevy_tasks/src/task_pool.rs:169:9
  18: <bevy_ecs::schedule::executor_parallel::ParallelExecutor as bevy_ecs::schedule::executor::ParallelSystemExecutor>::run_systems
             at ./crates/bevy_ecs/src/schedule/executor_parallel.rs:121:9
  19: <bevy_ecs::schedule::stage::SystemStage as bevy_ecs::schedule::stage::Stage>::run
             at ./crates/bevy_ecs/src/schedule/stage.rs:822:17
  20: bevy_ecs::schedule::Schedule::run_once
             at ./crates/bevy_ecs/src/schedule/mod.rs:201:13
  21: <bevy_ecs::schedule::Schedule as bevy_ecs::schedule::stage::Stage>::run
             at ./crates/bevy_ecs/src/schedule/mod.rs:219:21
  22: bevy_app::app::App::update
             at ./crates/bevy_app/src/app.rs:58:9
  23: bevy_winit::winit_runner_with::{{closure}}
             at ./crates/bevy_winit/src/lib.rs:485:17
  24: winit::platform_impl::platform::sticky_exit_callback
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/mod.rs:736:5
  25: winit::platform_impl::platform::x11::EventLoop<T>::run_return
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/x11/mod.rs:303:17
  26: winit::platform_impl::platform::x11::EventLoop<T>::run
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/x11/mod.rs:398:9
  27: winit::platform_impl::platform::EventLoop<T>::run
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/mod.rs:652:56
  28: winit::event_loop::EventLoop<T>::run
             at /home/dvogel/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/event_loop.rs:154:9
  29: bevy_winit::run
             at ./crates/bevy_winit/src/lib.rs:171:5
  30: bevy_winit::winit_runner_with
             at ./crates/bevy_winit/src/lib.rs:493:9
  31: bevy_winit::winit_runner
             at ./crates/bevy_winit/src/lib.rs:211:5
  32: core::ops::function::Fn::call
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/ops/function.rs:70:5
  33: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/alloc/src/boxed.rs:1589:9
  34: bevy_app::app::App::run
             at ./crates/bevy_app/src/app.rs:68:9
  35: bevy_app::app_builder::AppBuilder::run
             at ./crates/bevy_app/src/app_builder.rs:49:9
  36: load_gltf::main
             at ./examples/3d/load_gltf.rs:4:5
  37: core::ops::function::FnOnce::call_once
             at /rustc/770792ff8d1ec542e78e77876ac936f43ffb8e05/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Segmentation fault

You can see the changes Wings3D made to the GLTF file and the extra PNG files it exported here: dvogel@c01100e

@dvogel dvogel added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 9, 2021
@alice-i-cecile alice-i-cecile added A-Assets Load files from disk to use for things like images, models, and sounds A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels May 9, 2021
@bjorn3
Copy link
Contributor

bjorn3 commented May 9, 2021

Duplicate of #121 I think. There is a draft PR: #1795.

@dvogel
Copy link
Author

dvogel commented May 9, 2021

This is definitely a duplicate of #121. Using the blender steps outlined in that ticket's comment history allows me to load the model. I've also tested the #1795 branch and it allows me to load the Wings3D-exported model without the blender steps.

@dvogel dvogel closed this as completed May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

3 participants