kaosat-dev / Blenvy

Bevy Code & Blender addon for a simple workflow to add & edit Bevy components in Blender
Other
520 stars 45 forks source link

Support for Seperate Gltf files for animations? #226

Open xx1adfasd opened 1 month ago

xx1adfasd commented 1 month ago

For example, suppose I have 20 different character rigged models with the same skeleton, all using same set of animations. (For example, if I want to make a game like Baldur's Gate which has many humanoid races) It's obvious that put the animations in separate glb file(s) (which is/are of course, exported from the separate blender file(s)) is a more efficient way.

How would blenvy handle this situation? I think currently blenvy only support animation along with the model in the same file right?

kaosat-dev commented 1 month ago

Good point ! Currently Blenvy does indeed export the animations along with the model. I will have to think a bit more about how to do this, but something similar to the process outlined here should be possible. (I did a quick manual gltf export test, and inspecting the gltf file, the data seems coherent).

I am not sure how Bevy would handle this: have you tried loading animations from separate gltf before ?

I think each "animation" file would have to be based on the Blender object containing the animations. So if you have a "animated_humanoid" object with a rig + animations, Blenvy could export it to "animations/animation_animated_humanoid.gltf"

It would be relatively trivial to implement, IF

xx1adfasd commented 1 month ago

I didn't try loading animations from separate gltf before, but I do have seen another project has done that. It's not hard and is only a normal bevy code. In project https://github.com/projectharmonia/project_harmonia/tree/master , you can see a folder app/assets/base/actors and in this folder you'll see a folder with only model gltf inside and a folder with only animation gltf files inside.

Yeah I think the implementation will not be hard as we actually know all the required skills and knowledge.