-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tightening up animations #704
Comments
More animation stuff:
Maybe it's useful to allow some output accessors to have less elements than |
I think whether it's called The constraint of time values being monotonically increasing is already pointed out for (One could consider requiring it to be strictly monotonic. Handling the special case of EDIT: I mean, what should
actually mean? I.e. what should the |
In that case we should demand all samplers to use the same
I've overlooked it, thanks.
I'd say it otherwise: we should forbid such case or define exact behavior (like always use last output value). |
Do you mean for the examples?
Yes, please open a PR into master.
Looking at the Cesium implementation, I don't think it requires this to be named
The suggestion is to change the wording from "monotonically increasing" to "increasing", right? I think that is fine unless there is a real use case for several key frames to have the same time. |
I mean that
Do you propose to state that |
+1 from me.
Yes, so the name could be something else, but it follows the "time" semantic. |
Consider this example: {
"animations" : {
"an_animation": {
"channels": [
{
"sampler": "a_sampler",
"target": {
"id": "node_id",
"path": "rotation",
},
},
{
"sampler": "b_sampler",
"target": {
"id": "node_id",
"path": "scale",
},
}
],
"parameters": {
"TIME_a": "time_accessor_a",
"TIME_b": "time_accessor_b",
"rotation": "rotation_accessor",
"scale": "scale_accessor"
},
"samplers": {
"a_sampler": {
"input": "TIME_a",
"interpolation": "LINEAR",
"output": "rotation"
},
"b_sampler": {
"input": "TIME_b",
"interpolation": "LINEAR",
"output": "scale"
}
}
}
}
} Is it valid? Otherwise all |
A bit more general question: why do we need |
I think it would be "strictly increasing", as of https://en.wikipedia.org/wiki/Monotonic_function#Monotonicity_in_calculus_and_analysis Regarding the proposal to require |
With disabled interpolation, it will be possible to animate integer properties and even enums (such as switching textures). For
|
Looks like some time ago |
I thought about the time constraints again
Yes, this makes more sense. Imagine someone wants to model
When
When
So I think that there is no need to change the current wording/spec regarding this point. It should still be Regarding the |
So, do you mean this?
|
Also, time values sequence can nor begin with equal values, neither end with them. |
Yes, I think that these constraints make sense. Unambiguously and compactly describing all this in the spec is a bit fiddly, keeping in mind the inherent ambiguitiy that is imposed by
And still, the last sentence sounds fuzzy.... In general, in the implementation, one has to look up a start- and an end index for a given time to find the interpolation interval. I just played a bit with my current implementation (which does not support equal keys yet), and one indeed has to be careful EDIT The wording in the
but of course, it's manageable once the constraints and intended meaning are clear. |
One more corner case (if multiple inputs are allowed): Also, if different samplers can have different inputs, |
I don't think this makes sense, having two possible values for the same time. One object cannot be at two different positions at the same time. Regards, -- Rémi
|
@javagl proposes to treat this as a special case: |
The problem obviously is that you would see artifacts at 5.005 in the second example. If this is not considered an issue, or there is a different solution, then that's fine.
That sounds reasonable. (Right now, I don't see any constraints on the |
It's mentioned in readme, not in schemes. |
@lexaknyazev please let me know if I missed answering any questions above. I have reviewed the Cesium implementation a bit (I wrote it a few years ago, and I'm not saying that it is the spec authority, but it may give some insight into how we intended things):
If this constraint doesn't limit common use cases, I think it is fine. It could make the client implementation a tad easier. The Cesium implementation currently allows each time input to be separate (not sure that case has been tested though).
It would be a prominent breaking change from 1.0 to 1.0.1 to remove this, so we would have to confirm with @tparisi and Neil, but I am also not sure what purpose they serve at this point. |
Also:
This is OK with me; the Cesium implementation explicitly checks for this. |
Different sampling rate of each target could be better for filesize. We still need to demand equal |
I am also OK with this and think the filesize case is a good point. |
This one
And jumps handling: |
No, to keep the client simple. |
I am still not following the solution to the special case; it sounds like the client is supposed to add an epsilon to |
Please review language in #712. |
Looks fine for me. ("Different channels must have different targets": One could now start (or, admittedly: continue) nitpicking and arguing whether this refers to a single animation, or globally to all animations, or how much flexibility should be allowed here. As far as I see, right now, there's nothing to prevent two animations from animating the same node property - and in fact, that would be OK, as long as the time spans that are covered by the inputs of every animation channel target are disjoint over all animations...) |
Same targets within one animation must be definitely forbidden. |
@lexaknyazev could you please make this more explicit as part of #712? |
Strict |
Do we have any implementation guideline on animations start (such as "always play everything", or "play only on-demand")? |
Do you think that is something glTF can explicitly define? I think it is too dependent on the model to make a general rule. |
If we allow overlapping keyframe inputs with the same target, it's inevitable. Otherwise we can state that behavior is undefined in such case. |
I'm not 100% sure, but looks like three.js is one of them: |
@tparisi can you confirm @lexaknyazev or can we test with a sample model? |
Is this related to auto start all animations or not? Seems like a separate issue that we could disallow. |
Let's say we have two animations with the same target and overlapping (or even exact) timeranges. Since we allow different inputs, there is no need in multiple |
Just tested with three.js own format: ( {
"type": "vector3",
"interpolation": 2300, // <-- InterpolateDiscrete const
"keys": [/* data */],
"name": "cylinder.position"
} |
I don't think the glTF spec can require that an engine start animations even if there is only one animation. It depends on the application. For example, if the only animation for an aircraft is to lower its landing gear, we would want to start that at a specific app simulation time even if it is time "0" in the local asset timeline. |
OK, if this is in three.js, let's go with it. |
Does it mean that "reference" behavior is to not auto-start any animation? |
It would mean to do whatever the application wants. Mac Preview, for example, will play all the animations when you double click a COLLADA file. Visual Studio (IIRC) will not. I just don't think the asset format spec can define this for all types of assets and apps. |
My question was about "preview" behavior. |
Cesium animates by default because many of our models want that (propellers on aircrafts, wheels on trucks, etc.), but I do not think that Cesium's behavior is the behavior for all apps. Have you checked other 3D formats? I suspect none of them define to play the animations on load or not. An asset has a local animation timeline and it is up to the application to map that to the application's timeline, which, for example, may be paused on load. |
Sorry, maybe I'm overlooking something here, but: Isn't the question about the auto-start similar to the question of "which camera is active by default"? It's solely controlled by the app, and no information about this is contained in the glTF... Beyond that, I'm rather with Patrick here: The animation timeline somehow has to be "embedded" into a global timeline, and this should be in the responsibility of the application. In fact, this may already raise many questions. Imagine an app that loads 2 glTFs. The first glTF contains an animation that starts at "10 seconds". The second glTF contains an animation that starts at "20 seconds", but is loaded 5 seconds after the first one - for me it's not clear what the behavior should be here, and think that it could be difficult (and dangerously constraining) to impose requirements here. |
Think of gltf-emoji example. How should a random glTF asset embedded into webpage behave (e.g., HTML5 audio/video elements have |
For gltf-emoji, they may play by default or even pass the option on to the user. This is really outside the scope of the spec; if we try to impose something I'm sure that apps will ignore it so that they can get the behavior they specifically need. |
Fine. |
See 1209c51. |
Updated in #826 |
Specify
componentType
for animation accessors (suggest onlyFLOAT
).Remove
count
from example.To be more explicit,
could be changed to something like
CC @pjcozzi @javagl @lasalvavida
The text was updated successfully, but these errors were encountered: