From df4a7fabe33daf580e20c15eb70d2ad34c60e47d Mon Sep 17 00:00:00 2001 From: Quicksticks-oss Date: Sun, 7 Apr 2024 22:16:25 -0400 Subject: [PATCH] Added object_name --- .../datastructures/clips/clip_ui.ts | 4 + app/pages/PageEnigma/js/editor.ts | 2 +- app/pages/PageEnigma/js/timeline.ts | 97 +------------------ .../proxy/storyteller_proxy_timeline.ts | 1 + 4 files changed, 10 insertions(+), 94 deletions(-) diff --git a/app/pages/PageEnigma/datastructures/clips/clip_ui.ts b/app/pages/PageEnigma/datastructures/clips/clip_ui.ts index f771f9910c..ed8c279265 100644 --- a/app/pages/PageEnigma/datastructures/clips/clip_ui.ts +++ b/app/pages/PageEnigma/datastructures/clips/clip_ui.ts @@ -9,6 +9,7 @@ export class ClipUI { name: string; media_id: string; object_uuid: string; + object_name: string; offset: number; // in frames length: number; // in frames should_play: boolean; @@ -20,6 +21,7 @@ export class ClipUI { name: string, media_id: string, object_uuid: string, + object_name: string, offset: number, length: number, ) { @@ -30,6 +32,7 @@ export class ClipUI { this.type = type; // UI and Animation / Audio / Lipsync / : Engine this.object_uuid = object_uuid; // Animation / Audio / Lipsync / : Engine + this.object_name = object_name; this.media_id = media_id; // Animation / Audio / Lipsync / : Engine this.offset = offset; this.length = length; @@ -43,6 +46,7 @@ export class ClipUI { name: this.name, type: this.type, object_uuid: this.object_uuid, + object_name: this.object_name, media_id: this.media_id, start_offset: this.offset, ending_offset: this.length, diff --git a/app/pages/PageEnigma/js/editor.ts b/app/pages/PageEnigma/js/editor.ts index c4f0cf9e18..af0707f0b9 100644 --- a/app/pages/PageEnigma/js/editor.ts +++ b/app/pages/PageEnigma/js/editor.ts @@ -311,7 +311,7 @@ class Editor { this.timeline.scene = this.activeScene; - //this._test_demo(); + this._test_demo(); this.renderer.domElement.addEventListener( "mousedown", diff --git a/app/pages/PageEnigma/js/timeline.ts b/app/pages/PageEnigma/js/timeline.ts index dc9072efe2..96188daefe 100644 --- a/app/pages/PageEnigma/js/timeline.ts +++ b/app/pages/PageEnigma/js/timeline.ts @@ -195,6 +195,7 @@ export class TimeLine { object_name, "", uuid, + object_name, 0, this.absolute_end)) } @@ -216,6 +217,7 @@ export class TimeLine { const type = data["data"]["type"]; const offset = data["data"]["offset"]; const end_offset = data["data"]["length"] + offset; + const object_name = data["data"]["object_name"]; switch (type) { case "animation": @@ -236,6 +238,7 @@ export class TimeLine { name, media_id, object_uuid, + object_name, offset, end_offset)); return; @@ -254,6 +257,7 @@ export class TimeLine { name, media_id, object_uuid, + object_name, offset, end_offset, ), @@ -481,96 +485,3 @@ export class TimeLine { } } -// How much timeline precision we have -//const percision = 100 // using a fake update loop mock -// -//class AudioEngineMock { -// async play(media_id:string) { -// console.log("Audio Playing {media_id}") -// } -//} -// -//// Visual verification tests. -//function CheckIfBasicAudioClipWorks() { -// const timeline = new TimeLine() -// timeline.addPlayableClip(new ClipUI(1.0,'audio',1,0)) -// timeline.play() -//} -// -//function CheckIfBasicTransformClipWorks() { -// const timeline = new TimeLine() -// timeline.addPlayableClip(new ClipUI(1.0,'transform',2,0)) -// timeline.play() -//} -// -//function CheckIfBasicClipWorks() { -// const timeline = new TimeLine() -// timeline.addPlayableClip(new ClipUI(1.0,'animation',3,0)) -// timeline.play() -//} - -// function CheckIfBasicClipWorks3SecondsAfterTimelineStops() { -// const timeline = new TimeLine() -// timeline.addPlayableClip(new ClipUI("clip1", 0, 10000)) -// timeline.play() -// } - -// function CheckIfTwoClipsAtTheSameTimeWorks() { -// const timeline = new TimeLine() -// timeline.addPlayableClip(new ClipUI("clip1", 0, 1000)) -// timeline.play() -// } - -// function CheckIfTwoClipsOneAfterAnotherWorks() { -// const timeline = new TimeLine() -// timeline.addPlayableClip(new ClipUI("clip1", 0, 1000)) -// timeline.addPlayableClip(new ClipUI("clip2", 0, 2000)) -// timeline.play() -// } - -// function CheckIfTimeLineStopBeforeClipPlays() { -// const timeline = new TimeLine() -// timeline.addPlayableClip(new ClipUI("clip3",0,1000)) -// timeline.play() -// setInterval(async ()=> { -// timeline.stop() -// },1100) -// console.log("Stopped") -// } - -// function CheckIfTimeLineStartAfterClipPlays() { -// const timeline = new TimeLine() -// timeline.addPlayableClip(new ClipUI("clip3",0,1000)) -// timeline.play() -// setInterval(async ()=> { -// timeline.stop() -// },500) -// console.log("Stopped") -// } - -// function CheckIfClipsPlayAllTogetherConcurrently() { -// const timeline = new TimeLine() -// timeline.addPlayableClip(new ClipUI("clip1",0,1000)) -// timeline.addPlayableClip(new ClipUI("clip2",0,1000)) -// timeline.addPlayableClip(new ClipUI("clip3",0,1000)) -// timeline.addPlayableClip(new ClipUI("clip4",0,1000)) -// timeline.play() -// } - -// function CheckIfClipsPlayAllTogether() { -// const timeline = new TimeLine() -// timeline.addPlayableClip(new TrackClip("clip1",0,1000)) -// timeline.addPlayableClip(new TrackClip("clip2",0,1000)) -// timeline.addPlayableClip(new TrackClip("clip3",0,1000)) -// timeline.addPlayableClip(new TrackClip("clip4",0,1000)) -// timeline.play() -// } - -//CheckIfBasicClipWorks() -//CheckIfTwoClipsAtTheSameTimeWorks() -// CheckIfTwoClipsOneAfterAnotherWorks() -// CheckIfTimeLineStopBeforeClipPlays() -// CheckIfTimeLineStartAfterClipPlays() -// CheckIfClipsPlayAllTogetherConcurrently() - -// CheckIfClipsPlayAllTogether() diff --git a/app/pages/PageEnigma/proxy/storyteller_proxy_timeline.ts b/app/pages/PageEnigma/proxy/storyteller_proxy_timeline.ts index e5cb72ff2a..2133951979 100644 --- a/app/pages/PageEnigma/proxy/storyteller_proxy_timeline.ts +++ b/app/pages/PageEnigma/proxy/storyteller_proxy_timeline.ts @@ -65,6 +65,7 @@ export class StoryTellerProxyTimeline { element.version, element.type, element.group, element.name, element.media_id, element.object_uuid, + element.object_name, element.start_offset, element.ending_offset); new_clips.push(clip); }