Keys carry an easing for the span to the next key: linear, step, ease in, ease out, ease in-out (#101)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c92a9478f
commit
b278605c53
7 files changed
+331
-27
No files matched your search
@@ -18,7 +18,7 @@ import {
|
||||
} from '../graph';
|
||||
import { isParticleNodeDef } from '../particles/nodes';
|
||||
import { isShaderNodeDef } from '../shader/nodes';
|
||||
import { normalizeKeys } from '../model/animation';
|
||||
import { isKeyInterpolation, normalizeKeys } from '../model/animation';
|
||||
import type { AnimationKey, AnimationTrack, Asset, StateMachineAsset, TextureFrame } from '../model/Asset';
|
||||
import { isAssetType } from '../model/AssetTypes';
|
||||
import { isFontFile } from '../model/font';
|
||||
@@ -473,7 +473,11 @@ function normalizeTracks(raw: unknown): AnimationTrack[] {
|
||||
const key = asRecord(k);
|
||||
const frame = Number(key.frame);
|
||||
if (!Number.isFinite(frame) || !isPrimitive(key.value)) continue;
|
||||
keys.push({ frame, value: key.value });
|
||||
const kept: AnimationKey = { frame, value: key.value };
|
||||
// `linear` is what no field means, so it is not kept; an unknown one reads as linear, too.
|
||||
if (isKeyInterpolation(key.interpolation) && key.interpolation !== 'linear')
|
||||
kept.interpolation = key.interpolation;
|
||||
keys.push(kept);
|
||||
}
|
||||
const track: AnimationTrack = { id: t.id, target, property: t.property, keys: normalizeKeys(keys) };
|
||||
if (t.relative === true) track.relative = true;
|
||||
|
||||
Reference in new issue
Block a user