Skip to content

Commit

Permalink
Fix keyframes not moving with object + Move child objs while dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
nahkd123 committed Oct 2, 2024
1 parent ee02028 commit ac0b1e3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions nahara-motion-ui/src/ui/timeline/TimelineTrack.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,20 @@
// Hold shift to ignore keyframes
if (!e.shiftKey) {
const animatedProps: IAnimatable<any>[] = (object.object.properties as any[])
.filter(v => !v["isSimple"])
.filter(v => (v as IAnimatable<any>).animated);
const animatedProps: IAnimatable<any>[] = object.object.properties
.filter(v => v instanceof AnimatableObjectProperty && v.animatable.animated)
.map(v => (v as AnimatableObjectProperty<any>).animatable);
for (const prop of animatedProps) {
for (const kf of [...prop]) prop.modify(kf, { time: kf.time + deltaTime });
}
if ((object.object as ISceneContainerObject).isContainer) {
for (const child of (object.object as ISceneContainerObject)) {
child.timeStart += deltaTime;
child.timeEnd += deltaTime;
}
}
}
dispatcher("update", object);
Expand Down

0 comments on commit ac0b1e3

Please sign in to comment.