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

Commit

Permalink
fix entity node editor crashing (#10290)
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField authored May 30, 2024
1 parent b262b3e commit 47995c6
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ const EntityEditor = (props: { entityUUID: EntityUUID; multiEdit: boolean }) =>
)
}

const NodeEditor = (props: { entityUUID: EntityUUID; multiEdit: boolean }) => {
const entity = UUIDComponent.useEntityByUUID(props.entityUUID)
const node = GLTFNodeState.useMutableNode(entity)
if (!node) return null
return <EntityEditor entityUUID={props.entityUUID} multiEdit={props.multiEdit} />
}

/**
* PropertiesPanelContainer used to render editor view to customize property of selected element.
*/
Expand All @@ -141,7 +148,7 @@ export const PropertiesPanelContainer = () => {
{materialUUID ? (
<MaterialEditor materialUUID={materialUUID} />
) : uuid ? (
<EntityEditor entityUUID={uuid} key={uuid} multiEdit={multiEdit} />
<NodeEditor entityUUID={uuid} key={uuid} multiEdit={multiEdit} />
) : (
<div className="flex h-full items-center justify-center text-gray-500">
{t('editor:properties.noNodeSelected')}
Expand Down

0 comments on commit 47995c6

Please sign in to comment.