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

Commit

Permalink
adding a tag component - ThumbnailLightTagComponent for filtering the…
Browse files Browse the repository at this point in the history
… query for light options in render settings primary light dropdown options
  • Loading branch information
SamMazerIR committed Aug 14, 2024
1 parent bce156b commit f792dfe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import React, { useEffect } from 'react'
import { Color, Euler, Material, MathUtils, Matrix4, Mesh, Quaternion, Sphere, SphereGeometry, Vector3 } from 'three'

import config from '@etherealengine/common/src/config'
import { ThumbnailLightTagComponent } from '@etherealengine/engine/src/camera/components/ThumbnailLightTagComponent'
import { ErrorComponent } from '@etherealengine/engine/src/scene/components/ErrorComponent'
import { ShadowComponent } from '@etherealengine/engine/src/scene/components/ShadowComponent'
import { useFind } from '@etherealengine/spatial/src/common/functions/FeathersHooks'
Expand Down Expand Up @@ -365,6 +366,7 @@ const ThumbnailJobReactor = () => {
setComponent(lightEntity, NameComponent, 'thumbnail job light for ' + src)
setComponent(lightEntity, VisibleComponent)
setComponent(lightEntity, DirectionalLightComponent, { intensity: 1, color: new Color(0xffffff) })
setComponent(lightEntity, ThumbnailLightTagComponent)

if (!state.cameraEntity.value) {
let canvasContainer = document.getElementById('thumbnail-camera-container')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineComponent } from '@etherealengine/ecs'

export const ThumbnailLightTagComponent = defineComponent({
name: 'ThumbnailLightTagComponent'
})
5 changes: 3 additions & 2 deletions packages/ui/src/components/editor/properties/render/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20
Ethereal Engine. All Rights Reserved.
*/

import { EntityUUID, UUIDComponent, useQuery } from '@etherealengine/ecs'
import { EntityUUID, Not, UUIDComponent, useQuery } from '@etherealengine/ecs'
import { ComponentType, getComponent, useComponent } from '@etherealengine/ecs/src/ComponentFunctions'
import {
EditorComponentType,
commitProperty,
updateProperty
} from '@etherealengine/editor/src/components/properties/Util'
import { ThumbnailLightTagComponent } from '@etherealengine/engine/src/camera/components/ThumbnailLightTagComponent'
import { GLTFNodeState, GLTFSnapshotAction } from '@etherealengine/engine/src/gltf/GLTFDocumentState'
import { GLTFSnapshotState } from '@etherealengine/engine/src/gltf/GLTFState'
import { RenderSettingsComponent } from '@etherealengine/engine/src/scene/components/RenderSettingsComponent'
Expand Down Expand Up @@ -119,7 +120,7 @@ export const RenderSettingsEditor: EditorComponentType = (props) => {
value: '' as EntityUUID
}
].concat(
useQuery([DirectionalLightComponent]).map((entity) => {
useQuery([DirectionalLightComponent, Not(ThumbnailLightTagComponent)]).map((entity) => {
return {
label: getComponent(entity, NameComponent),
value: getComponent(entity, UUIDComponent)
Expand Down

0 comments on commit f792dfe

Please sign in to comment.