Enhance shadow handling and visibility settings across components

This commit is contained in:
2025-07-28 13:05:32 +05:30
parent 10e7f2f8c4
commit 795c69a3d4
6 changed files with 36 additions and 19 deletions

View File

@@ -92,6 +92,17 @@ function Model({ asset }: { readonly asset: Asset }) {
}
}, [asset.modelUuid, ikData])
useEffect(() => {
if (gltfScene) {
gltfScene.traverse((child: any) => {
if (child.isMesh) {
child.castShadow = true;
child.receiveShadow = true;
}
})
}
}, [gltfScene]);
useEffect(() => {
setDeletableFloorItem(null);
if (selectedFloorItem === null || selectedFloorItem.userData.modelUuid !== asset.modelUuid) {
@@ -481,6 +492,8 @@ function Model({ asset }: { readonly asset: Asset }) {
rotation={asset.rotation}
visible={asset.isVisible}
userData={{ ...asset, iks: ikData }}
castShadow
receiveShadow
onDoubleClick={(e) => {
e.stopPropagation();
if (!toggleView) {