From 7a9f0d0d39496a8ad312825118edd79877bf64f4 Mon Sep 17 00:00:00 2001 From: Quicksticks-oss Date: Sat, 30 Mar 2024 16:15:19 -0400 Subject: [PATCH] fixed timeline scene reset & camera view selection. --- app/pages/PageEnigma/datastructures/clips/lipsync_clip.ts | 5 +++++ app/pages/PageEnigma/js/editor.ts | 4 +++- app/pages/PageEnigma/js/timeline.ts | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/pages/PageEnigma/datastructures/clips/lipsync_clip.ts b/app/pages/PageEnigma/datastructures/clips/lipsync_clip.ts index a06808e72c..6ad94b7fbf 100644 --- a/app/pages/PageEnigma/datastructures/clips/lipsync_clip.ts +++ b/app/pages/PageEnigma/datastructures/clips/lipsync_clip.ts @@ -113,6 +113,11 @@ step() { } reset() { + if (this.lipsync.face != undefined) { + this.lipsync.face.morphTargetInfluences[this.blendshape_helper.ee] = 0; + this.lipsync.face.morphTargetInfluences[this.blendshape_helper.ah] = 0 + this.lipsync.face.morphTargetInfluences[this.blendshape_helper.oh] = 0; + } this.lipsync = new LipSync(); } diff --git a/app/pages/PageEnigma/js/editor.ts b/app/pages/PageEnigma/js/editor.ts index d3cf25bb24..fd66db210a 100644 --- a/app/pages/PageEnigma/js/editor.ts +++ b/app/pages/PageEnigma/js/editor.ts @@ -512,11 +512,12 @@ class Editor { if (this.cameraViewControls) { this.cameraViewControls.enabled = true; } - + this.cam_obj.scale.set(0,0,0); if (this.activeScene.hot_items) { this.activeScene.hot_items.forEach((element) => { element.visible = false; }); + } } else { this.camera.position.copy(this.last_cam_pos); @@ -530,6 +531,7 @@ class Editor { if (this.cameraViewControls) { this.cameraViewControls.enabled = false; } + this.cam_obj.scale.set(1,1,1); if (this.activeScene.hot_items) { this.activeScene.hot_items.forEach((element) => { element.visible = true; diff --git a/app/pages/PageEnigma/js/timeline.ts b/app/pages/PageEnigma/js/timeline.ts index 6873675c84..d025ed5084 100644 --- a/app/pages/PageEnigma/js/timeline.ts +++ b/app/pages/PageEnigma/js/timeline.ts @@ -130,6 +130,7 @@ export class TimeLine { this.audio_engine.loadClip(element.media_id); } else if (element.type == "animation") { + this.animation_engine.clips[element.object_uuid].stop(); } else if (element.type == "lipsync") { this.lipSync_engine.clips[element.object_uuid].reset(); @@ -199,6 +200,10 @@ export class TimeLine { this.stop() } } + + if (this.scrubber_frame_position >= this.timeline_limit) { + await this.resetScene(); + } } private async stop(): Promise {