From ae426df24029f9ae61260e8681e10a0b8117ad4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Mon, 21 Sep 2026 15:11:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=A1=E5=9E=8B=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=99=A8=E8=87=AA=E5=8A=A8=E6=97=8B=E8=BD=AC=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=8F=AF=E8=83=BD=E5=81=9C=E5=9C=A8=E6=97=A7=E5=80=BC?= =?UTF-8?q?=20-=20=E5=9C=BA=E6=99=AF=E5=88=9B=E5=BB=BA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20effect=20=E5=BC=80=E5=A7=8B=E6=97=B6=E7=9A=84=20autoRotateRe?= =?UTF-8?q?f.current=EF=BC=8C=E5=8A=A0=E8=BD=BD=E6=9C=9F=E9=97=B4=20prop?= =?UTF-8?q?=20=E5=8F=98=E5=8C=96=E6=97=B6=20setAutoRotate=20=E7=9A=84=20ef?= =?UTF-8?q?fect=20=E5=9B=A0=20sceneRef=20=E4=B8=BA=E7=A9=BA=E8=A2=AB?= =?UTF-8?q?=E4=B8=A2=E5=BC=83=20-=20=E5=9C=BA=E6=99=AF=E5=B0=B1=E7=BB=AA?= =?UTF-8?q?=E5=90=8E=E6=8C=89=E6=9C=80=E6=96=B0=E7=9A=84=20autoRotateRef.c?= =?UTF-8?q?urrent=20=E9=87=8D=E6=96=B0=E5=90=8C=E6=AD=A5=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E6=97=8B=E8=BD=AC=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=8E=20prop=20=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/model3d-viewer/src/Model3DViewer.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/model3d-viewer/src/Model3DViewer.tsx b/packages/model3d-viewer/src/Model3DViewer.tsx index 1528dde02..c9978abbe 100644 --- a/packages/model3d-viewer/src/Model3DViewer.tsx +++ b/packages/model3d-viewer/src/Model3DViewer.tsx @@ -116,6 +116,9 @@ export function Model3DViewer({ } createdScene = scene; sceneRef.current = scene; + // 场景创建期间 autoRotate 可能已经变过,而那时 sceneRef 还是空的, + // 只靠 setAutoRotate 的 effect 会丢掉这次更新,所以这里补一次最新值。 + scene.setAutoRotate(autoRotateRef.current); reportStatus('ready', {}); }) .catch((error: unknown) => {