From ed1d944e0e4f851cfd1d90c8b2c68bda0fd9cdbb Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Sat, 19 Jul 2025 14:38:49 -0400 Subject: [PATCH] [3d] remove unnecessary uploadTexture (#4357) --- src/components/load3d/Load3D.vue | 25 -------- src/components/load3d/Load3DControls.vue | 6 -- src/components/load3d/Load3DScene.vue | 3 - .../load3d/controls/ModelControls.vue | 40 ------------ src/extensions/core/load3d.ts | 4 -- .../core/load3d/Load3DConfiguration.ts | 6 -- src/extensions/core/load3d/Load3d.ts | 17 ------ src/extensions/core/load3d/ModelManager.ts | 61 ------------------- 8 files changed, 162 deletions(-) diff --git a/src/components/load3d/Load3D.vue b/src/components/load3d/Load3D.vue index 8129a0f9a..36d3eec0d 100644 --- a/src/components/load3d/Load3D.vue +++ b/src/components/load3d/Load3D.vue @@ -55,7 +55,6 @@ @update-up-direction="handleUpdateUpDirection" @update-material-mode="handleUpdateMaterialMode" @update-edge-threshold="handleUpdateEdgeThreshold" - @upload-texture="handleUploadTexture" @export-model="handleExportModel" />
{ node.properties['Background Image'] = backgroundImage.value } -const handleUploadTexture = async (file: File) => { - if (!load3DSceneRef.value?.load3d) { - useToastStore().addAlert(t('toastMessages.no3dScene')) - return - } - - try { - const resourceFolder = (node.properties['Resource Folder'] as string) || '' - - const subfolder = resourceFolder.trim() - ? `3d/${resourceFolder.trim()}` - : '3d' - - const texturePath = await Load3dUtils.uploadFile(file, subfolder) - - await load3DSceneRef.value.load3d.applyTexture(texturePath) - - node.properties['Texture'] = texturePath - } catch (error) { - console.error('Error applying texture:', error) - useToastStore().addAlert(t('toastMessages.failedToApplyTexture')) - } -} - const handleUpdateFOV = (value: number) => { fov.value = value diff --git a/src/components/load3d/Load3DControls.vue b/src/components/load3d/Load3DControls.vue index 1d884a54e..ce7588a01 100644 --- a/src/components/load3d/Load3DControls.vue +++ b/src/components/load3d/Load3DControls.vue @@ -51,7 +51,6 @@ @update-up-direction="handleUpdateUpDirection" @update-material-mode="handleUpdateMaterialMode" @update-edge-threshold="handleUpdateEdgeThreshold" - @upload-texture="handleUploadTexture" /> () const backgroundColor = ref(props.backgroundColor) @@ -232,10 +230,6 @@ const handleUpdateEdgeThreshold = (value: number) => { emit('updateEdgeThreshold', value) } -const handleUploadTexture = (file: File) => { - emit('uploadTexture', file) -} - const handleUpdateLightIntensity = (value: number) => { emit('updateLightIntensity', value) } diff --git a/src/components/load3d/Load3DScene.vue b/src/components/load3d/Load3DScene.vue index b9d385143..d7c7dcae1 100644 --- a/src/components/load3d/Load3DScene.vue +++ b/src/components/load3d/Load3DScene.vue @@ -69,9 +69,6 @@ const eventConfig = { exportLoadingEnd: () => { loadingOverlayRef.value?.endLoading() }, - textureLoadingStart: () => - loadingOverlayRef.value?.startLoading(t('load3d.applyingTexture')), - textureLoadingEnd: () => loadingOverlayRef.value?.endLoading(), recordingStatusChange: (value: boolean) => emit('recordingStatusChange', value) } as const diff --git a/src/components/load3d/controls/ModelControls.vue b/src/components/load3d/controls/ModelControls.vue index 19f4e999a..ac320dddf 100644 --- a/src/components/load3d/controls/ModelControls.vue +++ b/src/components/load3d/controls/ModelControls.vue @@ -59,32 +59,6 @@
-
- -
-