Skip to content

Commit d977143

Browse files
committed
🪩 Remove cubes associated with texture function
1 parent f14e38e commit d977143

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ globalThis.AnimatedJava = {
102102
exportProject,
103103
openBlueprintLoadingDialog,
104104
openInstallPopup,
105+
removeCubesAssociatedWithTexture(texture: Texture) {
106+
const cubes = Cube.all.filter(cube =>
107+
Object.values(cube.faces).some(face => face.texture === texture.uuid)
108+
)
109+
Undo.initEdit({ elements: cubes, outliner: true, textures: [texture] })
110+
cubes.forEach(cube => cube.remove())
111+
texture.remove()
112+
Undo.finishEdit('Remove Cubes Associated With Texture')
113+
},
105114
},
106115
}
107116

0 commit comments

Comments
 (0)