Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions editor/src/editor/layout/animation/timeline/timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export class EditorAnimationTimelinePanel extends Component<IEditorAnimationTime
});

registerUndoRedo({
object: this.props.animatable,
executeRedo: true,
undo: () => {
tracks.forEach((track, index) => {
Expand Down
3 changes: 3 additions & 0 deletions editor/src/editor/layout/animation/timeline/track.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export class EditorAnimationTimelineItem extends Component<IEditorAnimationTimel
}

registerUndoRedo({
object: this.props.animatable,
executeRedo: true,
undo: () => {
const index = this.props.animation.getKeys().indexOf(key);
Expand All @@ -138,6 +139,7 @@ export class EditorAnimationTimelineItem extends Component<IEditorAnimationTimel
});

registerUndoRedo({
object: this.props.animatable,
executeRedo: true,
undo: () => {
animationsKeyConfigurationsToMove.forEach((configurations) => {
Expand Down Expand Up @@ -172,6 +174,7 @@ export class EditorAnimationTimelineItem extends Component<IEditorAnimationTimel
}

registerUndoRedo({
object: this.props.animatable,
executeRedo: true,
undo: () => keys.splice(index, 0, key),
redo: () => keys.splice(index, 1),
Expand Down
2 changes: 2 additions & 0 deletions editor/src/editor/layout/animation/tracks/tracks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export class EditorAnimationTracksPanel extends Component<IEditorAnimationTracks
]);

registerUndoRedo({
object: animatable,
undo: () => {
const index = animatable.animations?.indexOf(animation) ?? -1;
if (index !== -1) {
Expand Down Expand Up @@ -139,6 +140,7 @@ export class EditorAnimationTracksPanel extends Component<IEditorAnimationTracks
}

registerUndoRedo({
object: animatable,
executeRedo: true,
undo: () => {
animatable.animations?.splice(index, 0, animation);
Expand Down
1 change: 1 addition & 0 deletions editor/src/editor/layout/cinematic/curves/handle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export function CinematicEditorCurveHandle(props: ICinematicEditorCurveHandlePro
const newInTangent = props.nextEditableTangentProperty ? getEditablePropertyValue(props.nextEditableTangentProperty) : null;

registerUndoRedo({
object: props.cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
if (oldOutTangent !== null && props.editableTangentProperty) {
Expand Down
1 change: 1 addition & 0 deletions editor/src/editor/layout/cinematic/curves/point.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export function CinematicEditorPropertyPoint(props: ICinematicEditorPropertyPoin
const newValue = getEditablePropertyValue(props.editableProperty);

registerUndoRedo({
object: props.cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
action: () => {
props.cinematicEditor.cinematic.tracks.forEach((track) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export function CinematicEditorBaseEventKeyInspector(props: ICinematicEditorBase
const oldData = props.cinematicKey.data;

registerUndoRedo({
object: props.cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => (props.cinematicKey.data = oldData),
redo: () => {
Expand Down
1 change: 1 addition & 0 deletions editor/src/editor/layout/cinematic/inspector/key-cut.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function CinematicEditorKeyCutInspector(props: ICinematicEditorKeyCutInsp
newValue = newValue.clone?.() ?? newValue;

registerUndoRedo({
object: props.cinematicEditor.editor.layout.preview.scene,
executeRedo: false,
action: () => {
props.cinematicEditor.updateTracksAtCurrentTime();
Expand Down
1 change: 1 addition & 0 deletions editor/src/editor/layout/cinematic/inspector/key.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function CinematicEditorKeyInspector(props: ICinematicEditorKeyInspectorP
newValue = newValue.clone?.() ?? newValue;

registerUndoRedo({
object: props.cinematicEditor.editor.layout.preview.scene,
executeRedo: false,
action: () => {
props.cinematicEditor.updateTracksAtCurrentTime();
Expand Down
4 changes: 4 additions & 0 deletions editor/src/editor/layout/cinematic/timelines/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export function addAnimationKey(
} as ICinematicKeyCut);

registerUndoRedo({
object: cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
const index = keyFrameAnimations.indexOf(key);
Expand Down Expand Up @@ -139,6 +140,7 @@ export function addSoundKey(cinematicEditor: CinematicEditor, track: ICinematicT
} as ICinematicSound;

registerUndoRedo({
object: cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
const index = track.sounds!.indexOf(key);
Expand Down Expand Up @@ -179,6 +181,7 @@ export function addEventKey(cinematicEditor: CinematicEditor, track: ICinematicT
} as ICinematicKeyEvent;

registerUndoRedo({
object: cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
const index = track.keyFrameEvents!.indexOf(key);
Expand Down Expand Up @@ -221,6 +224,7 @@ export function addAnimationGroupKey(cinematicEditor: CinematicEditor, track: IC
} as ICinematicAnimationGroup;

registerUndoRedo({
object: cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
const index = track.animationGroups!.indexOf(key);
Expand Down
1 change: 1 addition & 0 deletions editor/src/editor/layout/cinematic/timelines/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export function registerKeysMovedUndoRedo(cinematicEditor: CinematicEditor, anim
});

registerUndoRedo({
object: cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
animationsKeyConfigurationsToMove.forEach((trackConfiguration) => {
Expand Down
4 changes: 4 additions & 0 deletions editor/src/editor/layout/cinematic/timelines/remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function removeAnimationKey(cinematicEditor: CinematicEditor, track: ICin
}

registerUndoRedo({
object: cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
if (keyFrameAnimationsIndex !== -1) {
Expand Down Expand Up @@ -53,6 +54,7 @@ export function removeSoundKey(cinematicEditor: CinematicEditor, track: ICinemat
}

registerUndoRedo({
object: cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => track.sounds!.splice(index, 0, soundKey),
redo: () => track.sounds!.splice(index, 1),
Expand All @@ -68,6 +70,7 @@ export function removeEventKey(cinematicEditor: CinematicEditor, track: ICinemat
}

registerUndoRedo({
object: cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => track.keyFrameEvents!.splice(index, 0, eventKey),
redo: () => track.keyFrameEvents!.splice(index, 1),
Expand All @@ -83,6 +86,7 @@ export function removeAnimationGroupKey(cinematicEditor: CinematicEditor, track:
}

registerUndoRedo({
object: cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => track.animationGroups!.splice(index, 0, animationGroup),
redo: () => track.animationGroups!.splice(index, 1),
Expand Down
1 change: 1 addition & 0 deletions editor/src/editor/layout/cinematic/timelines/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function transformKeyAs(cinematicEditor: CinematicEditor, cinematicKey: I
}

registerUndoRedo({
object: cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
Object.keys(cinematicKey).forEach((key) => {
Expand Down
2 changes: 2 additions & 0 deletions editor/src/editor/layout/cinematic/tracks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export class CinematicEditorTracks extends Component<ICinematicEditorTracksProps
const cinematic = this.props.cinematicEditor.cinematic;

registerUndoRedo({
object: this.props.cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
const index = cinematic.tracks.indexOf(track);
Expand All @@ -198,6 +199,7 @@ export class CinematicEditorTracks extends Component<ICinematicEditorTracksProps
}

registerUndoRedo({
object: this.props.cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
cinematic.tracks.splice(index, 0, track);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function CinematicEditorAnimationGroupTrack(props: ICinematicEditorAnimat
const oldAnimationGroup = props.track.animationGroup;

registerUndoRedo({
object: props.cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => (props.track.animationGroup = oldAnimationGroup),
redo: () => (props.track.animationGroup = animationGroup),
Expand Down
2 changes: 2 additions & 0 deletions editor/src/editor/layout/cinematic/tracks/property.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export function CinematicEditorPropertyTrack(props: ICinematicEditorPropertyTrac
const oldKeyFrameAnimations = props.track.keyFrameAnimations;

registerUndoRedo({
object: props.cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
props.track.node = oldNode;
Expand Down Expand Up @@ -155,6 +156,7 @@ export function CinematicEditorPropertyTrack(props: ICinematicEditorPropertyTrac
const oldKeyFrameAnimations = props.track.keyFrameAnimations;

registerUndoRedo({
object: props.cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
props.track.propertyPath = oldPropertyPath;
Expand Down
1 change: 1 addition & 0 deletions editor/src/editor/layout/cinematic/tracks/sound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function CinematicEditorSoundTrack(props: ICinematicEditorSoundTrackProps
const oldSounds = props.track.sounds;

registerUndoRedo({
object: props.cinematicEditor.editor.layout.preview.scene,
executeRedo: true,
undo: () => {
props.track.sound = oldSound;
Expand Down
Loading