fix: texture mapping in JuiceBox and node deletion bug in hierarchy
Build and Deploy / build-and-push (push) Failing after 20s
Build and Deploy / build-and-push (push) Failing after 20s
This commit is contained in:
+14
-1
@@ -1715,7 +1715,20 @@ export default function Editor() {
|
||||
};
|
||||
|
||||
const deleteObjects = () => {
|
||||
updateSceneObjects(prev => prev.filter(obj => !selectedIds.includes(obj.id)));
|
||||
updateSceneObjects(prev => {
|
||||
let idsToDelete = [...selectedIds];
|
||||
let added = true;
|
||||
while (added) {
|
||||
added = false;
|
||||
prev.forEach(obj => {
|
||||
if (obj.parentId && idsToDelete.includes(obj.parentId) && !idsToDelete.includes(obj.id)) {
|
||||
idsToDelete.push(obj.id);
|
||||
added = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
return prev.filter(obj => !idsToDelete.includes(obj.id));
|
||||
});
|
||||
setSelectedIds([]);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user