At some point during designing filter options (#113), I remember talking about having a checkbox next to "Downloadable" entities for "Animated" entities. Now that the AnimationController is in testing, it might make sense to think about this again?
Implementation Suggestion
The @gltf-transform packages allow reading glTF and glb files to read their scene graph. This also allows reading their animation list. We could use this identify uploaded files which contain animations.
Since Kompakkt/Kompressor already has this package installed, it would be an option to add it there.
The server would need to check all uploaded entities for animations, but this can be done in the background, to save on processing power (or more accurately, run a job which asks Kompressor if a 3D model has animations).
@Grizzly127 @ZetOE do you think this would be a nice addition?
Example code used for testing
import { Document, NodeIO } from "@gltf-transform/core";
import { ALL_EXTENSIONS } from "@gltf-transform/extensions";
import draco3d from "draco3dgltf";
const io = new NodeIO().registerExtensions(ALL_EXTENSIONS).registerDependencies({
"draco3d.decoder": await draco3d.createDecoderModule(), // Optional.
"draco3d.encoder": await draco3d.createEncoderModule(), // Optional.
});
// Read from URL.
const document = await io.readBinary(
await Bun.file("/home/kai/Models/B005_KleinesTheater_A_2K_v03.glb").bytes(),
);
console.log(document.getRoot().listAnimations().at(0));
At some point during designing filter options (#113), I remember talking about having a checkbox next to "Downloadable" entities for "Animated" entities. Now that the
AnimationControlleris in testing, it might make sense to think about this again?Implementation Suggestion
The
@gltf-transformpackages allow readingglTFandglbfiles to read their scene graph. This also allows reading their animation list. We could use this identify uploaded files which contain animations.Since Kompakkt/Kompressor already has this package installed, it would be an option to add it there.
The server would need to check all uploaded entities for animations, but this can be done in the background, to save on processing power (or more accurately, run a job which asks Kompressor if a 3D model has animations).
@Grizzly127 @ZetOE do you think this would be a nice addition?
Example code used for testing