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:
Top-level node (parent is
SceneGraph) — Draws the full scene field + dependencies list + remove button + "Add Dependency" button viaSceneSelectMenuNested dependency node (parent is another
SceneNode) — Draws only a read-onlySceneAssetfield + 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
SceneSelectMenufiltered to exclude the current scene and existing dependenciesRemove — Context-aware: removes from
SceneGraphif top-level, or removes from parentSceneNodedependencies 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
Remove behavior depends on parent type Clicking the remove (X) button on a top-level node calls SceneGraph.RemoveScene(). On a nested dependency node, it calls SceneNode.RemoveDependency(). The drawer determines this by checking Property.Parent.ParentType.
Add Dependency filters existing dependencies The dependency picker only shows scenes from the SceneGraph that are not the current scene and are not already dependencies. If no scenes are available, the add button still appears but the menu is empty.
See Also
SceneGraphEditor — The parent editor that hosts scene node drawing
SceneDrawer — Draws the
Scenefield within each nodeSceneSelectMenu — Popup used for adding dependencies
EditorSceneManager — Called to save the graph after modifications
Last updated