Conversation
catilac
left a comment
There was a problem hiding this comment.
-
When getting a named node off of the geometry we have to use
gltf_geometry(g, name)
it would be really nice if there was some canonical way where if someone was to load a model we can determine which node is the parent and use thatnameautomagically -
this is a gltf implementation question, so this is simply loading the texture we want to use to render the particular gltf node
-
it is lovely that gltf is loaded, and working with gltf is exactly how we work with every other geometry
-
in regards to transforms and parents: doesn't bevy manage this type of geometric hierarchy automatically?
i'm imagining bevy's gltf loader is taking advantage of this. but i might not be understanding the comment entirelyo -
i'm obsessed with the camera removal in
load. It makes sense why, but it is a fun fact for me. -
gltf camera is different from bevy camera? gltf camera is the camera node that gltf has part of its spec? yes.
Adds GLTF support via Bevy's scene loading mechanisms
This is a little sketchy but mostly works. Right now, we support creating a GLTF scene via
load_gltf. This API object is just a container for the underlying Bevy scene and by default doesn't have any impact on the sketch.The user can then "request" meshes or materials via GLTF node name, in which case we will clone out the relevant data and return the respective
GeometryorMaterialAPI object. There's some careful work that needs to be done here to ensure that we keep the correct transform data for the mesh in the event it was parented in the GLTF hierarchy.Users can also retrieve lights by index (lights have no name in GLTF). They can also call
gltf.camerato update theGraphicstransform to match the GLTF camera found at that index. This leaves a little bit to be desired from an API perspective and should be iterated on.I'll leave an explanation of Bevy's scene mechanics to your exploration. Note, some of these mechanics are likely changing soon with BSN.
Long term, I think we want to consider what APIs look like for this kind of scene data with deep transform hierarchies. For example, right now we require explicitly pulling each item out of the scene you want to render, but perhaps it would make sense to render an entire scene as "static" data and then only have the user pull out the items they want to animate. But other questions remain like, how do we let the user parent new items to this hierarchy? Etc.