An animation is a timeline of rows over one asset, played on an object rather than worn as a picture (#97)
Part (a) of the animation rework: model, commands, saving, runtime and nodes. - AnimationAsset holds a root (sprite, text, container or scene) and rows; a row keys one property of the root or of an object inside it, keys sit on whole frames. - The last key decides the length (its frame counts as a frame of its own). The playhead runs between frames, so numbers and colors blend every tick even at 10 fps; everything else holds. - Playback gains `once-reset`, which puts back what was there before the start. A row can be relative, adding to where its target stood. - Play / Pause / Stop animation act on an object; each instance plays on its own, the later start wins on a shared property, and a behavior writing the same property still writes last. - A sprite no longer wears an animation through `texture`. "Create animation from texture" builds a sprite plus a texture row keyed frame by frame instead. - The Animation tab shows a placeholder until the timeline editor (part b) lands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d3563897d8
commit
193378e6a9
29 files changed
+1194
-1499
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import type { ENTITY_HANDLE } from '../core/graph/NodeContext';
|
||||
import type { AnimationPlayer } from '../core/model/animation';
|
||||
import type { AssetType } from '../core/model/AssetTypes';
|
||||
import type { PropertyBag } from '../core/model/Properties';
|
||||
|
||||
@@ -21,14 +22,8 @@ export interface Entity {
|
||||
props: PropertyBag;
|
||||
/** Parent entity (mirrors `SceneObject.parentId`); children move and die with it. */
|
||||
parent: Entity | null;
|
||||
/** The animation a sprite wears and how far it is; kept out of `props`, which the world writes back. */
|
||||
animation?: AnimationClock;
|
||||
/** The animations playing on this object; kept out of `props`, which the world writes back. */
|
||||
animations?: AnimationPlayer[];
|
||||
/** How often an `Emit` node has restarted this particle source; out of `props` for the same reason. */
|
||||
emits?: number;
|
||||
}
|
||||
|
||||
export interface AnimationClock {
|
||||
id: string;
|
||||
time: number;
|
||||
finished: boolean;
|
||||
}
|
||||
Reference in new issue
Block a user