added animation for fox and audio

This commit is contained in:
Quicksticks-oss committed 2024-04-03 00:41:37 -04:00
1 parent ec1d4e76d6
commit 74a2d4d326
2 files changed
+43 -10

No files matched your search

+3 -4
View File
@@ -344,8 +344,6 @@ class Editor {
);
}
console.log(this.cam_obj);
this.dispatchAppUiState({
type: APPUI_ACTION_TYPES.UPDATE_EDITOR_LOADINGBAR,
payload: {
@@ -519,7 +517,7 @@ class Editor {
async _serialize_timeline() {
// note the database from the server is the source of truth for all the data.
// Test code here
const object: any = await this.activeScene.load_glb(
const object: THREE.Object3D = await this.activeScene.load_glb(
"./resources/models/fox/fox.glb",
);
@@ -649,9 +647,10 @@ class Editor {
async _test_demo() {
// note the database from the server is the source of truth for all the data.
// Test code here
const object: any = await this.activeScene.load_glb(
const object: THREE.Object3D = await this.activeScene.load_glb(
"./resources/models/fox/fox.glb",
);
object.uuid = "CH1";
// Load timeline creates the the clips from the datastructure and loads them in here.
// load object into the engine for lip syncing
+40 -6
View File
@@ -173,12 +173,13 @@ export class TimeLine {
public async addClip(data: any) {
let object_uuid = data["data"]["object_uuid"];
if (object_uuid.length < 6) {
object_uuid = this.scene.selected?.uuid; //data['data']['object_uuid'];
if (object_uuid == undefined) {
return;
}
}
// 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"];
@@ -209,6 +210,12 @@ export class TimeLine {
case "transform":
this.transform_engine.loadObject(object_uuid, data["data"]["length"]);
break;
case "audio":
this.audio_engine.loadClip(media_id);
break;
case "lipsync":
this.lipSync_engine.load_object(object_uuid, media_id);
break;
}
}
@@ -228,6 +235,33 @@ export class TimeLine {
public async updateClip(data: any) {
// only length and offset changes here.
console.log(data);
return;
let object_uuid = data["data"]["object_uuid"];
const media_id = data["data"]["media_id"];
const name = data["data"]["name"];
const group = data["data"]["group"];
const version = data["data"]["group"];
const type = data["data"]["type"];
const offset = data["data"]["offset"];
const end_offset = data["data"]["length"] + offset;
switch (type) {
case "animation":
this.animation_engine.clips[object_uuid]
break;
//case "transform":
// this.transform_engine.loadObject(object_uuid, data["data"]["length"]);
// break;
//case "audio":
// this.audio_engine.loadClip(media_id);
// break;
//case "lipsync":
// this.lipSync_engine.load_object(object_uuid, media_id);
// break;
}
}
public async deleteClip(data: any) {
console.log(data);