SceneNodeDrawer

Internal Odin property drawer for SceneNode. Renders the scene reference, dependency list, and a remove button. Handles both top-level nodes (in the SceneGraph) and nested dependency nodes.

Definition

Namespace: Paragon.Core.SceneManagement.Editor Assembly: Paragon.Editor.dll

[DrawerPriority(0.0, 0.0, 3000.0), UsedImplicitly]
internal class SceneNodeDrawer : OdinValueDrawer<SceneNode>

Inheritance: OdinValueDrawer<SceneNode>SceneNodeDrawer

Remarks

SceneNodeDrawer has two rendering modes based on context:

  1. Top-level node (parent is SceneGraph) — Draws the full scene field + dependencies list + remove button + "Add Dependency" button via SceneSelectMenu

  2. Nested dependency node (parent is another SceneNode) — Draws only a read-only SceneAsset field + remove button

Reference resolution

When a SceneNode property has ValueState.Reference (i.e., it's a serialized reference to another node), the drawer resolves the actual property via ValueEntry.TargetReferencePath before drawing.

Dependency management

  • Add dependency — Opens a SceneSelectMenu filtered to exclude the current scene and existing dependencies

  • Remove — Context-aware: removes from SceneGraph if top-level, or removes from parent SceneNode dependencies if nested

Odin Integration

An inner AttributeProcessor configures the dependencies list with [DoNotDrawAsReference] and [ListDrawerSettings(HideRemoveButton = true)].

Methods

Initialize

Creates the SceneSelectMenu instance used for the "Add Dependency" popup.

DrawPropertyLayout

Draws the scene node based on context:

  • Top-level: Scene field + dependencies list + remove button

  • Nested: Read-only SceneAsset + remove button

Common Pitfalls

circle-exclamation
circle-exclamation

See Also

Last updated