explainers icon indicating copy to clipboard operation
explainers copied to clipboard

mutliple animation takes

Open chrisdubya-emed opened this issue 3 years ago • 5 comments

It's common for models to have multiple animation takes bundled into or referenced within the model file (and they can be cycled through on the fly based on page events, etc). If there are multiple animation takes embedded in the model, would the following autoplay attribute loop through the first animation take that is found?

<model style="width: 400px; height: 300px" autoplay interactive>
    <source src="assets/example.usdz" type="model/vnd.usd+zip">
    <source src="assets/example.obj" type="model/obj">
</model>

I think there should be an attribute for specifying model clips. For reference, <model-viewer> implements this with several different attributes as documented here. A-Frame's animation-mixer-component also does something simialar declaratively.

chrisdubya-emed avatar Aug 31 '21 14:08 chrisdubya-emed

FWIW: Standard practice in glTF viewers is to play the first animation by default, and (ideally) provide some means of selecting others. More complex composition is possible but perhaps out of scope here.

donmccurdy avatar Aug 31 '21 16:08 donmccurdy

I agree, I also think an autoplay boolean is a bit ambiguous in the context of a model. I think at a minimum you should be able to specify another animation other than the first.

chrisdubya-emed avatar Aug 31 '21 17:08 chrisdubya-emed

Perhaps the desired animation could be specified in the element's attribute, then changed dynamically.

spartanatreyu avatar Sep 01 '21 00:09 spartanatreyu

These are great suggestions.

We'll propose a JS API to select animation takes eventually, but an attribute might be a simple start. It does assume that the data format can name the animations.

And I agree that by default it should follow the glTF viewer behaviour of playing the first animation.

grorg avatar Sep 07 '21 22:09 grorg

Agreed with starting with a simple attribute for specifying an animation name (given format support).

Then, I would think that the attribute would only work if the proposed autoplay attribute is present and true (and manually can work through a JS API with a .play() function). It may also be helpful to query for available animations through the JS API.

chrisdubya-emed avatar Sep 08 '21 11:09 chrisdubya-emed