What problem does this solve or what need does it fill?
I have a very simple blender file with a single mesh and multiple materials:
When exporting to GLTF it creates a mesh with multiple primitives:
Bevy creates an entity for the node object and separate entity per each primitive of the mesh (no mesh-specific entity):
There are few problems:
there is no mesh entity at all when multiple primitives are available (there is nothing with 'PlaneMesh' name)
I don't know which primitive contains which material. In case I want to motify some named material, I have to play with scene directly, used entities mapping, it's a boilerplate mess and not ECS friendly.
I can't just query for primitives because their names are generated with indexes.
What solution would you like?
I'd like to add more Name-like components to make querying much easier:
// added to all Gltf node entities
#[derive(Component)]
struct GltfNodeName(Arc<str>);
// added to all Gltf mesh entities (or each primitive when mesh is split into multiple entities)
#[derive(Component)]
struct GltfMeshName(Arc<str>);
// added to all entities that contain Gltf materials
#[derive(Component)]
struct GltfMaterialName(Arc<str>);
// added to all entities associated to a Gltf scene
#[derive(Component)]
struct SceneInstanceNode(InstanceId);
Names are not enough in this case because:
some nodes might have mulitple names (Mesh+Material for example)
name doesn't specify which type of entity we're actually talking about
In such case it will be trivial to find/replace components for any Gltf scene.
What alternative(s) have you considered?
I don't see currently any ECS friendly alternative.
We could also have GltfInstance component attached to the root node that will map entities by type/name but IMHO it is not really ECS way of doing things:
There are 100% better ways to solve this problem but we should improve Gltf usability for sure. Currently it just way to cumbersome and requires huge amount of boilerplate code.
What problem does this solve or what need does it fill?
I have a very simple blender file with a single mesh and multiple materials:
When exporting to GLTF it creates a mesh with multiple primitives:
Bevy creates an entity for the node object and separate entity per each primitive of the mesh (no mesh-specific entity):
There are few problems:
What solution would you like?
I'd like to add more
Name
-like components to make querying much easier:Names are not enough in this case because:
In such case it will be trivial to find/replace components for any Gltf scene.
What alternative(s) have you considered?
I don't see currently any ECS friendly alternative.
We could also have
GltfInstance
component attached to the root node that will map entities by type/name but IMHO it is not really ECS way of doing things:Additional context
This is just a suggestion.
There are 100% better ways to solve this problem but we should improve Gltf usability for sure. Currently it just way to cumbersome and requires huge amount of boilerplate code.