Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
add shadow and envmap to models when dragged into scene (#10769)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinomut1 authored Jul 30, 2024
1 parent ed81482 commit 4a09fdc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/editor/src/functions/addMediaNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ import { Entity } from '@etherealengine/ecs/src/Entity'
import { defineQuery } from '@etherealengine/ecs/src/QueryFunctions'
import { AssetLoaderState } from '@etherealengine/engine/src/assets/state/AssetLoaderState'
import { PositionalAudioComponent } from '@etherealengine/engine/src/audio/components/PositionalAudioComponent'
import { EnvmapComponent } from '@etherealengine/engine/src/scene/components/EnvmapComponent'
import { ImageComponent } from '@etherealengine/engine/src/scene/components/ImageComponent'
import { MediaComponent } from '@etherealengine/engine/src/scene/components/MediaComponent'
import { ModelComponent } from '@etherealengine/engine/src/scene/components/ModelComponent'
import { ShadowComponent } from '@etherealengine/engine/src/scene/components/ShadowComponent'
import { VideoComponent } from '@etherealengine/engine/src/scene/components/VideoComponent'
import { VolumetricComponent } from '@etherealengine/engine/src/scene/components/VolumetricComponent'
import { ComponentJsonType } from '@etherealengine/engine/src/scene/types/SceneTypes'
Expand Down Expand Up @@ -139,7 +141,12 @@ export async function addMediaNode(
})
} else {
EditorControlFunctions.createObjectFromSceneElement(
[{ name: ModelComponent.jsonID, props: { src: url } }, ...extraComponentJson],
[
{ name: ModelComponent.jsonID, props: { src: url } },
{ name: ShadowComponent.jsonID },
{ name: EnvmapComponent.jsonID },
...extraComponentJson
],
parent!,
before
)
Expand Down

0 comments on commit 4a09fdc

Please sign in to comment.