diff --git a/app/pages/PageEnigma/js/editor.ts b/app/pages/PageEnigma/js/editor.ts index cf1d8390af..55e4911521 100644 --- a/app/pages/PageEnigma/js/editor.ts +++ b/app/pages/PageEnigma/js/editor.ts @@ -104,6 +104,8 @@ class Editor { positive_prompt: string; negative_prompt: string; art_style: ArtStyle; + + last_scrub: number; // Default params. constructor() { console.log( @@ -169,6 +171,7 @@ class Editor { this.playback = false; this.playback_location = 0; this.max_length = 10; + this.last_scrub = 0; // Audio Engine Test. this.render_width = 1280; @@ -509,6 +512,7 @@ class Editor { return; } this.last_selected = this.selected; + this.selected = undefined; this.control.detach(); this.activeScene.scene.remove(this.control); this.outlinePass.selectedObjects = []; @@ -840,13 +844,13 @@ class Editor { if (this.cameraViewControls && this.camera_person_mode) { this.cameraViewControls.update(5 * delta_time); - if (this.cam_obj) { - if (this.timeline.is_playing == false) { - this.cam_obj.position.copy(this.camera.position); - this.cam_obj.rotation.copy(this.camera.rotation); - } else { + if(this.cam_obj){ + if (this.last_scrub != this.timeline.scrubber_frame_position) { this.camera.position.copy(this.cam_obj.position); this.camera.rotation.copy(this.cam_obj.rotation); + } else if(this.timeline.is_playing == false) { + this.cam_obj.position.copy(this.camera.position); + this.cam_obj.rotation.copy(this.camera.rotation); } } } @@ -856,10 +860,14 @@ class Editor { this.render_camera.rotation.copy(this.cam_obj.rotation); } + this.updateSelectedUI(); + if(this.timeline.is_playing){ this.timeline.update(); } + this.last_scrub = this.timeline.scrubber_frame_position; + this.renderScene(); } @@ -1283,7 +1291,6 @@ class Editor { } this.activeScene.selected = this.selected; - this.updateSelectedUI(); // this.update_properties() this.activeScene.scene.add(this.control); this.control.attach(this.selected); diff --git a/app/pages/PageEnigma/js/timeline.ts b/app/pages/PageEnigma/js/timeline.ts index 620f3f1511..5fe9e27621 100644 --- a/app/pages/PageEnigma/js/timeline.ts +++ b/app/pages/PageEnigma/js/timeline.ts @@ -172,15 +172,6 @@ export class TimeLine { public async addClip(data: any) { let object_uuid = data["data"]["object_uuid"]; - - // This is for testing for selected object instead of actual object given by timeline. - //if (object_uuid.length < 6) { - // object_uuid = this.scene.selected?.uuid; //data['data']['object_uuid']; - // if (object_uuid == undefined) { - // return; - // } - //} - const media_id = data["data"]["media_id"]; const name = data["data"]["name"]; const group = data["data"]["group"];