Closed BMaxV closed 4 months ago
I misunderstood how the animation system works in panda.
I think it's working as intended right now. So the "bug" and the non compliance doesn't make much sense.
What happens internally is that there is a table that the e.g. position values x_i
are taken from, for any point in time t_i
. We can then adjust how fast this fully predetermined animation plays in the engine. If the original animation was defined for 2 seconds and 24 fps and we play for 4 seconds, at 60 fps, that's where interpolation happens. Personally, that kind of solution smells to me, but I don't have data to back up that it's bad and it's out of scope for this issue and possible for the import module. We need to discuss first if we even want to make a change to the animation system to have that functionality at all. After that comes worrying about imports.
Anyway, back on topic: the gltf files that do work are those where all the animation curves are interpolated.
That means gltf isn't "fully supported" because there are valid files that this module and panda can't load.
Thanks go to entikan in particular, he explained it to me yesterday.
It could be a feature request for panda3d-gltf to handle the sampling/interpolation.
I think it would also be a valid feature request for Panda3D to support this natively.
Hello,
as discussed on discord
I looked at some GLTF sample/test files.
You suggested to open a new issue for each broken file, I don't think that's reasonable for now. It's probably a better idea to pick one of the broken ones and open a new issue when you're working on it. Otherwise it's just spam.
Of the 7 files I tested, only the "AnimatedMorphCube.glb" worked, everything either didn't load, or didn't animate.
Some of the test files also didn't load animate in blender, which I used as a comparison. No idea how the webviewer works, that may not be comparable.
The versions I used were:
panda3d 1.10.14 panda3d-gltf 1.2.0 panda3d-simplepbr 4.11.0
This loads but doesn't animate, does work in blender
source
this just worked.
source
AnimatedTriangle.gltf
does not work but the error trace ends with something relating to simplepbr, so this may not be a problem with gltf. Doesn't work in blender.
source
This did not work, but it did work in blender.
source
CesiumMan.glb
Does load, and does animate but the animation is broken. Issues with axis transformation maybe? Works fine in blender.
I copied some of the gltf viewer code to get some printouts.
InterpolationTest.glb
did not work and did not work in blender either
source
Doesn't load, same pbr problem as above.
source
Loads in the script but doesn't animate, does not load with gltf-viewer. Does work in blender, includes a rigg so that maybe a good idea to start with this one.
source
if there is anything else I can do, let me know.