diff --git a/packages/client-core/i18n/en/editor.json b/packages/client-core/i18n/en/editor.json index 87930d5e2f..7b9ec1c516 100755 --- a/packages/client-core/i18n/en/editor.json +++ b/packages/client-core/i18n/en/editor.json @@ -322,6 +322,12 @@ "map": { "description": "3D geospatial map of e.g. a city." }, + "shadow":{ + "name": "Shadows", + "description": "Shadow properties for the model", + "lbl-castShadow": "Cast Shadow", + "lbl-receiveShadow": "Receive Shadow" + }, "model": { "title": "Model", "description": "A 3D model in your scene, loaded from a GLTF URL or file.", @@ -336,8 +342,6 @@ "lbl-isAvatar": "Force Avatar Animations", "lbl-isGPUInstancing": "Is Using GPU Instancing", "lbl-isEquippable": "Is Equippable", - "lbl-castShadow": "Cast Shadow", - "lbl-receiveShadow": "Receive Shadow", "lbl-interactable": "Interactable", "lbl-generateBVH": "Generate BVH", "lbl-avoidCameraOcclusion": "Avoid Camera Occlusion", diff --git a/packages/editor/src/components/properties/ShadowProperties.tsx b/packages/editor/src/components/properties/ShadowProperties.tsx index 3a6a46b119..a3324e7a44 100644 --- a/packages/editor/src/components/properties/ShadowProperties.tsx +++ b/packages/editor/src/components/properties/ShadowProperties.tsx @@ -44,11 +44,16 @@ export const ShadowProperties: EditorComponentType = (props) => { if (!hasComponent(props.entity, ShadowComponent)) return <> const shadowComponent = useComponent(props.entity, ShadowComponent) return ( - - + + - + diff --git a/packages/engine/src/scene/components/ModelComponent.ts b/packages/engine/src/scene/components/ModelComponent.ts index e486f55dfa..7ed69fac94 100644 --- a/packages/engine/src/scene/components/ModelComponent.ts +++ b/packages/engine/src/scene/components/ModelComponent.ts @@ -55,6 +55,7 @@ import { enableObjectLayer } from '../functions/setObjectLayers' import { GroupComponent, addObjectToGroup, removeObjectFromGroup } from './GroupComponent' import { SceneAssetPendingTagComponent } from './SceneAssetPendingTagComponent' import { SceneObjectComponent } from './SceneObjectComponent' +import { ShadowComponent } from './ShadowComponent' import { UUIDComponent } from './UUIDComponent' import { VariantComponent } from './VariantComponent' @@ -131,7 +132,8 @@ function ModelReactor() { const source = model.src useEffect(() => { - !hasComponent(entity, LoopAnimationComponent) && setComponent(entity, LoopAnimationComponent, {}) + setComponent(entity, LoopAnimationComponent) + setComponent(entity, ShadowComponent) }, []) // update src