There is the use case: I have a GLB file containing multiple animations named as
filename.glb#Animation{i}
where i starts with 0 and keeps incrementing. For example, if the glb file has 30 animations then in order to load them into a Vec, we have to do something like
#[derive(AssetCollection, Resource)]
pub struct Animations {
#[asset(
paths(
"models/explosion.glb#Animation0",
"models/explosion.glb#Animation1",
"models/explosion.glb#Animation2",
"models/explosion.glb#Animation3",
"models/explosion.glb#Animation4",
"models/explosion.glb#Animation5",
"models/explosion.glb#Animation6",
"models/explosion.glb#Animation7",
"models/explosion.glb#Animation8",
"models/explosion.glb#Animation9",
"models/explosion.glb#Animation10",
"models/explosion.glb#Animation11",
"models/explosion.glb#Animation12",
"models/explosion.glb#Animation13",
"models/explosion.glb#Animation14",
"models/explosion.glb#Animation15",
"models/explosion.glb#Animation16",
"models/explosion.glb#Animation17",
"models/explosion.glb#Animation18",
"models/explosion.glb#Animation19",
"models/explosion.glb#Animation20",
"models/explosion.glb#Animation21",
"models/explosion.glb#Animation22",
"models/explosion.glb#Animation23",
"models/explosion.glb#Animation24",
"models/explosion.glb#Animation25",
"models/explosion.glb#Animation26",
"models/explosion.glb#Animation27",
"models/explosion.glb#Animation28",
"models/explosion.glb#Animation29",
),
collection(typed)
)]
pub explosion: Vec<Handle<AnimationClip>>,
}
This works, but it's very tedious and error prone to manually constructs the paths array.
It would be great if we can add some path_pattern support. Maybe something like the following
#[asset(paths_pattern("filename.glb#Animation{}", 0..30), collection(typed)]
There is the use case: I have a GLB file containing multiple animations named as
where
istarts with 0 and keeps incrementing. For example, if the glb file has 30 animations then in order to load them into aVec, we have to do something likeThis works, but it's very tedious and error prone to manually constructs the
pathsarray.It would be great if we can add some
path_patternsupport. Maybe something like the following#[asset(paths_pattern("filename.glb#Animation{}", 0..30), collection(typed)]