Material Graph Editor Developer Reference#
1. Scope#
This document targets extension integrators and tooling developers. Public APIs listed in Section 2 are intended for integration use; internal behavior sections describe observed implementation details and can change between releases.
2. Public API#
Stable API Surface#
Import:
import omni.kit.window.material_graph as mg
Window Helpers#
mg.get_extension() -> Optional[GraphExtension]
mg.get_graph_window() -> Optional[GraphWindow]
Example:
window = mg.get_graph_window()
if window:
window.visible = True
MDL Module Helpers#
mg.add_mdl_catalog_module(path: str) -> None
mg.remove_mdl_catalog_module(path: str) -> None
Example:
mg.add_mdl_catalog_module("MyLibrary.mdl")
mg.remove_mdl_catalog_module("MyLibrary.mdl")
Internal Details (Non-API)#
Callback registration performs signature checks.
Duplicate label/callback registration is rejected.
Dead callback targets are pruned from registries.
Window instance access is extension-lifecycle dependent.
3. Settings and Identifiers#
Settings Prefixes#
Normal runtime prefix:
/persistent/app/properties/materialGraph/Test runtime prefix:
/persistent/app/properties/materialGraphTest/
Core Keys and Defaults#
forceConnect=falseshowCatalog=trueconfineNodeGraphs=truebackdropDefaultColor=[0.84, 0.71, 0.29]confineBackdrops=truepreviewTextureInput=falsedroppableTextureFormats=["bmp","dds","exr","gif","hdr","jpeg","jpg","png","psd","tga","tif"]catalogTextureIconSize=128catalogTextures= token-resolved${data}/catalog_texturespathcompoundPaths= list containing the token-resolved${data}/nodegraphspathcompoundDefaultExportPath= token-resolved${data}/nodegraphspath
Plugin Property Keys#
Under plugins/<pluginName>/...:
MDL:
enablePolymorphic(defaulttrue)modules(default from extension settings)catalogExcludedAnnotations(default["deprecated","unused","hidden"])outputPorts(default["displacement","surface","volume"])
MaterialX:
outputPortsignoreContextsignoreFamiliesignoreNameRegexes
Universal:
outputPorts
Hydra Render Context Key#
/persistent/app/hydra/material/renderContexts
4. MDL Module Loading Internals#
Module source (settings): Loaded from MDL plugin
modulessetting..mdl suffix requirement: Entries must end with
.mdl.Resolver validation: Each entry is validated through asset resolution before use.
Deduplication: Duplicate module entries are removed while preserving effective order.
Registration flow: Valid modules are registered, then shader subidentifiers are enumerated into Catalog items.
Reload behavior: Changing module settings triggers Catalog refresh.
Caching: Module signatures are cached to avoid redundant re-registration for unchanged module sets.
5. Annotation Filtering Logic#
Default excluded annotations:
deprecated,unused,hidden(MDL plugin default behavior).MDL override behavior:
catalogExcludedAnnotationscan override exclusion list.Normalization: Annotation names are normalized to lowercase, trimmed, and deduplicated before filtering.
7. Hydra Material Delegate Error Semantics#
Required output missing -> delegate error.
Incompatible link -> delegate error.
Errors are reported through application logging.
No automatic graph repair is performed.
8. Render Context Handling#
Context list source: Hydra render contexts are read from
/persistent/app/hydra/material/renderContexts.Default behavior: One active context is used for Catalog, validation, and output interpretation at a time.
Interaction with UI: Active context selection updates visible Catalog content and context-scoped graph presentation.
9. Verification Checklist#
Validate the following in a runtime build:
Public API import and callable signatures for context menu, window helpers, and MDL module helpers.
MDL module setting update triggers Catalog reload and ignores invalid/unresolvable entries.
Annotation filtering reflects defaults and custom
catalogExcludedAnnotations.MDL icon/thumbnail precedence resolves as
thumbnail -> icon -> fallback.Missing required outputs produce Hydra material delegate logging errors.
Force-connected incompatible links produce Hydra material delegate logging errors.
Context switching updates Catalog content and context-scoped visibility as expected.