Merge pull request #80 from storytold/feature/camera-timeline-movement

Fixed timeline camera.
This commit is contained in:
ArEnSc authored and GitHub committed 2024-04-03 18:48:21 -04:00
commit 70b5552428
2 files changed
+13 -15

No files matched your search

+13 -6
View File
@@ -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);
-9
View File
@@ -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"];