raysan5 / raylib

A simple and easy-to-use library to enjoy videogames programming
http://www.raylib.com
zlib License
22.58k stars 2.27k forks source link

[rmodels] GLB Animation plays incorrectly. #4327

Closed IoIxD closed 1 month ago

IoIxD commented 1 month ago

Issue description

The animation from my GLB file plays with incorrect proportions, shown below. I made an MRE that almost exactly copy/pastes code from the example, and can reproduce the issue. I asked about this in the Discord and somebody said that because I made this in Blender, I need to remove all modifiers. But that can't be right (or it is something that needs to be solved) because an armature modifier is required to make animations in Blender. Removing it before export removes animations.

Environment

OS: Fedora Linux 40 (Xfce) x86_64 Host: 20BX001AUS ThinkPad T450s Kernel: 6.10.9-200.fc40.x86_64 CPU: Intel i5-5300U (4) @ 2.900GHz GPU: Intel HD Graphics 5500 Memory: 11833MiB

Issue Screenshot

https://github.com/user-attachments/assets/0b5abca1-c066-42ea-8806-e4ecb2f7fd0f

Code Example

I have a minimal example of the code (+ the model and .blend file itself) here: https://gist.github.com/IoIxD/ee521a47fd1f2a9bb42ac1c78ef3da6a

raysan5 commented 1 month ago

@IoIxD Note glTF file format is quite complex with many configuration options and not all the options are supported by raylib. Feel free to review the code and send a PR with a fix.

IoIxD commented 1 month ago

What other formats does Raylib support thay support animation

raysan5 commented 1 month ago

@IoIxD m3d and iqm.

IoIxD commented 1 month ago

Yeah I say leave this open for anybody else - wants to take a crack at this but I'm just gonna use one of the formats you suggested.

Shame too, I liked glb for its integrated textures.

raysan5 commented 1 month ago

@IoIxD Ok, I'll leave it open for 3 months, if nobody is ready to work on it in that time this issue will be closed.

HarryDC commented 1 month ago

Just some triage, could reproduce the issue with the model from the gist, i could not reproduce the issue with another model i had. Also oddly i can't seem to be able to reexport the paul model from blender with animations attached, but i don't know enough but animations in blender to know what the issue could be

raysan5 commented 1 month ago

@HarryDC Definitely it can be an issue with the model and how the animations are exported. I'm afraid I'm closing this issue as raylib can not support all possible glTF configurations, it's out of scope.