Fixed deletion of objects still having transform engine point artifacts. (#293)

![image](https://github.com/storytold/GottaGoFast/assets/75916236/629abdf6-bae8-439a-8ac8-3657fb9f6fec)
This commit is contained in:
Miles Ryan authored and GitHub committed 2024-05-01 18:10:54 -04:00
1 parent 354aa0a084
commit 7cd9a573c2
3 files changed
+10 -3

No files matched your search

+2 -1
View File
@@ -740,13 +740,14 @@ class Editor {
deleteObject(uuid: string) {
const obj = this.activeScene.get_object_by_uuid(uuid);
this.removeTransformControls();
if (obj?.name === this.camera_name) {
return;
}
if (obj) {
this.activeScene.scene.remove(obj);
}
this.removeTransformControls();
this.timeline.deleteObject(uuid);
Queue.publish({
queueName: QueueNames.FROM_ENGINE,
action: fromEngineActions.DELETE_OBJECT,
+2 -2
View File
@@ -127,14 +127,14 @@ class Scene {
}
deletePoint(keyframe_uuid: string) {
this.scene.traverse((object) => {
this.scene.children.forEach(object => {
if (object.userData.media_id) {
const obj_keyframe_uuid = object.userData.media_id.replace(
"Point::",
"",
);
console.log(obj_keyframe_uuid);
if (obj_keyframe_uuid === keyframe_uuid) {
console.log("FOUNDDDD", obj_keyframe_uuid);
console.log("Found!", object);
this.scene.remove(object);
return;
+6
View File
@@ -370,6 +370,12 @@ export class TimeLine {
if (object?.name === this.camera_name) {
return;
}
this.timeline_items.forEach(element => {
if(element.type == ClipType.TRANSFORM && element.object_uuid == object_uuid){
console.log(element)
this.scene.deletePoint(element.clip_uuid);
}
});
this.timeline_items = this.timeline_items.filter(
(element) => element.object_uuid !== object_uuid,
);