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 Loader - trouble with blender exports #427

Closed
Dapeos opened this issue Sep 3, 2020 · 8 comments
Closed

GLTF Loader - trouble with blender exports #427

Dapeos opened this issue Sep 3, 2020 · 8 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

@Dapeos
Copy link

Dapeos commented Sep 3, 2020

I must be missing something simple.
I am able to spawn Suzanne and the other gltf files provided in the assets/models folder just fine.

However when I try to use a different gltf file it loads them without error however they do not seem to be rendered.

I have tried gltf files exported from Blender as well as from window's 3D Viewer. I have tried very simple meshes including the default cube and ensured UVs and normals exist. I have tried including a material and not. I have tired adding vertex coloring in case it mattered. I tried every export option I could see.

Not sure what I am missing but if any one has any ideas any help would be appreciated.
Thanks.

@karroffel karroffel added A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Sep 3, 2020
@cart
Copy link
Member

cart commented Sep 4, 2020

The current GLTF loader is pretty limited. It only loads the first mesh it finds. More complex multi-mesh files fill break down (among other things).

Could you attach an example of a cube exported from blender that doesn't load?

@Dapeos
Copy link
Author

Dapeos commented Sep 4, 2020

Thanks cart, included in the zip are two exported cube gltf files from blender 2.9, one using the embedded option and one using the separate assets option.

frames.zip

@cart
Copy link
Member

cart commented Oct 18, 2020

This should largely be resolved by #693

@cart cart closed this as completed Oct 18, 2020
@chaoticgood1
Copy link

Seems like this bug reappear in 0.3, I attach the file which is not showing but no errors.

char1.zip

@rafalp
Copy link

rafalp commented Mar 7, 2021

I'm seeing same problem: I can use blender exported glb file for scene (and it appears then), but if I try something as basic as:

.spawn(PbrBundle {
    mesh: asset_server.load("test.glb"),
    ..Default::default()
})

I don't get anything rendered.

@mockersf
Copy link
Member

mockersf commented Mar 7, 2021

asset_server.load("test.glb")

This load the whole GLB file, not just a mesh

If you're just interested in a mesh, you can target it specifically by adding #Mesh0/Primitive0 after the file name, check this example:

let cube_handle = asset_server.load("models/cube/cube.gltf#Mesh0/Primitive0");

Or if you want to display a whole scene from the file, check this example:

.spawn_scene(asset_server.load("models/FlightHelmet/FlightHelmet.gltf#Scene0"))

@rafalp
Copy link

rafalp commented Mar 8, 2021

Where can I find the definition of the Scene? It sounds to me that scene is an entire level, and I've didn't see on spawn_scene how I can apply any transforms to the loaded data.

Thank you for helping!

@mockersf
Copy link
Member

mockersf commented Mar 8, 2021

to apply a transform on a scene, you can check this example : https://github.com/bevyengine/bevy/blob/main/examples/3d/update_gltf_scene.rs

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

6 participants