glTF icon indicating copy to clipboard operation
glTF copied to clipboard

Mesh sequence animations

Open jjcasmar opened this issue 3 years ago • 4 comments

Does glTF support mesh sequence animations? I have a bunch of N obj files defining an sequence animation that I want to convert to a binary file. In glTF I could theoretically add N morph targets and a step animation for the weights, settings 1 for the current shape and 0 for the rest, but that looks really hacky. Does glTF supports mesh sequence properly?

jjcasmar avatar Jun 18 '22 14:06 jjcasmar

Not specifically. Btw it's better to make separate meshes and step-animate their scale because lots of morph targets may hit the vertex attribute limit. See a workflow for this here.

scurest avatar Jun 18 '22 18:06 scurest

Yeah, completely agree that several morph targets hit the attribute limit. That is why I say its a hacky way of doing it. Using different meshes doesn't seems like a solution neither, as you will be generating several meshes with completely equal index buffer and potentially, if the renderer doesn't do some checks, doing a draw call for each of the meshes.

btw, I just want to use this in Blender. The objs are the results of some physically based simulations and I want to check how the simulation went.

jjcasmar avatar Jun 18 '22 19:06 jjcasmar

You can use whichever workflow, but FWIW the morph target workflow is pretty common and should work fine in most engines. Even in engines with limited morph targets, the limit is often active morph targets, and cycling through 100+ targets one at a time is OK. Example:

https://threejs.org/examples/?q=morph#webgl_morphtargets_horse

donmccurdy avatar Jun 18 '22 20:06 donmccurdy

btw, I just want to use this in Blender. The objs are the results of some physically based simulations and I want to check how the simulation went.

You should take a look at the Alembic format, it's ideal for situations like yours.

RNavega avatar Aug 03 '22 02:08 RNavega

Someone reminded me a few days ago I had a workflow for alembic to gltf.

There's two workflows.

  1. every frame is a different mesh https://github.com/V-Sekai/vsekai-blender-game-tools/blob/main/misc/io_mesh_obj_seq.py
  2. frames can be morph targets / have same vertex order etc. https://gist.github.com/fire/495fb6a35168500df53c002695a1f5fe

fire avatar Nov 28 '22 21:11 fire