model
Functions
projectGraph()
function projectGraph(
document,
scope?,
catalog?
): object;
Adapt the semantic graph to the canvas, including fallback positions for unplaced nodes.
Parameters
| Parameter | Type | Default value |
|---|---|---|
document | MaterialXDocument | undefined |
scope? | string | '' |
catalog? | MaterialXNodeSpec[] | ... |
Returns
object
| Name | Type |
|---|---|
nodes | GraphNode[] |
edges | GraphEdge[] |
previewXml()
function previewXml(document, catalog?): string;
Parameters
| Parameter | Type |
|---|---|
document | MaterialXDocument |
catalog? | MaterialXNodeSpec[] |
Returns
string
createDefaultDocument()
function createDefaultDocument(): MaterialXDocument;
Returns
importMaterial()
function importMaterial(data, name): MaterialXPackage;
Parameters
| Parameter | Type |
|---|---|
data | Uint8Array |
name | string |
Returns
MaterialXPackage
exportMaterial()
function exportMaterial(
pkg,
zip,
catalog?
): Uint8Array;
Parameters
| Parameter | Type |
|---|---|
pkg | MaterialXPackage |
zip | boolean |
catalog? | MaterialXNodeSpec[] |
Returns
Uint8Array
Interfaces
GraphNode
Extends
GraphNode
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
id | string | - | SemanticGraphNode.id |
element | MaterialXElement | - | SemanticGraphNode.element |
inputs | MaterialXNodePortSpec[] | - | SemanticGraphNode.inputs |
outputs | MaterialXNodePortSpec[] | - | SemanticGraphNode.outputs |
type? | string | Inferred output type; absent while the family is ambiguous. | SemanticGraphNode.type |
definition? | MaterialXNodeSpec | Concrete fallback for implicit defaults. Does not constrain the inferred type. | SemanticGraphNode.definition |
candidates? | MaterialXNodeSpec[] | Compatible definition variants for this node. | SemanticGraphNode.candidates |
compoundScope? | string | Document scope containing this compound node’s implementation, when available. | SemanticGraphNode.compoundScope |
position | Point | - | - |
References
addNode
Re-exports addNode
cloneNode
Re-exports cloneNode
connectNodes
Re-exports connectNodes
connectionError
Re-exports connectionError
disconnectInput
Re-exports disconnectInput
getNodeCatalog
Re-exports getNodeCatalog
graphScopes
Re-exports graphScopes
moveNodes
Re-exports moveNodes
removeNodes
Re-exports removeNodes
renameNode
Re-exports renameNode
resetInput
Re-exports resetInput
setInputValue
Re-exports setInputValue
materializeDocument
Re-exports materializeDocument
resolveTypes
Re-exports resolveTypes
GraphConnection
Re-exports GraphConnection
GraphEdge
Re-exports GraphEdge
Point
Re-exports Point
nodeType
Re-exports nodeType
findNodeSpec
Re-exports findNodeSpec
MaterialXDocument
Re-exports MaterialXDocument
MaterialXElement
Re-exports MaterialXElement
MaterialXNodeSpec
Re-exports MaterialXNodeSpec
MaterialXNodePortSpec
Re-exports MaterialXNodePortSpec
getNodeFamilies
Re-exports getNodeFamilies
autoLayout
Re-exports autoLayout
visibleInputs
Re-exports visibleInputs
Type Aliases
EditorMode
type EditorMode = "view" | "edit";