Clear scene and timeline using newScene. (#262)

This commit is contained in:
Miles Ryan authored and GitHub committed 2024-04-27 18:11:52 -04:00
1 parent 2278ec1848
commit db4f980215
2 files changed
+28

No files matched your search

+22
View File
@@ -441,6 +441,28 @@ class Editor {
loadingBarIsShowing.value = false;
}
public async newScene(){
this.activeScene.clear();
this.audio_engine = new AudioEngine();
this.emotion_engine = new EmotionEngine(this.version);
this.transform_engine = new TransformEngine(this.version);
this.lipsync_engine = new LipSyncEngine();
this.animation_engine = new AnimationEngine(this.version);
this.timeline = new TimeLine(
this,
this.audio_engine,
this.transform_engine,
this.lipsync_engine,
this.animation_engine,
this.emotion_engine,
this.activeScene,
this.camera,
this.mouse,
this.camera_name,
);
}
// Token comes in from the front end to load the scene from the site.
public async testBatchRequest() {
const result = await this.api_manager.getMediaBatch([
+6
View File
@@ -50,6 +50,12 @@ class Scene {
this._create_camera_obj();
}
clear() {
this.scene.children.forEach(child => {
this.scene.remove(child);
});
}
instantiate(name: string, pos: THREE.Vector3 = new THREE.Vector3(0, 0, 0)) {
const material = new THREE.MeshPhongMaterial({ color: 0xdacbce });
material.shininess = 0.0;