MaterialX.PyMaterialXCore Module

Inheritance diagram of MaterialX.PyMaterialXCore

Core MaterialX elements and graph traversal.

exception MaterialX.PyMaterialXCore.Exception

Bases: Exception

add_note()

Exception.add_note(note) – add a note to the exception

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
exception MaterialX.PyMaterialXCore.ExceptionFoundCycle

Bases: Exception

add_note()

Exception.add_note(note) – add a note to the exception

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
exception MaterialX.PyMaterialXCore.ExceptionOrphanedElement

Bases: Exception

add_note()

Exception.add_note(note) – add a note to the exception

with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args
class MaterialX.PyMaterialXCore.AttributeDef

Bases: TypedElement

An attribute definition element within a Document.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttrName(self: MaterialX.PyMaterialXCore.AttributeDef) str

Return the element’s attrname string.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getExportable(self: MaterialX.PyMaterialXCore.AttributeDef) bool

Return the exportable boolean for the element.

Defaults to false if exportable is not set.

getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getValueString(self: MaterialX.PyMaterialXCore.AttributeDef) str

Get the value string of a element.

hasAttrName(self: MaterialX.PyMaterialXCore.AttributeDef) bool

Return true if this element has an attrname string.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasValueString(self: MaterialX.PyMaterialXCore.AttributeDef) bool

Return true if the given element has a value string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttrName(self: MaterialX.PyMaterialXCore.AttributeDef, arg0: str) None

Set the element’s attrname string.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setExportable(self: MaterialX.PyMaterialXCore.AttributeDef, arg0: bool) None

Set the exportable boolean for the element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setValueString(self: MaterialX.PyMaterialXCore.AttributeDef, arg0: str) None

Set the value string of an element.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'attributedef'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Backdrop

Bases: Element

A layout element used to contain, group and document nodes within a graph.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getContainsElements(self: MaterialX.PyMaterialXCore.Backdrop) list[MaterialX.PyMaterialXCore.TypedElement]

Return the vector of elements that this backdrop contains.

getContainsString(self: MaterialX.PyMaterialXCore.Backdrop) str

Return the contains string for this backdrop.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getHeight(self: MaterialX.PyMaterialXCore.Backdrop) float

Return the height attribute of the backdrop.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getWidth(self: MaterialX.PyMaterialXCore.Backdrop) float

Return the width attribute of the backdrop.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasContainsString(self: MaterialX.PyMaterialXCore.Backdrop) bool

Return true if this backdrop has a contains string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasHeight(self: MaterialX.PyMaterialXCore.Backdrop) bool

Return true if this backdrop has a height attribute.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasWidth(self: MaterialX.PyMaterialXCore.Backdrop) bool

Return true if this backdrop has a width attribute.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setContainsElements(self: MaterialX.PyMaterialXCore.Backdrop, arg0: collections.abc.Sequence[MaterialX.PyMaterialXCore.TypedElement]) None

Set the vector of elements that this backdrop contains.

setContainsString(self: MaterialX.PyMaterialXCore.Backdrop, arg0: str) None

Set the contains string for this backdrop.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setHeight(self: MaterialX.PyMaterialXCore.Backdrop, arg0: SupportsFloat) None

Set the height attribute of the backdrop.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setWidth(self: MaterialX.PyMaterialXCore.Backdrop, arg0: SupportsFloat) None

Set the width attribute of the backdrop.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'backdrop'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
CONTAINS_ATTRIBUTE = 'contains'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
HEIGHT_ATTRIBUTE = 'height'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
WIDTH_ATTRIBUTE = 'width'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Collection

Bases: Element

A collection element within a Document.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getExcludeGeom(self: MaterialX.PyMaterialXCore.Collection) str

Return the exclude geometry string of this element.

getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getIncludeCollectionString(self: MaterialX.PyMaterialXCore.Collection) str

Return the include collection string of this element.

getIncludeCollections(self: MaterialX.PyMaterialXCore.Collection) list[MaterialX.PyMaterialXCore.Collection]

Return the vector of collections that are directly included by this element.

getIncludeGeom(self: MaterialX.PyMaterialXCore.Collection) str

Return the include geometry string of this element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasExcludeGeom(self: MaterialX.PyMaterialXCore.Collection) bool

Return true if this element has an exclude geometry string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasIncludeCollectionString(self: MaterialX.PyMaterialXCore.Collection) bool

Return true if this element has an include collection string.

hasIncludeCycle(self: MaterialX.PyMaterialXCore.Collection) bool

Return true if the include chain for this element contains a cycle.

hasIncludeGeom(self: MaterialX.PyMaterialXCore.Collection) bool

Return true if this element has an include geometry string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

matchesGeomString(self: MaterialX.PyMaterialXCore.Collection, arg0: str) bool

Return true if this collection and the given geometry string have any geometries in common.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setExcludeGeom(self: MaterialX.PyMaterialXCore.Collection, arg0: str) None

Set the exclude geometry string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setIncludeCollection(self: MaterialX.PyMaterialXCore.Collection, arg0: MaterialX.PyMaterialXCore.Collection) None

Set the collection that is directly included by this element.

setIncludeCollectionString(self: MaterialX.PyMaterialXCore.Collection, arg0: str) None

Set the include collection string of this element.

setIncludeCollections(self: MaterialX.PyMaterialXCore.Collection, arg0: collections.abc.Sequence[MaterialX.PyMaterialXCore.Collection]) None

Set the vector of collections that are directly included by this element.

setIncludeGeom(self: MaterialX.PyMaterialXCore.Collection, arg0: str) None

Set the include geometry string of this element.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'collection'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Color3(*args, **kwargs)

Bases: VectorBase

A three-component color value.

Overloaded function.

  1. __init__(self: MaterialX.PyMaterialXCore.Color3) -> None

  2. __init__(self: MaterialX.PyMaterialXCore.Color3, arg0: typing.SupportsFloat) -> None

  3. __init__(self: MaterialX.PyMaterialXCore.Color3, arg0: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat], “FixedSize(3)”]) -> None

  4. __init__(self: MaterialX.PyMaterialXCore.Color3, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> None

  5. __init__(self: MaterialX.PyMaterialXCore.Color3, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> None

asTuple(self: MaterialX.PyMaterialXCore.Color3) tuple[float, float, float]
copy(self: MaterialX.PyMaterialXCore.Color3) MaterialX.PyMaterialXCore.Color3
dot(self: MaterialX.PyMaterialXCore.Color3, arg0: MaterialX.PyMaterialXCore.Color3) float
getMagnitude(self: MaterialX.PyMaterialXCore.Color3) float
getNormalized(self: MaterialX.PyMaterialXCore.Color3) MaterialX.PyMaterialXCore.Color3
linearToSrgb(self: MaterialX.PyMaterialXCore.Color3) MaterialX.PyMaterialXCore.Color3

Transform the given color from linear RGB to the sRGB encoding, returning the result as a new value.

srgbToLinear(self: MaterialX.PyMaterialXCore.Color3) MaterialX.PyMaterialXCore.Color3

Transform the given color from the sRGB encoding to linear RGB, returning the result as a new value.

class MaterialX.PyMaterialXCore.Color4(*args, **kwargs)

Bases: VectorBase

A four-component color value.

Overloaded function.

  1. __init__(self: MaterialX.PyMaterialXCore.Color4) -> None

  2. __init__(self: MaterialX.PyMaterialXCore.Color4, arg0: typing.SupportsFloat) -> None

  3. __init__(self: MaterialX.PyMaterialXCore.Color4, arg0: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat], “FixedSize(4)”]) -> None

  4. __init__(self: MaterialX.PyMaterialXCore.Color4, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> None

  5. __init__(self: MaterialX.PyMaterialXCore.Color4, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat, arg3: typing.SupportsFloat) -> None

asTuple(self: MaterialX.PyMaterialXCore.Color4) tuple[float, float, float, float]
copy(self: MaterialX.PyMaterialXCore.Color4) MaterialX.PyMaterialXCore.Color4
dot(self: MaterialX.PyMaterialXCore.Color4, arg0: MaterialX.PyMaterialXCore.Color4) float
getMagnitude(self: MaterialX.PyMaterialXCore.Color4) float
getNormalized(self: MaterialX.PyMaterialXCore.Color4) MaterialX.PyMaterialXCore.Color4
class MaterialX.PyMaterialXCore.CommentElement

Bases: Element

An element representing a block of descriptive text within a document, which will be stored a comment when the document is written out.

The comment text may be accessed with the methods Element::setDocString and Element::getDocString.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'comment'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Document

Bases: GraphElement

A MaterialX document, which represents the top-level element in the MaterialX ownership hierarchy.

Use the factory function createDocument() to create a Document instance.

addAttributeDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.AttributeDef

Add an AttributeDef to the document.

Parameters:

name – The name of the new AttributeDef. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new AttributeDef.

addBackdrop(self: MaterialX.PyMaterialXCore.GraphElement, name: str = '') MaterialX_v1_39_5::Backdrop

Add a Backdrop to the graph.

addBindInput(name, type='color3')

(Deprecated) Add a BindInput to this shader reference.

addBindParam(name, type='color3')

(Deprecated) Add a BindParam to this shader reference.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addCollection(self: MaterialX.PyMaterialXCore.Document, name: str = '') MaterialX.PyMaterialXCore.Collection

Add a Collection to the document.

Parameters:

name – The name of the new Collection. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Collection.

addGeomInfo(self: MaterialX.PyMaterialXCore.Document, name: str = '', geom: str = '/') MaterialX.PyMaterialXCore.GeomInfo

Add a GeomInfo to the document.

Parameters:
  • name – The name of the new GeomInfo. If no name is specified, then a unique name will automatically be generated.

  • geom – An optional geometry string for the GeomInfo.

Returns:

A shared pointer to the new GeomInfo.

addGeomNode(self: MaterialX.PyMaterialXCore.GraphElement, arg0: MaterialX.PyMaterialXCore.GeomPropDef, arg1: str) MaterialX.PyMaterialXCore.Node

If not yet present, add a geometry node to this graph matching the given property definition and name prefix.

addGeomPropDef(self: MaterialX.PyMaterialXCore.Document, arg0: str, arg1: str) MaterialX.PyMaterialXCore.GeomPropDef

Add a GeomPropDef to the document.

Parameters:
  • name – The name of the new GeomPropDef.

  • geomprop – The geometric property to use for the GeomPropDef.

Returns:

A shared pointer to the new GeomPropDef.

addImplementation(self: MaterialX.PyMaterialXCore.Document, name: str = '') MaterialX.PyMaterialXCore.Implementation

Add an Implementation to the document.

Parameters:

name – The name of the new Implementation. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Implementation.

addInput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Input

Add an Input to this interface.

Parameters:
  • name – The name of the new Input. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Input.

addLook(self: MaterialX.PyMaterialXCore.Document, name: str = '') MaterialX.PyMaterialXCore.Look

Add a Look to the document.

Parameters:

name – The name of the new Look. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Look.

addLookGroup(self: MaterialX.PyMaterialXCore.Document, name: str = '') MaterialX.PyMaterialXCore.LookGroup

Add a LookGroup to the document.

Parameters:

name – The name of the new LookGroup. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new LookGroup.

addMaterial(name)

(Deprecated) Add a material element to the document.

addMaterialNode(self: MaterialX.PyMaterialXCore.GraphElement, name: str = '', shaderNode: MaterialX.PyMaterialXCore.Node = None) MaterialX.PyMaterialXCore.Node

Add a material node to the graph, optionally connecting it to the given shader node.

addNode(self: MaterialX.PyMaterialXCore.GraphElement, category: str, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Node

Add a Node to the graph.

Parameters:
  • category – The category of the new Node.

  • name – The name of the new Node. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Node.

addNodeDef(self: MaterialX.PyMaterialXCore.Document, name: str = '', type: str = 'color3', node: str = '') MaterialX.PyMaterialXCore.NodeDef

Add a NodeDef to the document.

Parameters:
  • name – The name of the new NodeDef. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string. If specified, then the new NodeDef will be assigned an Output of the given type.

  • node – An optional node string.

Returns:

A shared pointer to the new NodeDef.

addNodeDefFromGraph(*args, **kwargs)

Overloaded function.

  1. addNodeDefFromGraph(self: MaterialX.PyMaterialXCore.Document, arg0: MaterialX.PyMaterialXCore.NodeGraph, arg1: str, arg2: str, arg3: str) -> MaterialX.PyMaterialXCore.NodeDef

  2. addNodeDefFromGraph(self: MaterialX.PyMaterialXCore.Document, arg0: MaterialX.PyMaterialXCore.NodeGraph, arg1: str, arg2: str, arg3: str, arg4: bool, arg5: str, arg6: str) -> MaterialX.PyMaterialXCore.NodeDef

addNodeGraph(self: MaterialX.PyMaterialXCore.Document, name: str = '') MaterialX.PyMaterialXCore.NodeGraph

Add a NodeGraph to the document.

Parameters:

name – The name of the new NodeGraph. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new NodeGraph.

addNodeInstance(self: MaterialX.PyMaterialXCore.GraphElement, nodeDef: MaterialX.PyMaterialXCore.NodeDef, name: str = '') MaterialX.PyMaterialXCore.Node

Add a Node that is an instance of the given NodeDef.

addOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Output

Add an Output to this interface.

Parameters:
  • name – The name of the new Output. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Output.

addParameter(name)

(Deprecated) Add a Parameter to this interface.

addPropertySet(self: MaterialX.PyMaterialXCore.Document, name: str = '') MaterialX.PyMaterialXCore.PropertySet

Add a PropertySet to the document.

Parameters:

name – The name of the new PropertySet. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new PropertySet.

addTargetDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.TargetDef

Add an TargetDef to the document.

Parameters:

name – The name of the new TargetDef. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new TargetDef.

addToken(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = 'color3') MaterialX.PyMaterialXCore.Token

Add a Token to this interface.

Parameters:

name – The name of the new Token. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Token.

addTypeDef(self: MaterialX.PyMaterialXCore.Document, name: str = '') MaterialX.PyMaterialXCore.TypeDef

Add a TypeDef to the document.

Parameters:

name – The name of the new TypeDef. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new TypeDef.

addUnitDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.UnitDef
addUnitTypeDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.UnitTypeDef
addVariantSet(self: MaterialX.PyMaterialXCore.Document, name: str = '') MaterialX.PyMaterialXCore.VariantSet

Add a VariantSet to the document.

Parameters:

name – The name of the new VariantSet. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new VariantSet.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

asStringDot(self: MaterialX.PyMaterialXCore.GraphElement) str

Convert this graph to a string in the DOT language syntax.

This can be used to visualise the graph using GraphViz (http://www.graphviz.org).

If declarations for the contained nodes are provided as nodedefs in the owning document, then they will be used to provide additional formatting details.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.InterfaceElement) None

Clear all attributes and descendants from this element.

copy(self: MaterialX.PyMaterialXCore.Document) MaterialX.PyMaterialXCore.Document

Create a deep copy of the document.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

flattenSubgraphs(self: MaterialX.PyMaterialXCore.GraphElement, target: str = '', filter: collections.abc.Callable[[MaterialX.PyMaterialXCore.Node], bool] = None) None

Flatten all subgraphs at the root scope of this graph element, recursively replacing each graph-defined node with its equivalent node network.

Parameters:
  • target – An optional target string to be used in specifying which node definitions are used in this process.

  • filter – An optional node predicate specifying which nodes should be included and excluded from this process.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the first Input with the given name that belongs to this interface, taking interface inheritance into account.

getActiveInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements that belong to this interface, taking inheritance into account.

getActiveOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the first Output with the given name that belongs to this interface, taking interface inheritance into account.

getActiveOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements that belong to this interface, taking inheritance into account.

getActiveParameters()

(Deprecated) Return a vector of all parameters belonging to this interface, taking inheritance into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the first Token with the given name that belongs to this interface, taking interface inheritance into account.

getActiveTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements that belong to this interface, taking inheritance into account.

getActiveValueElement(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.ValueElement

Return the first value element with the given name that belongs to this interface, taking interface inheritance into account.

Examples of value elements are Input, Output, and Token.

getActiveValueElements(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.ValueElement]

Return a vector of all value elements that belong to this interface, taking inheritance into account.

Examples of value elements are Input, Output, and Token.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.AttributeDef

Return the AttributeDef, if any, with the given name.

getAttributeDefs(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.AttributeDef]

Return a vector of all AttributeDef elements in the document.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getBackdrop(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) MaterialX_v1_39_5::Backdrop

Return the Backdrop, if any, with the given name.

getBackdrops(self: MaterialX.PyMaterialXCore.GraphElement) list[MaterialX_v1_39_5::Backdrop]

Return a vector of all Backdrop elements in the graph.

getBindInputs()

(Deprecated) Return a vector of all BindInput elements in this shader reference.

getBindParams()

(Deprecated) Return a vector of all BindParam elements in this shader reference.

getBindTokens()

(Deprecated) Return a vector of all BindToken elements in this shader reference.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getCollection(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.Collection

Return the Collection, if any, with the given name.

getCollections(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.Collection]

Return a vector of all Collection elements in the document.

getColorManagementConfig(self: MaterialX.PyMaterialXCore.Document) str

Return the color management config string.

getColorManagementSystem(self: MaterialX.PyMaterialXCore.Document) str

Return the color management system string.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the output connected to the given input.

If the given input is not present, then an empty OutputPtr is returned.

getDataLibrary(self: MaterialX.PyMaterialXCore.Document) MaterialX.PyMaterialXCore.Document

Return the data library, if any, referenced by this document.

getDeclaration(self: MaterialX.PyMaterialXCore.InterfaceElement, target: str = '') MaterialX.PyMaterialXCore.InterfaceElement

Return the first declaration of this interface, optionally filtered by the given target name.

Parameters:

target – An optional target name, which will be used to filter the declarations that are considered.

Returns:

A shared pointer to declaration, or an empty shared pointer if no declaration was found.

getDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return the default version flag of this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomInfo(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.GeomInfo

Return the GeomInfo, if any, with the given name.

getGeomInfos(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.GeomInfo]

Return a vector of all GeomInfo elements in the document.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getGeomPropDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.GeomPropDef

Return the GeomPropDef, if any, with the given name.

getGeomPropDefs(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.GeomPropDef]

Return a vector of all GeomPropDef elements in the document.

getGeomPropValue(self: MaterialX.PyMaterialXCore.Document, geomPropName: str, geom: str = '/') MaterialX.PyMaterialXCore.Value

Return the value of a geometric property for the given geometry string.

getImplementation(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.Implementation

Return the Implementation, if any, with the given name.

getImplementations(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.Implementation]

Return a vector of all Implementation elements in the document.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the Input, if any, with the given name.

getInputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Input elements.

getInputValue(name, target='')

Return the typed value of an input by its name, taking both the calling element and its declaration into account. If the given input is not found, then None is returned.

getInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements.

getLook(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.Look

Return the Look, if any, with the given name.

getLookGroup(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.LookGroup

Return the LookGroup, if any, with the given name.

getLookGroups(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.LookGroup]

Return a vector of all LookGroup elements in the document.

getLooks(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.Look]

Return a vector of all Look elements in the document.

getMatchingImplementations(self: MaterialX.PyMaterialXCore.Document, arg0: str) list[MaterialX.PyMaterialXCore.InterfaceElement]

Return a vector of all node implementations that match the given NodeDef string.

Note that a node implementation may be either an Implementation element or NodeGraph element.

getMatchingNodeDefs(self: MaterialX.PyMaterialXCore.Document, arg0: str) list[MaterialX.PyMaterialXCore.NodeDef]

Return a vector of all NodeDef elements that match the given node name.

getMatchingPorts(self: MaterialX.PyMaterialXCore.Document, arg0: str) list[MaterialX.PyMaterialXCore.PortElement]

Return a vector of all port elements that match the given node name.

Port elements support spatially-varying upstream connections to nodes, and include both Input and Output elements.

getMaterialNodes(self: MaterialX.PyMaterialXCore.GraphElement) list[MaterialX.PyMaterialXCore.Node]

Return a vector of all material nodes.

getMaterialOutputs(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.Output]

Return material-type outputs for all nodegraphs in the document.

getMaterials()

(Deprecated) Return a vector of all materials in the document.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getNode(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) MaterialX.PyMaterialXCore.Node

Return the Node, if any, with the given name.

getNodeDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.NodeDef

Return the NodeDef, if any, with the given name.

getNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the NodeDef string for the interface.

getNodeDefs(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.NodeDef]

Return a vector of all NodeDef elements in the document.

getNodeGraph(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.NodeGraph

Return the NodeGraph, if any, with the given name.

getNodeGraphs(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.NodeGraph]

Return a vector of all NodeGraph elements in the document.

getNodes(self: MaterialX.PyMaterialXCore.GraphElement, category: str = '') list[MaterialX.PyMaterialXCore.Node]

Return a vector of all Nodes in the graph, optionally filtered by the given category string.

getOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the Output, if any, with the given name.

getOutputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Output elements.

getOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements.

getParameterValue(name, target='')

(Deprecated) Return the typed value of a parameter by its name.

getParameterValueString(name)

(Deprecated) Return the value string of a parameter by its name.

getParameters()

(Deprecated) Return a vector of all Parameter elements.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getPropertySet(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.PropertySet

Return the PropertySet, if any, with the given name.

getPropertySets(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.PropertySet]

Return a vector of all PropertySet elements in the document.

getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getReferencedSourceUris(self: MaterialX.PyMaterialXCore.Document) set[str]

Get a list of source URIs referenced by the document.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the target string of this interface.

getTargetDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.TargetDef

Return the AttributeDef, if any, with the given name.

getTargetDefs(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.TargetDef]

Return a vector of all TargetDef elements in the document.

getToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the Token, if any, with the given name.

getTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) str

Return the string value of a Token by its name, or an empty string if the given Token is not present.

getTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.TypeDef

Return the TypeDef, if any, with the given name.

getTypeDefs(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.TypeDef]

Return a vector of all TypeDef elements in the document.

getUnitDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.UnitDef

Return the UnitDef, if any, with the given name.

getUnitDefs(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.UnitDef]

Return a vector of all Member elements in the TypeDef.

getUnitTypeDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.UnitTypeDef

Return the UnitTypeDef, if any, with the given name.

getUnitTypeDefs(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.UnitTypeDef]

Return a vector of all UnitTypeDef elements in the document.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getVariantSet(self: MaterialX.PyMaterialXCore.Document, arg0: str) MaterialX.PyMaterialXCore.VariantSet

Return the VariantSet, if any, with the given name.

getVariantSets(self: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.VariantSet]

Return a vector of all VariantSet elements in the document.

getVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement) tuple[int, int]

Return the major and minor versions as an integer pair.

getVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the version string of this interface.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorManagementConfig(self: MaterialX.PyMaterialXCore.Document) bool

Return true if a color management config string has been set.

hasColorManagementSystem(self: MaterialX.PyMaterialXCore.Document) bool

Return true if a color management system string has been set.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasDataLibrary(self: MaterialX.PyMaterialXCore.Document) bool

Return true if this document has a data library.

hasExactInputMatch(self: MaterialX.PyMaterialXCore.InterfaceElement, declaration: MaterialX.PyMaterialXCore.InterfaceElement, message: str = None) bool

Return true if this instance has an exact input match with the given declaration, where each input of this the instance corresponds to a declaration input of the same name and type.

If an exact input match is not found, and the optional message argument is provided, then an error message will be appended to the given string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a NodeDef string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a target string.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if this interface has a version string.

importLibrary(self: MaterialX.PyMaterialXCore.Document, arg0: MaterialX.PyMaterialXCore.Document) None

Import the given data library into this document.

Parameters:

library – The data library to be imported.

initialize(self: MaterialX.PyMaterialXCore.Document) None

Initialize the document, removing any existing content.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeAttributeDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the AttributeDef, if any, with the given name.

removeBackdrop(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) None

Remove the Backdrop, if any, with the given name.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeCollection(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the Collection, if any, with the given name.

removeGeomInfo(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the GeomInfo, if any, with the given name.

removeGeomPropDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the GeomPropDef, if any, with the given name.

removeImplementation(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the Implementation, if any, with the given name.

removeInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Input, if any, with the given name.

removeLook(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the Look, if any, with the given name.

removeLookGroup(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the LookGroup, if any, with the given name.

removeNode(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) None

Remove the Node, if any, with the given name.

removeNodeDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the NodeDef, if any, with the given name.

removeNodeGraph(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the NodeGraph, if any, with the given name.

removeOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Output, if any, with the given name.

removePropertySet(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the PropertySet, if any, with the given name.

removeTargetDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the TargetDef, if any, with the given name.

removeToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Token, if any, with the given name.

removeTypeDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the TypeDef, if any, with the given name.

removeUnitDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the UnitDef, if any, with the given name.

removeUnitTypeDef(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the UnitTypeDef, if any, with the given name.

removeVariantSet(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Remove the VariantSet, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorManagementConfig(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Set the color management config string.

setColorManagementSystem(self: MaterialX.PyMaterialXCore.Document, arg0: str) None

Set the color management system string.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: MaterialX.PyMaterialXCore.Output) None

Set the output to which the given input is connected, creating a child input if needed.

If the output argument is null, then any existing output connection on the input will be cleared.

setDataLibrary(self: MaterialX.PyMaterialXCore.Document, arg0: MaterialX.PyMaterialXCore.Document) None

Store a reference to a data library in this document.

setDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: bool) None

Set the default version flag of this element.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInputValue(name, value, typeString='')

Set the typed value of an input by its name, creating a child element to hold the input if needed.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the NodeDef string for the interface.

setParameterValue(name, value, typeString='')

(Deprecated) Set the typed value of a parameter by its name.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setTarget(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the target string of this interface.

setTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: str) MaterialX.PyMaterialXCore.Token

Set the string value of a Token by its name, creating a child element to hold the Token if needed.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: SupportsInt, arg1: SupportsInt) None

Set the major and minor versions as an integer pair.

setVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the version string of this interface.

topologicalSort(self: MaterialX.PyMaterialXCore.GraphElement) list[MaterialX.PyMaterialXCore.Element]

Return a vector of all children (nodes and outputs) sorted in topological order.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

upgradeVersion(self: MaterialX.PyMaterialXCore.Document) None

Upgrade the content of this document from earlier supported versions to the library version.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
NODE_DEF_ATTRIBUTE = 'nodedef'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Edge

Bases: pybind11_object

An edge between two connected Elements, returned during graph traversal.

getConnectingElement(self: MaterialX.PyMaterialXCore.Edge) MaterialX.PyMaterialXCore.Element

Return the connecting element of the edge, if any.

getDownstreamElement(self: MaterialX.PyMaterialXCore.Edge) MaterialX.PyMaterialXCore.Element

Return the downstream element of the edge.

getName(self: MaterialX.PyMaterialXCore.Edge) str

Return the name of this edge, if any.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Edge) MaterialX.PyMaterialXCore.Element

Return the upstream element of the edge.

class MaterialX.PyMaterialXCore.Element

Bases: pybind11_object

The base class for MaterialX elements.

An Element is a named object within a Document, which may possess any number of child elements and attributes.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.ElementEquivalenceOptions(self: MaterialX.PyMaterialXCore.ElementEquivalenceOptions)

Bases: pybind11_object

A set of options for comparing the functional equivalence of elements.

property attributeExclusionList
property floatFormat
property floatPrecision
property performValueComparisons
class MaterialX.PyMaterialXCore.ElementPredicate

Bases: pybind11_object

class MaterialX.PyMaterialXCore.GenericElement

Bases: Element

A generic element subclass, for instantiating elements with unrecognized categories.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'generic'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.GeomElement

Bases: Element

The base class for geometric elements, which support bindings to geometries and geometric collections.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getCollection(self: MaterialX.PyMaterialXCore.GeomElement) MaterialX_v1_39_5::Collection

Return the Collection that is assigned to this element.

getCollectionString(self: MaterialX.PyMaterialXCore.GeomElement) str

Return the collection string of this element.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeom(self: MaterialX.PyMaterialXCore.GeomElement) str

Return the geometry string of this element.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasCollectionString(self: MaterialX.PyMaterialXCore.GeomElement) bool

Return true if this element has a collection string.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeom(self: MaterialX.PyMaterialXCore.GeomElement) bool

Return true if this element has a geometry string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setCollection(self: MaterialX.PyMaterialXCore.GeomElement, arg0: MaterialX_v1_39_5::Collection) None

Assign a Collection to this element.

setCollectionString(self: MaterialX.PyMaterialXCore.GeomElement, arg0: str) None

Set the collection string of this element.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeom(self: MaterialX.PyMaterialXCore.GeomElement, arg0: str) None

Set the geometry string of this element.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.GeomInfo

Bases: GeomElement

A geometry info element within a Document.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addGeomAttr(name)

(Deprecated) Add a geomprop to this element.

addGeomProp(self: MaterialX.PyMaterialXCore.GeomInfo, arg0: str) MaterialX_v1_39_5::GeomProp

Add a GeomProp to this element.

Parameters:

name – The name of the new GeomProp. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new GeomProp.

addToken(self: MaterialX.PyMaterialXCore.GeomInfo, name: str = 'color3') MaterialX.PyMaterialXCore.Token

Add a Token to this element.

Parameters:

name – The name of the new Token. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Token.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getCollection(self: MaterialX.PyMaterialXCore.GeomElement) MaterialX_v1_39_5::Collection

Return the Collection that is assigned to this element.

getCollectionString(self: MaterialX.PyMaterialXCore.GeomElement) str

Return the collection string of this element.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeom(self: MaterialX.PyMaterialXCore.GeomElement) str

Return the geometry string of this element.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getGeomProp(self: MaterialX.PyMaterialXCore.GeomInfo, arg0: str) MaterialX_v1_39_5::GeomProp

Return the GeomProp, if any, with the given name.

getGeomProps(self: MaterialX.PyMaterialXCore.GeomInfo) list[MaterialX_v1_39_5::GeomProp]

Return a vector of all GeomProp elements.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getToken(self: MaterialX.PyMaterialXCore.GeomInfo, arg0: str) MaterialX.PyMaterialXCore.Token

Return the Token, if any, with the given name.

getTokens(self: MaterialX.PyMaterialXCore.GeomInfo) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasCollectionString(self: MaterialX.PyMaterialXCore.GeomElement) bool

Return true if this element has a collection string.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeom(self: MaterialX.PyMaterialXCore.GeomElement) bool

Return true if this element has a geometry string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeGeomProp(self: MaterialX.PyMaterialXCore.GeomInfo, arg0: str) None

Remove the GeomProp, if any, with the given name.

removeToken(self: MaterialX.PyMaterialXCore.GeomInfo, arg0: str) None

Remove the Token, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setCollection(self: MaterialX.PyMaterialXCore.GeomElement, arg0: MaterialX_v1_39_5::Collection) None

Assign a Collection to this element.

setCollectionString(self: MaterialX.PyMaterialXCore.GeomElement, arg0: str) None

Set the collection string of this element.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeom(self: MaterialX.PyMaterialXCore.GeomElement, arg0: str) None

Set the geometry string of this element.

setGeomAttrValue(name, value, typeString='')

(Deprecated) Set the value of a geomattr by its name.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setGeomPropValue(name, value, typeString='')

Set the value of a geomprop by its name, creating a child element to hold the geomprop if needed.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setTokenValue(self: MaterialX.PyMaterialXCore.GeomInfo, arg0: str, arg1: str) MaterialX.PyMaterialXCore.Token

Set the string value of a Token by its name, creating a child element to hold the Token if needed.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'geominfo'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.GeomProp

Bases: ValueElement

A geometric property element within a GeomInfo.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit defined by the associated NodeDef if this element is a child of a Node.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDefaultValue()

Return the default value for this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the implementation name of an element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the interface name of an element.

getIsUniform(self: MaterialX.PyMaterialXCore.ValueElement) bool

The the uniform attribute flag for this element.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getResolvedValueString(self: MaterialX.PyMaterialXCore.ValueElement, resolver: MaterialX_v1_39_5::StringResolver = None) str

Return the resolved value string of an element, applying any string substitutions that are defined at the element’s scope.

Parameters:

resolver – An optional string resolver, which will be used to apply string substitutions. By default, a new string resolver will be created at this scope and applied to the return value.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit string of an element.

getUnitType(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit type of an element.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getValue()

Return the typed value of an element.

getValueString(self: MaterialX.PyMaterialXCore.ValueElement) str

Get the value string of a element.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an implementation name.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an interface name.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasUnit(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit string.

hasUnitType(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit type.

hasValueString(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a value string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setImplementationName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the implementation name of an element.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the interface name of an element.

setIsUniform(self: MaterialX.PyMaterialXCore.ValueElement, arg0: bool) None

Set the uniform attribute flag on this element.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setUnit(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit string of an element.

setUnitType(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit type of an element.

setValue(value, typeString='')

Set the typed value of an element.

setValueString(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the value string of an element.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'geomprop'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
ENUM_ATTRIBUTE = 'enum'
ENUM_VALUES_ATTRIBUTE = 'enumvalues'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
IMPLEMENTATION_NAME_ATTRIBUTE = 'implname'
IMPLEMENTATION_TYPE_ATTRIBUTE = 'impltype'
INHERIT_ATTRIBUTE = 'inherit'
INTERFACE_NAME_ATTRIBUTE = 'interfacename'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
UI_ADVANCED_ATTRIBUTE = 'uiadvanced'
UI_FOLDER_ATTRIBUTE = 'uifolder'
UI_MAX_ATTRIBUTE = 'uimax'
UI_MIN_ATTRIBUTE = 'uimin'
UI_NAME_ATTRIBUTE = 'uiname'
UI_SOFT_MAX_ATTRIBUTE = 'uisoftmax'
UI_SOFT_MIN_ATTRIBUTE = 'uisoftmin'
UI_STEP_ATTRIBUTE = 'uistep'
UNIT_ATTRIBUTE = 'unit'
VALUE_ATTRIBUTE = 'value'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.GeomPropDef

Bases: TypedElement

An element representing a declaration of geometric property data.

A GeomPropDef element contains a reference to a geometric node and a set of modifiers for that node. For example, a world-space normal can be declared as a reference to the “normal” geometric node with a space setting of “world”, or a specific set of texture coordinates can be declared as a reference to the “texcoord” geometric node with an index setting of “1”.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getGeomProp(*args, **kwargs)

Overloaded function.

  1. getGeomProp(self: MaterialX.PyMaterialXCore.GeomPropDef) -> str

Return the geometric property string of this element.

  1. getGeomProp(self: MaterialX.PyMaterialXCore.GeomPropDef) -> str

Return the geometric property string of this element.

getIndex(self: MaterialX.PyMaterialXCore.GeomPropDef) str

Return the index string of this element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getSpace(self: MaterialX.PyMaterialXCore.GeomPropDef) str

Return the geometric space string of this element.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasGeomProp(*args, **kwargs)

Overloaded function.

  1. hasGeomProp(self: MaterialX.PyMaterialXCore.GeomPropDef) -> bool

Return true if this element has a geometric property string.

  1. hasGeomProp(self: MaterialX.PyMaterialXCore.GeomPropDef) -> bool

Return true if this element has a geometric property string.

hasIndex(self: MaterialX.PyMaterialXCore.GeomPropDef) bool

Return true if this element has an index string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasSpace(self: MaterialX.PyMaterialXCore.GeomPropDef) bool

Return true if this element has a geometric space string.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setGeomProp(*args, **kwargs)

Overloaded function.

  1. setGeomProp(self: MaterialX.PyMaterialXCore.GeomPropDef, arg0: str) -> None

Set the geometric property string of this element.

  1. setGeomProp(self: MaterialX.PyMaterialXCore.GeomPropDef, arg0: str) -> None

Set the geometric property string of this element.

setIndex(self: MaterialX.PyMaterialXCore.GeomPropDef, arg0: str) None

Set the index string of this element.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setSpace(self: MaterialX.PyMaterialXCore.GeomPropDef, arg0: str) None

Set the geometric space string of this element.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'geompropdef'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.GraphElement

Bases: InterfaceElement

The base class for graph elements such as NodeGraph and Document.

addBackdrop(self: MaterialX.PyMaterialXCore.GraphElement, name: str = '') MaterialX_v1_39_5::Backdrop

Add a Backdrop to the graph.

addBindInput(name, type='color3')

(Deprecated) Add a BindInput to this shader reference.

addBindParam(name, type='color3')

(Deprecated) Add a BindParam to this shader reference.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addGeomNode(self: MaterialX.PyMaterialXCore.GraphElement, arg0: MaterialX.PyMaterialXCore.GeomPropDef, arg1: str) MaterialX.PyMaterialXCore.Node

If not yet present, add a geometry node to this graph matching the given property definition and name prefix.

addInput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Input

Add an Input to this interface.

Parameters:
  • name – The name of the new Input. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Input.

addMaterialNode(self: MaterialX.PyMaterialXCore.GraphElement, name: str = '', shaderNode: MaterialX.PyMaterialXCore.Node = None) MaterialX.PyMaterialXCore.Node

Add a material node to the graph, optionally connecting it to the given shader node.

addNode(self: MaterialX.PyMaterialXCore.GraphElement, category: str, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Node

Add a Node to the graph.

Parameters:
  • category – The category of the new Node.

  • name – The name of the new Node. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Node.

addNodeInstance(self: MaterialX.PyMaterialXCore.GraphElement, nodeDef: MaterialX.PyMaterialXCore.NodeDef, name: str = '') MaterialX.PyMaterialXCore.Node

Add a Node that is an instance of the given NodeDef.

addOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Output

Add an Output to this interface.

Parameters:
  • name – The name of the new Output. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Output.

addParameter(name)

(Deprecated) Add a Parameter to this interface.

addToken(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = 'color3') MaterialX.PyMaterialXCore.Token

Add a Token to this interface.

Parameters:

name – The name of the new Token. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Token.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

asStringDot(self: MaterialX.PyMaterialXCore.GraphElement) str

Convert this graph to a string in the DOT language syntax.

This can be used to visualise the graph using GraphViz (http://www.graphviz.org).

If declarations for the contained nodes are provided as nodedefs in the owning document, then they will be used to provide additional formatting details.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.InterfaceElement) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

flattenSubgraphs(self: MaterialX.PyMaterialXCore.GraphElement, target: str = '', filter: collections.abc.Callable[[MaterialX.PyMaterialXCore.Node], bool] = None) None

Flatten all subgraphs at the root scope of this graph element, recursively replacing each graph-defined node with its equivalent node network.

Parameters:
  • target – An optional target string to be used in specifying which node definitions are used in this process.

  • filter – An optional node predicate specifying which nodes should be included and excluded from this process.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the first Input with the given name that belongs to this interface, taking interface inheritance into account.

getActiveInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements that belong to this interface, taking inheritance into account.

getActiveOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the first Output with the given name that belongs to this interface, taking interface inheritance into account.

getActiveOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements that belong to this interface, taking inheritance into account.

getActiveParameters()

(Deprecated) Return a vector of all parameters belonging to this interface, taking inheritance into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the first Token with the given name that belongs to this interface, taking interface inheritance into account.

getActiveTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements that belong to this interface, taking inheritance into account.

getActiveValueElement(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.ValueElement

Return the first value element with the given name that belongs to this interface, taking interface inheritance into account.

Examples of value elements are Input, Output, and Token.

getActiveValueElements(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.ValueElement]

Return a vector of all value elements that belong to this interface, taking inheritance into account.

Examples of value elements are Input, Output, and Token.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getBackdrop(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) MaterialX_v1_39_5::Backdrop

Return the Backdrop, if any, with the given name.

getBackdrops(self: MaterialX.PyMaterialXCore.GraphElement) list[MaterialX_v1_39_5::Backdrop]

Return a vector of all Backdrop elements in the graph.

getBindInputs()

(Deprecated) Return a vector of all BindInput elements in this shader reference.

getBindParams()

(Deprecated) Return a vector of all BindParam elements in this shader reference.

getBindTokens()

(Deprecated) Return a vector of all BindToken elements in this shader reference.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the output connected to the given input.

If the given input is not present, then an empty OutputPtr is returned.

getDeclaration(self: MaterialX.PyMaterialXCore.InterfaceElement, target: str = '') MaterialX.PyMaterialXCore.InterfaceElement

Return the first declaration of this interface, optionally filtered by the given target name.

Parameters:

target – An optional target name, which will be used to filter the declarations that are considered.

Returns:

A shared pointer to declaration, or an empty shared pointer if no declaration was found.

getDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return the default version flag of this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the Input, if any, with the given name.

getInputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Input elements.

getInputValue(name, target='')

Return the typed value of an input by its name, taking both the calling element and its declaration into account. If the given input is not found, then None is returned.

getInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements.

getMaterialNodes(self: MaterialX.PyMaterialXCore.GraphElement) list[MaterialX.PyMaterialXCore.Node]

Return a vector of all material nodes.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getNode(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) MaterialX.PyMaterialXCore.Node

Return the Node, if any, with the given name.

getNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the NodeDef string for the interface.

getNodes(self: MaterialX.PyMaterialXCore.GraphElement, category: str = '') list[MaterialX.PyMaterialXCore.Node]

Return a vector of all Nodes in the graph, optionally filtered by the given category string.

getOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the Output, if any, with the given name.

getOutputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Output elements.

getOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements.

getParameterValue(name, target='')

(Deprecated) Return the typed value of a parameter by its name.

getParameterValueString(name)

(Deprecated) Return the value string of a parameter by its name.

getParameters()

(Deprecated) Return a vector of all Parameter elements.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the target string of this interface.

getToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the Token, if any, with the given name.

getTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) str

Return the string value of a Token by its name, or an empty string if the given Token is not present.

getTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement) tuple[int, int]

Return the major and minor versions as an integer pair.

getVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the version string of this interface.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasExactInputMatch(self: MaterialX.PyMaterialXCore.InterfaceElement, declaration: MaterialX.PyMaterialXCore.InterfaceElement, message: str = None) bool

Return true if this instance has an exact input match with the given declaration, where each input of this the instance corresponds to a declaration input of the same name and type.

If an exact input match is not found, and the optional message argument is provided, then an error message will be appended to the given string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a NodeDef string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a target string.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if this interface has a version string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeBackdrop(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) None

Remove the Backdrop, if any, with the given name.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Input, if any, with the given name.

removeNode(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) None

Remove the Node, if any, with the given name.

removeOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Output, if any, with the given name.

removeToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Token, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: MaterialX.PyMaterialXCore.Output) None

Set the output to which the given input is connected, creating a child input if needed.

If the output argument is null, then any existing output connection on the input will be cleared.

setDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: bool) None

Set the default version flag of this element.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInputValue(name, value, typeString='')

Set the typed value of an input by its name, creating a child element to hold the input if needed.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the NodeDef string for the interface.

setParameterValue(name, value, typeString='')

(Deprecated) Set the typed value of a parameter by its name.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setTarget(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the target string of this interface.

setTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: str) MaterialX.PyMaterialXCore.Token

Set the string value of a Token by its name, creating a child element to hold the Token if needed.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: SupportsInt, arg1: SupportsInt) None

Set the major and minor versions as an integer pair.

setVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the version string of this interface.

topologicalSort(self: MaterialX.PyMaterialXCore.GraphElement) list[MaterialX.PyMaterialXCore.Element]

Return a vector of all children (nodes and outputs) sorted in topological order.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
NODE_DEF_ATTRIBUTE = 'nodedef'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.GraphIterator

Bases: pybind11_object

An iterator object representing the state of an upstream graph traversal.

getConnectingElement(self: MaterialX.PyMaterialXCore.GraphIterator) MaterialX.PyMaterialXCore.Element

Return the connecting element, if any, of the current edge.

getDownstreamElement(self: MaterialX.PyMaterialXCore.GraphIterator) MaterialX.PyMaterialXCore.Element

Return the downstream element of the current edge.

getElementDepth(self: MaterialX.PyMaterialXCore.GraphIterator) int

Return the element depth of the current traversal, where a single edge between two elements represents a depth of one.

getNodeDepth(self: MaterialX.PyMaterialXCore.GraphIterator) int

Return the node depth of the current traversal, where a single edge between two nodes represents a depth of one.

getPruneSubgraph(self: MaterialX.PyMaterialXCore.GraphIterator) bool

Return the prune subgraph flag, which controls whether the current subgraph is pruned from traversal.

getUpstreamElement(self: MaterialX.PyMaterialXCore.GraphIterator) MaterialX.PyMaterialXCore.Element

Return the upstream element of the current edge.

getUpstreamIndex(self: MaterialX.PyMaterialXCore.GraphIterator) int

Return the index of the current edge within the range of upstream edges available to the downstream element.

setPruneSubgraph(self: MaterialX.PyMaterialXCore.GraphIterator, arg0: bool) None

Set the prune subgraph flag, which controls whether the current subgraph is pruned from traversal.

Parameters:

prune – If set to true, then the current subgraph will be pruned.

class MaterialX.PyMaterialXCore.Implementation

Bases: InterfaceElement

An implementation element within a Document.

An Implementation is used to associate external source code with a specific NodeDef, providing a definition for the node that may either be universal or restricted to a specific target.

addBindInput(name, type='color3')

(Deprecated) Add a BindInput to this shader reference.

addBindParam(name, type='color3')

(Deprecated) Add a BindParam to this shader reference.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addInput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Input

Add an Input to this interface.

Parameters:
  • name – The name of the new Input. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Input.

addOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Output

Add an Output to this interface.

Parameters:
  • name – The name of the new Output. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Output.

addParameter(name)

(Deprecated) Add a Parameter to this interface.

addToken(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = 'color3') MaterialX.PyMaterialXCore.Token

Add a Token to this interface.

Parameters:

name – The name of the new Token. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Token.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.InterfaceElement) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the first Input with the given name that belongs to this interface, taking interface inheritance into account.

getActiveInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements that belong to this interface, taking inheritance into account.

getActiveOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the first Output with the given name that belongs to this interface, taking interface inheritance into account.

getActiveOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements that belong to this interface, taking inheritance into account.

getActiveParameters()

(Deprecated) Return a vector of all parameters belonging to this interface, taking inheritance into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the first Token with the given name that belongs to this interface, taking interface inheritance into account.

getActiveTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements that belong to this interface, taking inheritance into account.

getActiveValueElement(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.ValueElement

Return the first value element with the given name that belongs to this interface, taking interface inheritance into account.

Examples of value elements are Input, Output, and Token.

getActiveValueElements(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.ValueElement]

Return a vector of all value elements that belong to this interface, taking inheritance into account.

Examples of value elements are Input, Output, and Token.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getBindInputs()

(Deprecated) Return a vector of all BindInput elements in this shader reference.

getBindParams()

(Deprecated) Return a vector of all BindParam elements in this shader reference.

getBindTokens()

(Deprecated) Return a vector of all BindToken elements in this shader reference.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the output connected to the given input.

If the given input is not present, then an empty OutputPtr is returned.

getDeclaration(self: MaterialX.PyMaterialXCore.InterfaceElement, target: str = '') MaterialX.PyMaterialXCore.InterfaceElement

Return the first declaration of this interface, optionally filtered by the given target name.

Parameters:

target – An optional target name, which will be used to filter the declarations that are considered.

Returns:

A shared pointer to declaration, or an empty shared pointer if no declaration was found.

getDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return the default version flag of this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFile(self: MaterialX.PyMaterialXCore.Implementation) str

Return the file string for the Implementation.

getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getFunction(self: MaterialX.PyMaterialXCore.Implementation) str

Return the function string for the Implementation.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the Input, if any, with the given name.

getInputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Input elements.

getInputValue(name, target='')

Return the typed value of an input by its name, taking both the calling element and its declaration into account. If the given input is not found, then None is returned.

getInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getNodeDef(self: MaterialX.PyMaterialXCore.Implementation) MaterialX.PyMaterialXCore.NodeDef

Return the NodeDef element referenced by the Implementation.

getNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the NodeDef string for the interface.

getNodeGraph(self: MaterialX.PyMaterialXCore.Implementation) str

Return the nodegraph string for the Implementation.

getOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the Output, if any, with the given name.

getOutputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Output elements.

getOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements.

getParameterValue(name, target='')

(Deprecated) Return the typed value of a parameter by its name.

getParameterValueString(name)

(Deprecated) Return the value string of a parameter by its name.

getParameters()

(Deprecated) Return a vector of all Parameter elements.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the target string of this interface.

getToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the Token, if any, with the given name.

getTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) str

Return the string value of a Token by its name, or an empty string if the given Token is not present.

getTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement) tuple[int, int]

Return the major and minor versions as an integer pair.

getVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the version string of this interface.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasExactInputMatch(self: MaterialX.PyMaterialXCore.InterfaceElement, declaration: MaterialX.PyMaterialXCore.InterfaceElement, message: str = None) bool

Return true if this instance has an exact input match with the given declaration, where each input of this the instance corresponds to a declaration input of the same name and type.

If an exact input match is not found, and the optional message argument is provided, then an error message will be appended to the given string.

hasFile(self: MaterialX.PyMaterialXCore.Implementation) bool

Return true if the given Implementation has a file string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasFunction(self: MaterialX.PyMaterialXCore.Implementation) bool

Return true if the given Implementation has a function string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a NodeDef string.

hasNodeGraph(self: MaterialX.PyMaterialXCore.Implementation) bool

Return true if the given Implementation has a nodegraph string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a target string.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if this interface has a version string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Input, if any, with the given name.

removeOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Output, if any, with the given name.

removeToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Token, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: MaterialX.PyMaterialXCore.Output) None

Set the output to which the given input is connected, creating a child input if needed.

If the output argument is null, then any existing output connection on the input will be cleared.

setDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: bool) None

Set the default version flag of this element.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFile(self: MaterialX.PyMaterialXCore.Implementation, arg0: str) None

Set the file string for the Implementation.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setFunction(self: MaterialX.PyMaterialXCore.Implementation, arg0: str) None

Set the function string for the Implementation.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInputValue(name, value, typeString='')

Set the typed value of an input by its name, creating a child element to hold the input if needed.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setNodeDef(self: MaterialX.PyMaterialXCore.Implementation, arg0: MaterialX.PyMaterialXCore.NodeDef) None

Set the NodeDef element referenced by the Implementation.

setNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the NodeDef string for the interface.

setNodeGraph(self: MaterialX.PyMaterialXCore.Implementation, arg0: str) None

Set the nodegraph string for the Implementation.

setParameterValue(name, value, typeString='')

(Deprecated) Set the typed value of a parameter by its name.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setTarget(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the target string of this interface.

setTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: str) MaterialX.PyMaterialXCore.Token

Set the string value of a Token by its name, creating a child element to hold the Token if needed.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: SupportsInt, arg1: SupportsInt) None

Set the major and minor versions as an integer pair.

setVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the version string of this interface.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'implementation'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_ATTRIBUTE = 'file'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
FUNCTION_ATTRIBUTE = 'function'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
NODE_DEF_ATTRIBUTE = 'nodedef'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.InheritanceIterator

Bases: pybind11_object

An iterator object representing the current state of an inheritance traversal.

class MaterialX.PyMaterialXCore.Input

Bases: PortElement

An input element within a Node or NodeDef.

An Input holds either a uniform value or a connection to a spatially-varying Output, either of which may be modified within the scope of a Material.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit defined by the associated NodeDef if this element is a child of a Node.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getConnectedNode(self: MaterialX.PyMaterialXCore.Input) MaterialX_v1_39_5::Node

Return the node, if any, to which this input is connected.

getConnectedOutput(self: MaterialX.PyMaterialXCore.PortElement) MaterialX_v1_39_5::Output

Return the output, if any, to which this input is connected.

getDefaultGeomProp(self: MaterialX.PyMaterialXCore.Input) MaterialX_v1_39_5::GeomPropDef

Return the GeomPropDef element to use, if defined for this input.

getDefaultGeomPropString(self: MaterialX.PyMaterialXCore.Input) str

Return the defaultgeomprop string for the input.

getDefaultValue()

Return the default value for this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the implementation name of an element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInterfaceInput(self: MaterialX.PyMaterialXCore.Input) MaterialX.PyMaterialXCore.Input

Return the input on the parent graph corresponding to the interface name for this input.

getInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the interface name of an element.

getIsUniform(self: MaterialX.PyMaterialXCore.ValueElement) bool

The the uniform attribute flag for this element.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getNodeGraphString(self: MaterialX.PyMaterialXCore.PortElement) str

Return the node graph string of this element.

getNodeName(self: MaterialX.PyMaterialXCore.PortElement) str

Return the node name string of this element.

getOutputString(self: MaterialX.PyMaterialXCore.PortElement) str

Return the output string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getResolvedValueString(self: MaterialX.PyMaterialXCore.ValueElement, resolver: MaterialX_v1_39_5::StringResolver = None) str

Return the resolved value string of an element, applying any string substitutions that are defined at the element’s scope.

Parameters:

resolver – An optional string resolver, which will be used to apply string substitutions. By default, a new string resolver will be created at this scope and applied to the return value.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit string of an element.

getUnitType(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit type of an element.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getValue()

Return the typed value of an element.

getValueString(self: MaterialX.PyMaterialXCore.ValueElement) str

Get the value string of a element.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasDefaultGeomPropString(self: MaterialX.PyMaterialXCore.Input) bool

Return true if the given input has a defaultgeomprop string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an implementation name.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an interface name.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasNodeGraphString(self: MaterialX.PyMaterialXCore.PortElement) bool

Return true if this element has a node graph string.

hasOutputString(self: MaterialX.PyMaterialXCore.PortElement) bool

Return true if this element has an output string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasUnit(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit string.

hasUnitType(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit type.

hasValueString(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a value string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setConnectedInterfaceName(self: MaterialX.PyMaterialXCore.Input, arg0: str) None

Connects this input to a corresponding interface with the given name.

If the interface name specified is an empty string then any existing connection is removed.

setConnectedNode(self: MaterialX.PyMaterialXCore.PortElement, arg0: MaterialX_v1_39_5::Node) None

Set the node to which this element is connected.

The given node must belong to the same node graph. If the node argument is null, then any existing node connection will be cleared.

setConnectedOutput(self: MaterialX.PyMaterialXCore.PortElement, arg0: MaterialX_v1_39_5::Output) None

Set the output to which this input is connected.

If the output argument is null, then any existing output connection will be cleared.

setDefaultGeomPropString(self: MaterialX.PyMaterialXCore.Input, arg0: str) None

Set the defaultgeomprop string for the input.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setImplementationName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the implementation name of an element.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the interface name of an element.

setIsUniform(self: MaterialX.PyMaterialXCore.ValueElement, arg0: bool) None

Set the uniform attribute flag on this element.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setNodeGraphString(self: MaterialX.PyMaterialXCore.PortElement, arg0: str) None

Set the node graph string of this element.

setNodeName(self: MaterialX.PyMaterialXCore.PortElement, arg0: str) None

Set the node name string of this element, creating a connection to the Node with the given name within the same NodeGraph.

setOutputString(self: MaterialX.PyMaterialXCore.PortElement, arg0: str) None

Set the output string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setUnit(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit string of an element.

setUnitType(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit type of an element.

setValue(value, typeString='')

Set the typed value of an element.

setValueString(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the value string of an element.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'input'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
ENUM_ATTRIBUTE = 'enum'
ENUM_VALUES_ATTRIBUTE = 'enumvalues'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
IMPLEMENTATION_NAME_ATTRIBUTE = 'implname'
IMPLEMENTATION_TYPE_ATTRIBUTE = 'impltype'
INHERIT_ATTRIBUTE = 'inherit'
INTERFACE_NAME_ATTRIBUTE = 'interfacename'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
UI_ADVANCED_ATTRIBUTE = 'uiadvanced'
UI_FOLDER_ATTRIBUTE = 'uifolder'
UI_MAX_ATTRIBUTE = 'uimax'
UI_MIN_ATTRIBUTE = 'uimin'
UI_NAME_ATTRIBUTE = 'uiname'
UI_SOFT_MAX_ATTRIBUTE = 'uisoftmax'
UI_SOFT_MIN_ATTRIBUTE = 'uisoftmin'
UI_STEP_ATTRIBUTE = 'uistep'
UNIT_ATTRIBUTE = 'unit'
VALUE_ATTRIBUTE = 'value'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.InterfaceElement

Bases: TypedElement

The base class for interface elements such as Node, NodeDef, and NodeGraph.

An InterfaceElement supports a set of Input and Output elements, with an API for setting their values.

addBindInput(name, type='color3')

(Deprecated) Add a BindInput to this shader reference.

addBindParam(name, type='color3')

(Deprecated) Add a BindParam to this shader reference.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addInput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Input

Add an Input to this interface.

Parameters:
  • name – The name of the new Input. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Input.

addOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Output

Add an Output to this interface.

Parameters:
  • name – The name of the new Output. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Output.

addParameter(name)

(Deprecated) Add a Parameter to this interface.

addToken(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = 'color3') MaterialX.PyMaterialXCore.Token

Add a Token to this interface.

Parameters:

name – The name of the new Token. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Token.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.InterfaceElement) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the first Input with the given name that belongs to this interface, taking interface inheritance into account.

getActiveInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements that belong to this interface, taking inheritance into account.

getActiveOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the first Output with the given name that belongs to this interface, taking interface inheritance into account.

getActiveOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements that belong to this interface, taking inheritance into account.

getActiveParameters()

(Deprecated) Return a vector of all parameters belonging to this interface, taking inheritance into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the first Token with the given name that belongs to this interface, taking interface inheritance into account.

getActiveTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements that belong to this interface, taking inheritance into account.

getActiveValueElement(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.ValueElement

Return the first value element with the given name that belongs to this interface, taking interface inheritance into account.

Examples of value elements are Input, Output, and Token.

getActiveValueElements(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.ValueElement]

Return a vector of all value elements that belong to this interface, taking inheritance into account.

Examples of value elements are Input, Output, and Token.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getBindInputs()

(Deprecated) Return a vector of all BindInput elements in this shader reference.

getBindParams()

(Deprecated) Return a vector of all BindParam elements in this shader reference.

getBindTokens()

(Deprecated) Return a vector of all BindToken elements in this shader reference.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the output connected to the given input.

If the given input is not present, then an empty OutputPtr is returned.

getDeclaration(self: MaterialX.PyMaterialXCore.InterfaceElement, target: str = '') MaterialX.PyMaterialXCore.InterfaceElement

Return the first declaration of this interface, optionally filtered by the given target name.

Parameters:

target – An optional target name, which will be used to filter the declarations that are considered.

Returns:

A shared pointer to declaration, or an empty shared pointer if no declaration was found.

getDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return the default version flag of this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the Input, if any, with the given name.

getInputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Input elements.

getInputValue(name, target='')

Return the typed value of an input by its name, taking both the calling element and its declaration into account. If the given input is not found, then None is returned.

getInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the NodeDef string for the interface.

getOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the Output, if any, with the given name.

getOutputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Output elements.

getOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements.

getParameterValue(name, target='')

(Deprecated) Return the typed value of a parameter by its name.

getParameterValueString(name)

(Deprecated) Return the value string of a parameter by its name.

getParameters()

(Deprecated) Return a vector of all Parameter elements.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the target string of this interface.

getToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the Token, if any, with the given name.

getTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) str

Return the string value of a Token by its name, or an empty string if the given Token is not present.

getTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement) tuple[int, int]

Return the major and minor versions as an integer pair.

getVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the version string of this interface.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasExactInputMatch(self: MaterialX.PyMaterialXCore.InterfaceElement, declaration: MaterialX.PyMaterialXCore.InterfaceElement, message: str = None) bool

Return true if this instance has an exact input match with the given declaration, where each input of this the instance corresponds to a declaration input of the same name and type.

If an exact input match is not found, and the optional message argument is provided, then an error message will be appended to the given string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a NodeDef string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a target string.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if this interface has a version string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Input, if any, with the given name.

removeOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Output, if any, with the given name.

removeToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Token, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: MaterialX.PyMaterialXCore.Output) None

Set the output to which the given input is connected, creating a child input if needed.

If the output argument is null, then any existing output connection on the input will be cleared.

setDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: bool) None

Set the default version flag of this element.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInputValue(name, value, typeString='')

Set the typed value of an input by its name, creating a child element to hold the input if needed.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the NodeDef string for the interface.

setParameterValue(name, value, typeString='')

(Deprecated) Set the typed value of a parameter by its name.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setTarget(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the target string of this interface.

setTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: str) MaterialX.PyMaterialXCore.Token

Set the string value of a Token by its name, creating a child element to hold the Token if needed.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: SupportsInt, arg1: SupportsInt) None

Set the major and minor versions as an integer pair.

setVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the version string of this interface.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
NODE_DEF_ATTRIBUTE = 'nodedef'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.LinearUnitConverter

Bases: UnitConverter

A converter class for linear units that require only a scalar multiplication.

static create(arg0: MaterialX.PyMaterialXCore.UnitTypeDef) MaterialX.PyMaterialXCore.LinearUnitConverter

Creator.

convert(*args, **kwargs)

Overloaded function.

  1. convert(self: MaterialX.PyMaterialXCore.LinearUnitConverter, arg0: typing.SupportsFloat, arg1: str, arg2: str) -> float

  2. convert(self: MaterialX.PyMaterialXCore.LinearUnitConverter, arg0: MaterialX.PyMaterialXCore.Vector2, arg1: str, arg2: str) -> MaterialX.PyMaterialXCore.Vector2

  3. convert(self: MaterialX.PyMaterialXCore.LinearUnitConverter, arg0: MaterialX.PyMaterialXCore.Vector3, arg1: str, arg2: str) -> MaterialX.PyMaterialXCore.Vector3

  4. convert(self: MaterialX.PyMaterialXCore.LinearUnitConverter, arg0: MaterialX.PyMaterialXCore.Vector4, arg1: str, arg2: str) -> MaterialX.PyMaterialXCore.Vector4

getUnitAsInteger(self: MaterialX.PyMaterialXCore.LinearUnitConverter, arg0: str) int

Given a unit name return a value that it can map to as an integer.

Returns -1 value if not found

getUnitFromInteger(self: MaterialX.PyMaterialXCore.LinearUnitConverter, arg0: SupportsInt) str

Given an integer index return the unit name in the map used by the converter.

Returns Empty string if not found

getUnitScale(self: MaterialX.PyMaterialXCore.LinearUnitConverter) dict[str, float]

Return the mappings from unit names to the scale value defined by a linear converter.

class MaterialX.PyMaterialXCore.Look

Bases: Element

A look element within a Document.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addMaterialAssign(self: MaterialX.PyMaterialXCore.Look, name: str = '', material: str = '') MaterialX_v1_39_5::MaterialAssign

Add a MaterialAssign to the look.

Parameters:
  • name – The name of the new MaterialAssign. If no name is specified, then a unique name will automatically be generated.

  • material – An optional material string, which should match the name of the material node to be assigned.

Returns:

A shared pointer to the new MaterialAssign.

addPropertyAssign(self: MaterialX.PyMaterialXCore.Look, name: str = '') MaterialX.PyMaterialXCore.PropertyAssign

Add a PropertyAssign to the look.

Parameters:

name – The name of the new PropertyAssign. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new PropertyAssign.

addPropertySetAssign(self: MaterialX.PyMaterialXCore.Look, name: str = '') MaterialX.PyMaterialXCore.PropertySetAssign

Add a PropertySetAssign to the look.

Parameters:

name – The name of the new PropertySetAssign. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new PropertySetAssign.

addVariantAssign(self: MaterialX.PyMaterialXCore.Look, name: str = '') MaterialX_v1_39_5::VariantAssign

Add a VariantAssign to the look.

Parameters:

name – The name of the new VariantAssign. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new VariantAssign.

addVisibility(self: MaterialX.PyMaterialXCore.Look, name: str = '') MaterialX_v1_39_5::Visibility

Add a Visibility to the look.

Parameters:

name – The name of the new Visibility. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Visibility.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveMaterialAssigns(self: MaterialX.PyMaterialXCore.Look) list[MaterialX_v1_39_5::MaterialAssign]

Return a vector of all MaterialAssign elements that belong to this look, taking look inheritance into account.

getActivePropertyAssigns(self: MaterialX.PyMaterialXCore.Look) list[MaterialX.PyMaterialXCore.PropertyAssign]

Return a vector of all PropertyAssign elements that belong to this look, taking look inheritance into account.

getActivePropertySetAssigns(self: MaterialX.PyMaterialXCore.Look) list[MaterialX.PyMaterialXCore.PropertySetAssign]

Return a vector of all PropertySetAssign elements that belong to this look, taking look inheritance into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveVariantAssigns(self: MaterialX.PyMaterialXCore.Look) list[MaterialX_v1_39_5::VariantAssign]

Return a vector of all VariantAssign elements that belong to this look, taking look inheritance into account.

getActiveVisibilities(self: MaterialX.PyMaterialXCore.Look) list[MaterialX_v1_39_5::Visibility]

Return a vector of all Visibility elements that belong to this look, taking look inheritance into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getMaterialAssign(self: MaterialX.PyMaterialXCore.Look, arg0: str) MaterialX_v1_39_5::MaterialAssign

Return the MaterialAssign, if any, with the given name.

getMaterialAssigns(self: MaterialX.PyMaterialXCore.Look) list[MaterialX_v1_39_5::MaterialAssign]

Return a vector of all MaterialAssign elements in the look.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getPropertyAssign(self: MaterialX.PyMaterialXCore.Look, arg0: str) MaterialX.PyMaterialXCore.PropertyAssign

Return the PropertyAssign, if any, with the given name.

getPropertyAssigns(self: MaterialX.PyMaterialXCore.Look) list[MaterialX.PyMaterialXCore.PropertyAssign]

Return a vector of all PropertyAssign elements in the look.

getPropertySetAssign(self: MaterialX.PyMaterialXCore.Look, arg0: str) MaterialX.PyMaterialXCore.PropertySetAssign

Return the PropertySetAssign, if any, with the given name.

getPropertySetAssigns(self: MaterialX.PyMaterialXCore.Look) list[MaterialX.PyMaterialXCore.PropertySetAssign]

Return a vector of all PropertySetAssign elements in the look.

getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getVariantAssign(self: MaterialX.PyMaterialXCore.Look, arg0: str) MaterialX_v1_39_5::VariantAssign

Return the VariantAssign, if any, with the given name.

getVariantAssigns(self: MaterialX.PyMaterialXCore.Look) list[MaterialX_v1_39_5::VariantAssign]

Return a vector of all VariantAssign elements in the look.

getVisibilities(self: MaterialX.PyMaterialXCore.Look) list[MaterialX_v1_39_5::Visibility]

Return a vector of all Visibility elements in the look.

getVisibility(self: MaterialX.PyMaterialXCore.Look, arg0: str) MaterialX_v1_39_5::Visibility

Return the Visibility, if any, with the given name.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeMaterialAssign(self: MaterialX.PyMaterialXCore.Look, arg0: str) None

Remove the MaterialAssign, if any, with the given name.

removePropertyAssign(self: MaterialX.PyMaterialXCore.Look, arg0: str) None

Remove the PropertyAssign, if any, with the given name.

removePropertySetAssign(self: MaterialX.PyMaterialXCore.Look, arg0: str) None

Remove the PropertySetAssign, if any, with the given name.

removeVariantAssign(self: MaterialX.PyMaterialXCore.Look, arg0: str) None

Remove the VariantAssign, if any, with the given name.

removeVisibility(self: MaterialX.PyMaterialXCore.Look, arg0: str) None

Remove the Visibility, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'look'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.LookGroup

Bases: Element

A look group element within a Document.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveLook(self: MaterialX.PyMaterialXCore.LookGroup) str

Return the active look, if any.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getLooks(self: MaterialX.PyMaterialXCore.LookGroup) str

Get comma-separated list of looks.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setActiveLook(self: MaterialX.PyMaterialXCore.LookGroup, arg0: str) None

Set the active look.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setLooks(self: MaterialX.PyMaterialXCore.LookGroup, arg0: str) None

Set comma-separated list of looks.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

ACTIVE_ATTRIBUTE = 'active'
CATEGORY = 'lookgroup'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
LOOKS_ATTRIBUTE = 'looks'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.MaterialAssign

Bases: GeomElement

A material assignment element within a Look.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getCollection(self: MaterialX.PyMaterialXCore.GeomElement) MaterialX_v1_39_5::Collection

Return the Collection that is assigned to this element.

getCollectionString(self: MaterialX.PyMaterialXCore.GeomElement) str

Return the collection string of this element.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getExclusive(self: MaterialX.PyMaterialXCore.MaterialAssign) bool

Return the exclusive boolean for the MaterialAssign.

getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeom(self: MaterialX.PyMaterialXCore.GeomElement) str

Return the geometry string of this element.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getMaterial(self: MaterialX.PyMaterialXCore.MaterialAssign) str

Return the material string for the MaterialAssign.

getMaterialOutputs(self: MaterialX.PyMaterialXCore.MaterialAssign) list[MaterialX.PyMaterialXCore.Output]

Return the outputs on any referenced material.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getReferencedMaterial(self: MaterialX.PyMaterialXCore.MaterialAssign) MaterialX_v1_39_5::Node

Return the material node, if any, referenced by the MaterialAssign.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasCollectionString(self: MaterialX.PyMaterialXCore.GeomElement) bool

Return true if this element has a collection string.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeom(self: MaterialX.PyMaterialXCore.GeomElement) bool

Return true if this element has a geometry string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasMaterial(self: MaterialX.PyMaterialXCore.MaterialAssign) bool

Return true if the given MaterialAssign has a material string.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setCollection(self: MaterialX.PyMaterialXCore.GeomElement, arg0: MaterialX_v1_39_5::Collection) None

Assign a Collection to this element.

setCollectionString(self: MaterialX.PyMaterialXCore.GeomElement, arg0: str) None

Set the collection string of this element.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setExclusive(self: MaterialX.PyMaterialXCore.MaterialAssign, arg0: bool) None

Set the exclusive boolean for the MaterialAssign.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeom(self: MaterialX.PyMaterialXCore.GeomElement, arg0: str) None

Set the geometry string of this element.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setMaterial(self: MaterialX.PyMaterialXCore.MaterialAssign, arg0: str) None

Set the material string for the MaterialAssign.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'materialassign'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Matrix33(*args, **kwargs)

Bases: MatrixBase

A 3x3 matrix of floating-point values.

Vector transformation methods follow the row-vector convention, with matrix-vector multiplication computed as v’ = vM.

Overloaded function.

  1. __init__(self: MaterialX.PyMaterialXCore.Matrix33) -> None

  2. __init__(self: MaterialX.PyMaterialXCore.Matrix33, arg0: typing.SupportsFloat) -> None

  3. __init__(self: MaterialX.PyMaterialXCore.Matrix33, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat, arg3: typing.SupportsFloat, arg4: typing.SupportsFloat, arg5: typing.SupportsFloat, arg6: typing.SupportsFloat, arg7: typing.SupportsFloat, arg8: typing.SupportsFloat) -> None

static createRotation(arg0: SupportsFloat) MaterialX.PyMaterialXCore.Matrix33

Create a rotation matrix.

Parameters:

angle – Angle in radians

static createScale(arg0: MaterialX.PyMaterialXCore.Vector2) MaterialX.PyMaterialXCore.Matrix33
static createTranslation(arg0: MaterialX.PyMaterialXCore.Vector2) MaterialX.PyMaterialXCore.Matrix33
static numColumns() int
static numRows() int
copy(self: MaterialX.PyMaterialXCore.Matrix33) MaterialX.PyMaterialXCore.Matrix33
getAdjugate(self: MaterialX.PyMaterialXCore.Matrix33) MaterialX.PyMaterialXCore.Matrix33
getDeterminant(self: MaterialX.PyMaterialXCore.Matrix33) float
getInverse(self: MaterialX.PyMaterialXCore.Matrix33) MaterialX.PyMaterialXCore.Matrix33
getTranspose(self: MaterialX.PyMaterialXCore.Matrix33) MaterialX.PyMaterialXCore.Matrix33
isEquivalent(self: MaterialX.PyMaterialXCore.Matrix33, arg0: MaterialX.PyMaterialXCore.Matrix33, arg1: SupportsFloat) bool
multiply(self: MaterialX.PyMaterialXCore.Matrix33, arg0: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Vector3

Return the product of this matrix and a 3D vector.

transformNormal(self: MaterialX.PyMaterialXCore.Matrix33, arg0: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Vector3

Transform the given 3D normal vector.

transformPoint(self: MaterialX.PyMaterialXCore.Matrix33, arg0: MaterialX.PyMaterialXCore.Vector2) MaterialX.PyMaterialXCore.Vector2

Transform the given 2D point.

transformVector(self: MaterialX.PyMaterialXCore.Matrix33, arg0: MaterialX.PyMaterialXCore.Vector2) MaterialX.PyMaterialXCore.Vector2

Transform the given 2D direction vector.

IDENTITY = <MaterialX.PyMaterialXCore.Matrix33 object>
class MaterialX.PyMaterialXCore.Matrix44(*args, **kwargs)

Bases: MatrixBase

A 4x4 matrix of floating-point values.

Vector transformation methods follow the row-vector convention, with matrix-vector multiplication computed as v’ = vM.

Overloaded function.

  1. __init__(self: MaterialX.PyMaterialXCore.Matrix44) -> None

  2. __init__(self: MaterialX.PyMaterialXCore.Matrix44, arg0: typing.SupportsFloat) -> None

  3. __init__(self: MaterialX.PyMaterialXCore.Matrix44, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat, arg3: typing.SupportsFloat, arg4: typing.SupportsFloat, arg5: typing.SupportsFloat, arg6: typing.SupportsFloat, arg7: typing.SupportsFloat, arg8: typing.SupportsFloat, arg9: typing.SupportsFloat, arg10: typing.SupportsFloat, arg11: typing.SupportsFloat, arg12: typing.SupportsFloat, arg13: typing.SupportsFloat, arg14: typing.SupportsFloat, arg15: typing.SupportsFloat) -> None

static createRotationX(arg0: SupportsFloat) MaterialX.PyMaterialXCore.Matrix44

Create a rotation matrix about the X-axis.

Parameters:

angle – Angle in radians

static createRotationY(arg0: SupportsFloat) MaterialX.PyMaterialXCore.Matrix44

Create a rotation matrix about the Y-axis.

Parameters:

angle – Angle in radians

static createRotationZ(arg0: SupportsFloat) MaterialX.PyMaterialXCore.Matrix44

Create a rotation matrix about the Z-axis.

Parameters:

angle – Angle in radians

static createScale(arg0: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Matrix44
static createTranslation(arg0: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Matrix44
static numColumns() int
static numRows() int
copy(self: MaterialX.PyMaterialXCore.Matrix44) MaterialX.PyMaterialXCore.Matrix44
getAdjugate(self: MaterialX.PyMaterialXCore.Matrix44) MaterialX.PyMaterialXCore.Matrix44
getDeterminant(self: MaterialX.PyMaterialXCore.Matrix44) float
getInverse(self: MaterialX.PyMaterialXCore.Matrix44) MaterialX.PyMaterialXCore.Matrix44
getTranspose(self: MaterialX.PyMaterialXCore.Matrix44) MaterialX.PyMaterialXCore.Matrix44
isEquivalent(self: MaterialX.PyMaterialXCore.Matrix44, arg0: MaterialX.PyMaterialXCore.Matrix44, arg1: SupportsFloat) bool
multiply(self: MaterialX.PyMaterialXCore.Matrix44, arg0: MaterialX.PyMaterialXCore.Vector4) MaterialX.PyMaterialXCore.Vector4

Return the product of this matrix and a 4D vector.

transformNormal(self: MaterialX.PyMaterialXCore.Matrix44, arg0: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Vector3

Transform the given 3D normal vector.

transformPoint(self: MaterialX.PyMaterialXCore.Matrix44, arg0: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Vector3

Transform the given 3D point.

transformVector(self: MaterialX.PyMaterialXCore.Matrix44, arg0: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Vector3

Transform the given 3D direction vector.

IDENTITY = <MaterialX.PyMaterialXCore.Matrix44 object>
class MaterialX.PyMaterialXCore.MatrixBase

Bases: pybind11_object

The base class for square matrices of scalar values.

class MaterialX.PyMaterialXCore.Member

Bases: TypedElement

A member element within a TypeDef.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'typedef'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.NewlineElement

Bases: Element

An element representing a newline within a document.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'newline'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Node

Bases: InterfaceElement

A node element within a NodeGraph or Document.

A Node represents an instance of a NodeDef within a graph, and its Input elements apply specific values and connections to that instance.

addBindInput(name, type='color3')

(Deprecated) Add a BindInput to this shader reference.

addBindParam(name, type='color3')

(Deprecated) Add a BindParam to this shader reference.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addInput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Input

Add an Input to this interface.

Parameters:
  • name – The name of the new Input. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Input.

addInputFromNodeDef(self: MaterialX.PyMaterialXCore.Node, arg0: str) MaterialX.PyMaterialXCore.Input

Add an input based on the corresponding input for the associated node definition.

If the input already exists on the node it will just be returned.

addInputsFromNodeDef(self: MaterialX.PyMaterialXCore.Node) None

Add inputs based on the corresponding associated node definition.

addOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Output

Add an Output to this interface.

Parameters:
  • name – The name of the new Output. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Output.

addParameter(name)

(Deprecated) Add a Parameter to this interface.

addShaderRef(name, nodeName)

(Deprecated) Add a shader reference to this material element.

addToken(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = 'color3') MaterialX.PyMaterialXCore.Token

Add a Token to this interface.

Parameters:

name – The name of the new Token. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Token.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.InterfaceElement) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the first Input with the given name that belongs to this interface, taking interface inheritance into account.

getActiveInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements that belong to this interface, taking inheritance into account.

getActiveOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the first Output with the given name that belongs to this interface, taking interface inheritance into account.

getActiveOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements that belong to this interface, taking inheritance into account.

getActiveParameters()

(Deprecated) Return a vector of all parameters belonging to this interface, taking inheritance into account.

getActiveShaderRefs()

(Deprecated) Return a vector of all shader references in this material element, taking material inheritance into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the first Token with the given name that belongs to this interface, taking interface inheritance into account.

getActiveTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements that belong to this interface, taking inheritance into account.

getActiveValueElement(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.ValueElement

Return the first value element with the given name that belongs to this interface, taking interface inheritance into account.

Examples of value elements are Input, Output, and Token.

getActiveValueElements(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.ValueElement]

Return a vector of all value elements that belong to this interface, taking inheritance into account.

Examples of value elements are Input, Output, and Token.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getBindInputs()

(Deprecated) Return a vector of all BindInput elements in this shader reference.

getBindParams()

(Deprecated) Return a vector of all BindParam elements in this shader reference.

getBindTokens()

(Deprecated) Return a vector of all BindToken elements in this shader reference.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getConnectedNode(self: MaterialX.PyMaterialXCore.Node, arg0: str) MaterialX.PyMaterialXCore.Node

Return the Node connected to the given input.

If the given input is not present, then an empty NodePtr is returned.

getConnectedNodeName(self: MaterialX.PyMaterialXCore.Node, arg0: str) str

Return the name of the Node connected to the given input.

If the given input is not present, then an empty string is returned.

getConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the output connected to the given input.

If the given input is not present, then an empty OutputPtr is returned.

getDeclaration(self: MaterialX.PyMaterialXCore.InterfaceElement, target: str = '') MaterialX.PyMaterialXCore.InterfaceElement

Return the first declaration of this interface, optionally filtered by the given target name.

Parameters:

target – An optional target name, which will be used to filter the declarations that are considered.

Returns:

A shared pointer to declaration, or an empty shared pointer if no declaration was found.

getDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return the default version flag of this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getDownstreamPorts(self: MaterialX.PyMaterialXCore.Node) list[MaterialX.PyMaterialXCore.PortElement]

Return a vector of all downstream ports that connect to this node, ordered by the names of the port elements.

getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getImplementation(self: MaterialX.PyMaterialXCore.Node, target: str = '') MaterialX.PyMaterialXCore.InterfaceElement

Return the first implementation for this node, optionally filtered by the given target and language names.

Parameters:

target – An optional target name, which will be used to filter the implementations that are considered.

Returns:

An implementation for this node, or an empty shared pointer if none was found. Note that a node implementation may be either an Implementation element or a NodeGraph element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the Input, if any, with the given name.

getInputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Input elements.

getInputValue(name, target='')

Return the typed value of an input by its name, taking both the calling element and its declaration into account. If the given input is not found, then None is returned.

getInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getNodeDef(self: MaterialX.PyMaterialXCore.Node, target: str = '', allowRoughMatch: bool = False) MaterialX.PyMaterialXCore.NodeDef

Return the first NodeDef that declares this node, optionally filtered by the given target name.

Parameters:
  • target – An optional target name, which will be used to filter the nodedefs that are considered.

  • allowRoughMatch – If specified, then a rough match will be allowed when an exact match is not found. An exact match requires that each node input corresponds to a nodedef input of the same name and type.

Returns:

A NodeDef for this node, or an empty shared pointer if none was found.

getNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the NodeDef string for the interface.

getOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the Output, if any, with the given name.

getOutputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Output elements.

getOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements.

getParameterValue(name, target='')

(Deprecated) Return the typed value of a parameter by its name.

getParameterValueString(name)

(Deprecated) Return the value string of a parameter by its name.

getParameters()

(Deprecated) Return a vector of all Parameter elements.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getReferencedNodeDef()

(Deprecated) Return the first NodeDef that declares this node.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getShaderRefs()

(Deprecated) Return a vector of all shader references in this material element.

getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the target string of this interface.

getToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the Token, if any, with the given name.

getTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) str

Return the string value of a Token by its name, or an empty string if the given Token is not present.

getTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement) tuple[int, int]

Return the major and minor versions as an integer pair.

getVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the version string of this interface.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasExactInputMatch(self: MaterialX.PyMaterialXCore.InterfaceElement, declaration: MaterialX.PyMaterialXCore.InterfaceElement, message: str = None) bool

Return true if this instance has an exact input match with the given declaration, where each input of this the instance corresponds to a declaration input of the same name and type.

If an exact input match is not found, and the optional message argument is provided, then an error message will be appended to the given string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a NodeDef string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a target string.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if this interface has a version string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Input, if any, with the given name.

removeOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Output, if any, with the given name.

removeToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Token, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setConnectedNode(self: MaterialX.PyMaterialXCore.Node, arg0: str, arg1: MaterialX.PyMaterialXCore.Node) None

Set the node to which the given input is connected, creating a child input if needed.

If the node argument is null, then any existing node connection on the input will be cleared.

setConnectedNodeName(self: MaterialX.PyMaterialXCore.Node, arg0: str, arg1: str) None

Set the name of the Node connected to the given input, creating a child element for the input if needed.

setConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: MaterialX.PyMaterialXCore.Output) None

Set the output to which the given input is connected, creating a child input if needed.

If the output argument is null, then any existing output connection on the input will be cleared.

setDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: bool) None

Set the default version flag of this element.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInputValue(name, value, typeString='')

Set the typed value of an input by its name, creating a child element to hold the input if needed.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the NodeDef string for the interface.

setParameterValue(name, value, typeString='')

(Deprecated) Set the typed value of a parameter by its name.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setTarget(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the target string of this interface.

setTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: str) MaterialX.PyMaterialXCore.Token

Set the string value of a Token by its name, creating a child element to hold the Token if needed.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: SupportsInt, arg1: SupportsInt) None

Set the major and minor versions as an integer pair.

setVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the version string of this interface.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'node'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
NODE_DEF_ATTRIBUTE = 'nodedef'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.NodeDef

Bases: InterfaceElement

A node definition element within a Document.

A NodeDef provides the declaration of a node interface, which may then be instantiated as a Node.

addBindInput(name, type='color3')

(Deprecated) Add a BindInput to this shader reference.

addBindParam(name, type='color3')

(Deprecated) Add a BindParam to this shader reference.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addInput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Input

Add an Input to this interface.

Parameters:
  • name – The name of the new Input. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Input.

addOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Output

Add an Output to this interface.

Parameters:
  • name – The name of the new Output. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Output.

addParameter(name)

(Deprecated) Add a Parameter to this interface.

addToken(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = 'color3') MaterialX.PyMaterialXCore.Token

Add a Token to this interface.

Parameters:

name – The name of the new Token. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Token.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.InterfaceElement) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the first Input with the given name that belongs to this interface, taking interface inheritance into account.

getActiveInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements that belong to this interface, taking inheritance into account.

getActiveOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the first Output with the given name that belongs to this interface, taking interface inheritance into account.

getActiveOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements that belong to this interface, taking inheritance into account.

getActiveParameters()

(Deprecated) Return a vector of all parameters belonging to this interface, taking inheritance into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the first Token with the given name that belongs to this interface, taking interface inheritance into account.

getActiveTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements that belong to this interface, taking inheritance into account.

getActiveValueElement(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.ValueElement

Return the first value element with the given name that belongs to this interface, taking interface inheritance into account.

Examples of value elements are Input, Output, and Token.

getActiveValueElements(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.ValueElement]

Return a vector of all value elements that belong to this interface, taking inheritance into account.

Examples of value elements are Input, Output, and Token.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getBindInputs()

(Deprecated) Return a vector of all BindInput elements in this shader reference.

getBindParams()

(Deprecated) Return a vector of all BindParam elements in this shader reference.

getBindTokens()

(Deprecated) Return a vector of all BindToken elements in this shader reference.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the output connected to the given input.

If the given input is not present, then an empty OutputPtr is returned.

getDeclaration(self: MaterialX.PyMaterialXCore.InterfaceElement, target: str = '') MaterialX.PyMaterialXCore.InterfaceElement

Return the first declaration of this interface, optionally filtered by the given target name.

Parameters:

target – An optional target name, which will be used to filter the declarations that are considered.

Returns:

A shared pointer to declaration, or an empty shared pointer if no declaration was found.

getDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return the default version flag of this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getImplementation(self: MaterialX.PyMaterialXCore.NodeDef, target: str = '', resolveNodeGraph: bool = True) MaterialX.PyMaterialXCore.InterfaceElement

Return the first implementation for this nodedef, optionally filtered by the given target name.

Parameters:
  • target – An optional target name, which will be used to filter the implementations that are considered.

  • resolveNodeGraph – Allow resolution of Implementation elements to their linked NodeGraph elements. Defaults to true.

Returns:

An implementation for this nodedef, or an empty shared pointer if none was found. Note that a node implementation may be either an Implementation element or a NodeGraph element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the Input, if any, with the given name.

getInputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Input elements.

getInputValue(name, target='')

Return the typed value of an input by its name, taking both the calling element and its declaration into account. If the given input is not found, then None is returned.

getInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the NodeDef string for the interface.

getNodeGroup(self: MaterialX.PyMaterialXCore.NodeDef) str

Return the node group of the NodeDef.

getNodeString(self: MaterialX.PyMaterialXCore.NodeDef) str

Return the node string of the NodeDef.

getOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the Output, if any, with the given name.

getOutputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Output elements.

getOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements.

getParameterValue(name, target='')

(Deprecated) Return the typed value of a parameter by its name.

getParameterValueString(name)

(Deprecated) Return the value string of a parameter by its name.

getParameters()

(Deprecated) Return a vector of all Parameter elements.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the target string of this interface.

getToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the Token, if any, with the given name.

getTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) str

Return the string value of a Token by its name, or an empty string if the given Token is not present.

getTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement) tuple[int, int]

Return the major and minor versions as an integer pair.

getVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the version string of this interface.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasExactInputMatch(self: MaterialX.PyMaterialXCore.InterfaceElement, declaration: MaterialX.PyMaterialXCore.InterfaceElement, message: str = None) bool

Return true if this instance has an exact input match with the given declaration, where each input of this the instance corresponds to a declaration input of the same name and type.

If an exact input match is not found, and the optional message argument is provided, then an error message will be appended to the given string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a NodeDef string.

hasNodeGroup(self: MaterialX.PyMaterialXCore.NodeDef) bool

Return true if the given NodeDef has a node group.

hasNodeString(self: MaterialX.PyMaterialXCore.NodeDef) bool

Return true if the given NodeDef has a node string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a target string.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if this interface has a version string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

isVersionCompatible(self: MaterialX.PyMaterialXCore.NodeDef, arg0: str) bool

Return true if the given version string is compatible with this NodeDef.

This may be used to test, for example, whether a NodeDef and Node may be used together.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Input, if any, with the given name.

removeOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Output, if any, with the given name.

removeToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Token, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: MaterialX.PyMaterialXCore.Output) None

Set the output to which the given input is connected, creating a child input if needed.

If the output argument is null, then any existing output connection on the input will be cleared.

setDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: bool) None

Set the default version flag of this element.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInputValue(name, value, typeString='')

Set the typed value of an input by its name, creating a child element to hold the input if needed.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the NodeDef string for the interface.

setNodeGroup(self: MaterialX.PyMaterialXCore.NodeDef, arg0: str) None

Set the node group of the NodeDef.

setNodeString(self: MaterialX.PyMaterialXCore.NodeDef, arg0: str) None

Set the node string of the NodeDef.

setParameterValue(name, value, typeString='')

(Deprecated) Set the typed value of a parameter by its name.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setTarget(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the target string of this interface.

setTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: str) MaterialX.PyMaterialXCore.Token

Set the string value of a Token by its name, creating a child element to hold the Token if needed.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: SupportsInt, arg1: SupportsInt) None

Set the major and minor versions as an integer pair.

setVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the version string of this interface.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

ADJUSTMENT_NODE_GROUP = 'adjustment'
CATEGORY = 'nodedef'
CHANNEL_NODE_GROUP = 'channel'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
CONDITIONAL_NODE_GROUP = 'conditional'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOMETRIC_NODE_GROUP = 'geometric'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
NODE_ATTRIBUTE = 'node'
NODE_DEF_ATTRIBUTE = 'nodedef'
ORGANIZATION_NODE_GROUP = 'organization'
PROCEDURAL_NODE_GROUP = 'procedural'
TEXTURE_NODE_GROUP = 'texture'
TRANSLATION_NODE_GROUP = 'translation'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.NodeGraph

Bases: GraphElement

A node graph element within a Document.

addBackdrop(self: MaterialX.PyMaterialXCore.GraphElement, name: str = '') MaterialX_v1_39_5::Backdrop

Add a Backdrop to the graph.

addBindInput(name, type='color3')

(Deprecated) Add a BindInput to this shader reference.

addBindParam(name, type='color3')

(Deprecated) Add a BindParam to this shader reference.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addGeomNode(self: MaterialX.PyMaterialXCore.GraphElement, arg0: MaterialX.PyMaterialXCore.GeomPropDef, arg1: str) MaterialX.PyMaterialXCore.Node

If not yet present, add a geometry node to this graph matching the given property definition and name prefix.

addInput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Input

Add an Input to this interface.

Parameters:
  • name – The name of the new Input. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Input.

addInterfaceName(self: MaterialX.PyMaterialXCore.NodeGraph, arg0: str, arg1: str) MaterialX.PyMaterialXCore.Input

Add an interface name to an existing NodeDef associated with this NodeGraph.

Parameters:
  • inputPath – Path to an input descendant of this graph.

  • interfaceName – The new interface name.

Returns:

Interface input.

addMaterialNode(self: MaterialX.PyMaterialXCore.GraphElement, name: str = '', shaderNode: MaterialX.PyMaterialXCore.Node = None) MaterialX.PyMaterialXCore.Node

Add a material node to the graph, optionally connecting it to the given shader node.

addNode(self: MaterialX.PyMaterialXCore.GraphElement, category: str, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Node

Add a Node to the graph.

Parameters:
  • category – The category of the new Node.

  • name – The name of the new Node. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Node.

addNodeInstance(self: MaterialX.PyMaterialXCore.GraphElement, nodeDef: MaterialX.PyMaterialXCore.NodeDef, name: str = '') MaterialX.PyMaterialXCore.Node

Add a Node that is an instance of the given NodeDef.

addOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Output

Add an Output to this interface.

Parameters:
  • name – The name of the new Output. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Output.

addParameter(name)

(Deprecated) Add a Parameter to this interface.

addToken(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = 'color3') MaterialX.PyMaterialXCore.Token

Add a Token to this interface.

Parameters:

name – The name of the new Token. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Token.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

asStringDot(self: MaterialX.PyMaterialXCore.GraphElement) str

Convert this graph to a string in the DOT language syntax.

This can be used to visualise the graph using GraphViz (http://www.graphviz.org).

If declarations for the contained nodes are provided as nodedefs in the owning document, then they will be used to provide additional formatting details.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.InterfaceElement) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

flattenSubgraphs(self: MaterialX.PyMaterialXCore.GraphElement, target: str = '', filter: collections.abc.Callable[[MaterialX.PyMaterialXCore.Node], bool] = None) None

Flatten all subgraphs at the root scope of this graph element, recursively replacing each graph-defined node with its equivalent node network.

Parameters:
  • target – An optional target string to be used in specifying which node definitions are used in this process.

  • filter – An optional node predicate specifying which nodes should be included and excluded from this process.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the first Input with the given name that belongs to this interface, taking interface inheritance into account.

getActiveInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements that belong to this interface, taking inheritance into account.

getActiveOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the first Output with the given name that belongs to this interface, taking interface inheritance into account.

getActiveOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements that belong to this interface, taking inheritance into account.

getActiveParameters()

(Deprecated) Return a vector of all parameters belonging to this interface, taking inheritance into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the first Token with the given name that belongs to this interface, taking interface inheritance into account.

getActiveTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements that belong to this interface, taking inheritance into account.

getActiveValueElement(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.ValueElement

Return the first value element with the given name that belongs to this interface, taking interface inheritance into account.

Examples of value elements are Input, Output, and Token.

getActiveValueElements(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.ValueElement]

Return a vector of all value elements that belong to this interface, taking inheritance into account.

Examples of value elements are Input, Output, and Token.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getBackdrop(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) MaterialX_v1_39_5::Backdrop

Return the Backdrop, if any, with the given name.

getBackdrops(self: MaterialX.PyMaterialXCore.GraphElement) list[MaterialX_v1_39_5::Backdrop]

Return a vector of all Backdrop elements in the graph.

getBindInputs()

(Deprecated) Return a vector of all BindInput elements in this shader reference.

getBindParams()

(Deprecated) Return a vector of all BindParam elements in this shader reference.

getBindTokens()

(Deprecated) Return a vector of all BindToken elements in this shader reference.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the output connected to the given input.

If the given input is not present, then an empty OutputPtr is returned.

getDeclaration(self: MaterialX.PyMaterialXCore.NodeGraph, arg0: str) MaterialX.PyMaterialXCore.InterfaceElement

Return the first declaration of this interface, optionally filtered by the given target name.

getDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return the default version flag of this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getDownstreamPorts(self: MaterialX.PyMaterialXCore.NodeGraph) list[MaterialX.PyMaterialXCore.PortElement]

Return a vector of all downstream ports that connect to this graph, ordered by the names of the port elements.

getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the Input, if any, with the given name.

getInputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Input elements.

getInputValue(name, target='')

Return the typed value of an input by its name, taking both the calling element and its declaration into account. If the given input is not found, then None is returned.

getInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements.

getMaterialNodes(self: MaterialX.PyMaterialXCore.GraphElement) list[MaterialX.PyMaterialXCore.Node]

Return a vector of all material nodes.

getMaterialOutputs(self: MaterialX.PyMaterialXCore.NodeGraph) list[MaterialX.PyMaterialXCore.Output]

Return all material-type outputs of the nodegraph.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getNode(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) MaterialX.PyMaterialXCore.Node

Return the Node, if any, with the given name.

getNodeDef(self: MaterialX.PyMaterialXCore.NodeGraph) MaterialX.PyMaterialXCore.NodeDef

Return the NodeDef element referenced by this NodeGraph.

getNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the NodeDef string for the interface.

getNodes(self: MaterialX.PyMaterialXCore.GraphElement, category: str = '') list[MaterialX.PyMaterialXCore.Node]

Return a vector of all Nodes in the graph, optionally filtered by the given category string.

getOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the Output, if any, with the given name.

getOutputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Output elements.

getOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements.

getParameterValue(name, target='')

(Deprecated) Return the typed value of a parameter by its name.

getParameterValueString(name)

(Deprecated) Return the value string of a parameter by its name.

getParameters()

(Deprecated) Return a vector of all Parameter elements.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the target string of this interface.

getToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the Token, if any, with the given name.

getTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) str

Return the string value of a Token by its name, or an empty string if the given Token is not present.

getTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement) tuple[int, int]

Return the major and minor versions as an integer pair.

getVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the version string of this interface.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasExactInputMatch(self: MaterialX.PyMaterialXCore.InterfaceElement, declaration: MaterialX.PyMaterialXCore.InterfaceElement, message: str = None) bool

Return true if this instance has an exact input match with the given declaration, where each input of this the instance corresponds to a declaration input of the same name and type.

If an exact input match is not found, and the optional message argument is provided, then an error message will be appended to the given string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a NodeDef string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a target string.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if this interface has a version string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

modifyInterfaceName(self: MaterialX.PyMaterialXCore.NodeGraph, arg0: str, arg1: str) None

Modify the interface name on an existing NodeDef associated with this NodeGraph.

Parameters:
  • inputPath – Path to an input descendant of this graph.

  • interfaceName – The new interface name.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeBackdrop(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) None

Remove the Backdrop, if any, with the given name.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Input, if any, with the given name.

removeInterfaceName(self: MaterialX.PyMaterialXCore.NodeGraph, arg0: str) None

Remove an interface name from an existing NodeDef associated with this NodeGraph.

Parameters:

inputPath – Path to an input descendant of this graph.

removeNode(self: MaterialX.PyMaterialXCore.GraphElement, arg0: str) None

Remove the Node, if any, with the given name.

removeOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Output, if any, with the given name.

removeToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Token, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: MaterialX.PyMaterialXCore.Output) None

Set the output to which the given input is connected, creating a child input if needed.

If the output argument is null, then any existing output connection on the input will be cleared.

setDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: bool) None

Set the default version flag of this element.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInputValue(name, value, typeString='')

Set the typed value of an input by its name, creating a child element to hold the input if needed.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setNodeDef(self: MaterialX.PyMaterialXCore.NodeGraph, arg0: MaterialX.PyMaterialXCore.NodeDef) None

Set the NodeDef element referenced by this NodeGraph.

setNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the NodeDef string for the interface.

setParameterValue(name, value, typeString='')

(Deprecated) Set the typed value of a parameter by its name.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setTarget(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the target string of this interface.

setTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: str) MaterialX.PyMaterialXCore.Token

Set the string value of a Token by its name, creating a child element to hold the Token if needed.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: SupportsInt, arg1: SupportsInt) None

Set the major and minor versions as an integer pair.

setVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the version string of this interface.

topologicalSort(self: MaterialX.PyMaterialXCore.GraphElement) list[MaterialX.PyMaterialXCore.Element]

Return a vector of all children (nodes and outputs) sorted in topological order.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'nodegraph'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
NODE_DEF_ATTRIBUTE = 'nodedef'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.NodePredicate

Bases: pybind11_object

class MaterialX.PyMaterialXCore.Output

Bases: PortElement

A spatially-varying output element within a NodeGraph or NodeDef.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit defined by the associated NodeDef if this element is a child of a Node.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getConnectedNode(self: MaterialX.PyMaterialXCore.PortElement) MaterialX_v1_39_5::Node

Return the node, if any, to which this element is connected.

getConnectedOutput(self: MaterialX.PyMaterialXCore.PortElement) MaterialX_v1_39_5::Output

Return the output, if any, to which this input is connected.

getDefaultValue()

Return the default value for this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the implementation name of an element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the interface name of an element.

getIsUniform(self: MaterialX.PyMaterialXCore.ValueElement) bool

The the uniform attribute flag for this element.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getNodeGraphString(self: MaterialX.PyMaterialXCore.PortElement) str

Return the node graph string of this element.

getNodeName(self: MaterialX.PyMaterialXCore.PortElement) str

Return the node name string of this element.

getOutputString(self: MaterialX.PyMaterialXCore.PortElement) str

Return the output string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getResolvedValueString(self: MaterialX.PyMaterialXCore.ValueElement, resolver: MaterialX_v1_39_5::StringResolver = None) str

Return the resolved value string of an element, applying any string substitutions that are defined at the element’s scope.

Parameters:

resolver – An optional string resolver, which will be used to apply string substitutions. By default, a new string resolver will be created at this scope and applied to the return value.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit string of an element.

getUnitType(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit type of an element.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getValue()

Return the typed value of an element.

getValueString(self: MaterialX.PyMaterialXCore.ValueElement) str

Get the value string of a element.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an implementation name.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an interface name.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasNodeGraphString(self: MaterialX.PyMaterialXCore.PortElement) bool

Return true if this element has a node graph string.

hasOutputString(self: MaterialX.PyMaterialXCore.PortElement) bool

Return true if this element has an output string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasUnit(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit string.

hasUnitType(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit type.

hasUpstreamCycle(self: MaterialX.PyMaterialXCore.Output) bool

Return true if a cycle exists in any upstream path from this element.

hasValueString(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a value string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setConnectedNode(self: MaterialX.PyMaterialXCore.PortElement, arg0: MaterialX_v1_39_5::Node) None

Set the node to which this element is connected.

The given node must belong to the same node graph. If the node argument is null, then any existing node connection will be cleared.

setConnectedOutput(self: MaterialX.PyMaterialXCore.PortElement, arg0: MaterialX_v1_39_5::Output) None

Set the output to which this input is connected.

If the output argument is null, then any existing output connection will be cleared.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setImplementationName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the implementation name of an element.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the interface name of an element.

setIsUniform(self: MaterialX.PyMaterialXCore.ValueElement, arg0: bool) None

Set the uniform attribute flag on this element.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setNodeGraphString(self: MaterialX.PyMaterialXCore.PortElement, arg0: str) None

Set the node graph string of this element.

setNodeName(self: MaterialX.PyMaterialXCore.PortElement, arg0: str) None

Set the node name string of this element, creating a connection to the Node with the given name within the same NodeGraph.

setOutputString(self: MaterialX.PyMaterialXCore.PortElement, arg0: str) None

Set the output string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setUnit(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit string of an element.

setUnitType(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit type of an element.

setValue(value, typeString='')

Set the typed value of an element.

setValueString(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the value string of an element.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'output'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DEFAULT_INPUT_ATTRIBUTE = 'defaultinput'
DOC_ATTRIBUTE = 'doc'
ENUM_ATTRIBUTE = 'enum'
ENUM_VALUES_ATTRIBUTE = 'enumvalues'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
IMPLEMENTATION_NAME_ATTRIBUTE = 'implname'
IMPLEMENTATION_TYPE_ATTRIBUTE = 'impltype'
INHERIT_ATTRIBUTE = 'inherit'
INTERFACE_NAME_ATTRIBUTE = 'interfacename'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
UI_ADVANCED_ATTRIBUTE = 'uiadvanced'
UI_FOLDER_ATTRIBUTE = 'uifolder'
UI_MAX_ATTRIBUTE = 'uimax'
UI_MIN_ATTRIBUTE = 'uimin'
UI_NAME_ATTRIBUTE = 'uiname'
UI_SOFT_MAX_ATTRIBUTE = 'uisoftmax'
UI_SOFT_MIN_ATTRIBUTE = 'uisoftmin'
UI_STEP_ATTRIBUTE = 'uistep'
UNIT_ATTRIBUTE = 'unit'
VALUE_ATTRIBUTE = 'value'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.PortElement

Bases: ValueElement

The base class for port elements such as Input and Output.

Port elements support spatially-varying upstream connections to nodes.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit defined by the associated NodeDef if this element is a child of a Node.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getConnectedNode(self: MaterialX.PyMaterialXCore.PortElement) MaterialX_v1_39_5::Node

Return the node, if any, to which this element is connected.

getConnectedOutput(self: MaterialX.PyMaterialXCore.PortElement) MaterialX_v1_39_5::Output

Return the output, if any, to which this input is connected.

getDefaultValue()

Return the default value for this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the implementation name of an element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the interface name of an element.

getIsUniform(self: MaterialX.PyMaterialXCore.ValueElement) bool

The the uniform attribute flag for this element.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getNodeGraphString(self: MaterialX.PyMaterialXCore.PortElement) str

Return the node graph string of this element.

getNodeName(self: MaterialX.PyMaterialXCore.PortElement) str

Return the node name string of this element.

getOutputString(self: MaterialX.PyMaterialXCore.PortElement) str

Return the output string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getResolvedValueString(self: MaterialX.PyMaterialXCore.ValueElement, resolver: MaterialX_v1_39_5::StringResolver = None) str

Return the resolved value string of an element, applying any string substitutions that are defined at the element’s scope.

Parameters:

resolver – An optional string resolver, which will be used to apply string substitutions. By default, a new string resolver will be created at this scope and applied to the return value.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit string of an element.

getUnitType(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit type of an element.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getValue()

Return the typed value of an element.

getValueString(self: MaterialX.PyMaterialXCore.ValueElement) str

Get the value string of a element.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an implementation name.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an interface name.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasNodeGraphString(self: MaterialX.PyMaterialXCore.PortElement) bool

Return true if this element has a node graph string.

hasOutputString(self: MaterialX.PyMaterialXCore.PortElement) bool

Return true if this element has an output string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasUnit(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit string.

hasUnitType(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit type.

hasValueString(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a value string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setConnectedNode(self: MaterialX.PyMaterialXCore.PortElement, arg0: MaterialX_v1_39_5::Node) None

Set the node to which this element is connected.

The given node must belong to the same node graph. If the node argument is null, then any existing node connection will be cleared.

setConnectedOutput(self: MaterialX.PyMaterialXCore.PortElement, arg0: MaterialX_v1_39_5::Output) None

Set the output to which this input is connected.

If the output argument is null, then any existing output connection will be cleared.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setImplementationName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the implementation name of an element.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the interface name of an element.

setIsUniform(self: MaterialX.PyMaterialXCore.ValueElement, arg0: bool) None

Set the uniform attribute flag on this element.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setNodeGraphString(self: MaterialX.PyMaterialXCore.PortElement, arg0: str) None

Set the node graph string of this element.

setNodeName(self: MaterialX.PyMaterialXCore.PortElement, arg0: str) None

Set the node name string of this element, creating a connection to the Node with the given name within the same NodeGraph.

setOutputString(self: MaterialX.PyMaterialXCore.PortElement, arg0: str) None

Set the output string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setUnit(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit string of an element.

setUnitType(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit type of an element.

setValue(value, typeString='')

Set the typed value of an element.

setValueString(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the value string of an element.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
ENUM_ATTRIBUTE = 'enum'
ENUM_VALUES_ATTRIBUTE = 'enumvalues'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
IMPLEMENTATION_NAME_ATTRIBUTE = 'implname'
IMPLEMENTATION_TYPE_ATTRIBUTE = 'impltype'
INHERIT_ATTRIBUTE = 'inherit'
INTERFACE_NAME_ATTRIBUTE = 'interfacename'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
UI_ADVANCED_ATTRIBUTE = 'uiadvanced'
UI_FOLDER_ATTRIBUTE = 'uifolder'
UI_MAX_ATTRIBUTE = 'uimax'
UI_MIN_ATTRIBUTE = 'uimin'
UI_NAME_ATTRIBUTE = 'uiname'
UI_SOFT_MAX_ATTRIBUTE = 'uisoftmax'
UI_SOFT_MIN_ATTRIBUTE = 'uisoftmin'
UI_STEP_ATTRIBUTE = 'uistep'
UNIT_ATTRIBUTE = 'unit'
VALUE_ATTRIBUTE = 'value'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Property

Bases: ValueElement

A property element within a PropertySet.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit defined by the associated NodeDef if this element is a child of a Node.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDefaultValue()

Return the default value for this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the implementation name of an element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the interface name of an element.

getIsUniform(self: MaterialX.PyMaterialXCore.ValueElement) bool

The the uniform attribute flag for this element.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getResolvedValueString(self: MaterialX.PyMaterialXCore.ValueElement, resolver: MaterialX_v1_39_5::StringResolver = None) str

Return the resolved value string of an element, applying any string substitutions that are defined at the element’s scope.

Parameters:

resolver – An optional string resolver, which will be used to apply string substitutions. By default, a new string resolver will be created at this scope and applied to the return value.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit string of an element.

getUnitType(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit type of an element.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getValue()

Return the typed value of an element.

getValueString(self: MaterialX.PyMaterialXCore.ValueElement) str

Get the value string of a element.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an implementation name.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an interface name.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasUnit(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit string.

hasUnitType(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit type.

hasValueString(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a value string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setImplementationName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the implementation name of an element.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the interface name of an element.

setIsUniform(self: MaterialX.PyMaterialXCore.ValueElement, arg0: bool) None

Set the uniform attribute flag on this element.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setUnit(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit string of an element.

setUnitType(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit type of an element.

setValue(value, typeString='')

Set the typed value of an element.

setValueString(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the value string of an element.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'property'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
ENUM_ATTRIBUTE = 'enum'
ENUM_VALUES_ATTRIBUTE = 'enumvalues'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
IMPLEMENTATION_NAME_ATTRIBUTE = 'implname'
IMPLEMENTATION_TYPE_ATTRIBUTE = 'impltype'
INHERIT_ATTRIBUTE = 'inherit'
INTERFACE_NAME_ATTRIBUTE = 'interfacename'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
UI_ADVANCED_ATTRIBUTE = 'uiadvanced'
UI_FOLDER_ATTRIBUTE = 'uifolder'
UI_MAX_ATTRIBUTE = 'uimax'
UI_MIN_ATTRIBUTE = 'uimin'
UI_NAME_ATTRIBUTE = 'uiname'
UI_SOFT_MAX_ATTRIBUTE = 'uisoftmax'
UI_SOFT_MIN_ATTRIBUTE = 'uisoftmin'
UI_STEP_ATTRIBUTE = 'uistep'
UNIT_ATTRIBUTE = 'unit'
VALUE_ATTRIBUTE = 'value'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.PropertyAssign

Bases: ValueElement

A property assignment element within a Look.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit defined by the associated NodeDef if this element is a child of a Node.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getCollection(self: MaterialX.PyMaterialXCore.PropertyAssign) MaterialX.PyMaterialXCore.Collection

Return the Collection that is assigned to this element.

getCollectionString(self: MaterialX.PyMaterialXCore.PropertyAssign) str

Return the collection string of this element.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDefaultValue()

Return the default value for this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeom(self: MaterialX.PyMaterialXCore.PropertyAssign) str

Return the geometry string of this element.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the implementation name of an element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the interface name of an element.

getIsUniform(self: MaterialX.PyMaterialXCore.ValueElement) bool

The the uniform attribute flag for this element.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getProperty(self: MaterialX.PyMaterialXCore.PropertyAssign) str

Return the property string of this element.

getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getResolvedValueString(self: MaterialX.PyMaterialXCore.ValueElement, resolver: MaterialX_v1_39_5::StringResolver = None) str

Return the resolved value string of an element, applying any string substitutions that are defined at the element’s scope.

Parameters:

resolver – An optional string resolver, which will be used to apply string substitutions. By default, a new string resolver will be created at this scope and applied to the return value.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit string of an element.

getUnitType(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit type of an element.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getValue()

Return the typed value of an element.

getValueString(self: MaterialX.PyMaterialXCore.ValueElement) str

Get the value string of a element.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasCollectionString(self: MaterialX.PyMaterialXCore.PropertyAssign) bool

Return true if this element has a collection string.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeom(self: MaterialX.PyMaterialXCore.PropertyAssign) bool

Return true if this element has a geometry string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an implementation name.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an interface name.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasProperty(self: MaterialX.PyMaterialXCore.PropertyAssign) bool

Return true if this element has a property string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasUnit(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit string.

hasUnitType(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit type.

hasValueString(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a value string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setCollection(self: MaterialX.PyMaterialXCore.PropertyAssign, arg0: MaterialX.PyMaterialXCore.Collection) None

Assign a Collection to this element.

setCollectionString(self: MaterialX.PyMaterialXCore.PropertyAssign, arg0: str) None

Set the collection string of this element.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeom(self: MaterialX.PyMaterialXCore.PropertyAssign, arg0: str) None

Set the geometry string of this element.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setImplementationName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the implementation name of an element.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the interface name of an element.

setIsUniform(self: MaterialX.PyMaterialXCore.ValueElement, arg0: bool) None

Set the uniform attribute flag on this element.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setProperty(self: MaterialX.PyMaterialXCore.PropertyAssign, arg0: str) None

Set the property string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setUnit(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit string of an element.

setUnitType(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit type of an element.

setValue(value, typeString='')

Set the typed value of an element.

setValueString(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the value string of an element.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'propertyassign'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
ENUM_ATTRIBUTE = 'enum'
ENUM_VALUES_ATTRIBUTE = 'enumvalues'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
IMPLEMENTATION_NAME_ATTRIBUTE = 'implname'
IMPLEMENTATION_TYPE_ATTRIBUTE = 'impltype'
INHERIT_ATTRIBUTE = 'inherit'
INTERFACE_NAME_ATTRIBUTE = 'interfacename'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
UI_ADVANCED_ATTRIBUTE = 'uiadvanced'
UI_FOLDER_ATTRIBUTE = 'uifolder'
UI_MAX_ATTRIBUTE = 'uimax'
UI_MIN_ATTRIBUTE = 'uimin'
UI_NAME_ATTRIBUTE = 'uiname'
UI_SOFT_MAX_ATTRIBUTE = 'uisoftmax'
UI_SOFT_MIN_ATTRIBUTE = 'uisoftmin'
UI_STEP_ATTRIBUTE = 'uistep'
UNIT_ATTRIBUTE = 'unit'
VALUE_ATTRIBUTE = 'value'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.PropertySet

Bases: Element

A property set element within a Document.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addProperty(self: MaterialX.PyMaterialXCore.PropertySet, arg0: str) MaterialX.PyMaterialXCore.Property

Add a Property to the set.

Parameters:

name – The name of the new Property. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Property.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getProperties(self: MaterialX.PyMaterialXCore.PropertySet) list[MaterialX.PyMaterialXCore.Property]

Return a vector of all Property elements in the set.

getPropertyValue(name, target='')

Return the typed value of a property by its name. If the given property is not found, then None is returned.

getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeProperty(self: MaterialX.PyMaterialXCore.PropertySet, arg0: str) None

Remove the Property with the given name, if present.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setPropertyValue(name, value, typeString='')

Set the typed value of a property by its name, creating a child element to hold the property if needed.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'property'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.PropertySetAssign

Bases: GeomElement

A property set assignment element within a Look.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getCollection(self: MaterialX.PyMaterialXCore.GeomElement) MaterialX_v1_39_5::Collection

Return the Collection that is assigned to this element.

getCollectionString(self: MaterialX.PyMaterialXCore.GeomElement) str

Return the collection string of this element.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeom(self: MaterialX.PyMaterialXCore.GeomElement) str

Return the geometry string of this element.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getPropertySet(self: MaterialX.PyMaterialXCore.PropertySetAssign) MaterialX.PyMaterialXCore.PropertySet

Return the property set that is assigned to this element.

getPropertySetString(self: MaterialX.PyMaterialXCore.PropertySetAssign) str

Return the property set string of this element.

getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasCollectionString(self: MaterialX.PyMaterialXCore.GeomElement) bool

Return true if this element has a collection string.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeom(self: MaterialX.PyMaterialXCore.GeomElement) bool

Return true if this element has a geometry string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasPropertySetString(self: MaterialX.PyMaterialXCore.PropertySetAssign) bool

Return true if this element has a property set string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setCollection(self: MaterialX.PyMaterialXCore.GeomElement, arg0: MaterialX_v1_39_5::Collection) None

Assign a Collection to this element.

setCollectionString(self: MaterialX.PyMaterialXCore.GeomElement, arg0: str) None

Set the collection string of this element.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeom(self: MaterialX.PyMaterialXCore.GeomElement, arg0: str) None

Set the geometry string of this element.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setPropertySet(self: MaterialX.PyMaterialXCore.PropertySetAssign, arg0: MaterialX.PyMaterialXCore.PropertySet) None

Assign a property set to this element.

setPropertySetString(self: MaterialX.PyMaterialXCore.PropertySetAssign, arg0: str) None

Set the property set string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'propertysetassign'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.StringResolver

Bases: pybind11_object

A helper object for applying string modifiers to data values in the context of a specific element and geometry.

A StringResolver may be constructed through the Element::createStringResolver method, which initializes it in the context of a specific element, geometry, and material.

Calling the StringResolver::resolve method applies all modifiers to a particular string value.

Methods such as StringResolver::setFilePrefix may be used to edit the stored string modifiers before calling StringResolver::resolve.

getFilePrefix(self: MaterialX.PyMaterialXCore.StringResolver) str

Return the file prefix for this context.

getFilenameSubstitutions(self: MaterialX.PyMaterialXCore.StringResolver) dict[str, str]

Return the map of filename substring substitutions.

getGeomNameSubstitutions(self: MaterialX.PyMaterialXCore.StringResolver) dict[str, str]

Return the map of geometry name substring substitutions.

getGeomPrefix(self: MaterialX.PyMaterialXCore.StringResolver) str

Return the geom prefix for this context.

resolve(self: MaterialX.PyMaterialXCore.StringResolver, arg0: str, arg1: str) str

Given an input string and type, apply all appropriate modifiers and return the resulting string.

setFilePrefix(self: MaterialX.PyMaterialXCore.StringResolver, arg0: str) None

Set the file prefix for this context.

setFilenameSubstitution(self: MaterialX.PyMaterialXCore.StringResolver, arg0: str, arg1: str) None

Set an arbitrary substring substitution for filename data values.

setGeomNameSubstitution(self: MaterialX.PyMaterialXCore.StringResolver, arg0: str, arg1: str) None

Set an arbitrary substring substitution for geometry name data values.

setGeomPrefix(self: MaterialX.PyMaterialXCore.StringResolver, arg0: str) None

Set the geom prefix for this context.

setUdimString(self: MaterialX.PyMaterialXCore.StringResolver, arg0: str) None

Set the UDIM substring substitution for filename data values.

This string will be used to replace the standard <UDIM> token.

setUvTileString(self: MaterialX.PyMaterialXCore.StringResolver, arg0: str) None

Set the UV-tile substring substitution for filename data values.

This string will be used to replace the standard <UVTILE> token.

class MaterialX.PyMaterialXCore.TargetDef

Bases: TypedElement

A definition of an implementation target.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getMatchingTargets(self: MaterialX.PyMaterialXCore.TargetDef) list[str]

Return a vector of target names that is matching this targetdef either by itself of by its inheritance.

The vector is ordered by priority starting with this targetdef itself and then upwards in the inheritance hierarchy.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'targetdef'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Token

Bases: ValueElement

A token element representing a string value.

Token elements are used to define input and output values for string substitutions in image filenames.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit defined by the associated NodeDef if this element is a child of a Node.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDefaultValue()

Return the default value for this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the implementation name of an element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the interface name of an element.

getIsUniform(self: MaterialX.PyMaterialXCore.ValueElement) bool

The the uniform attribute flag for this element.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getResolvedValueString(self: MaterialX.PyMaterialXCore.ValueElement, resolver: MaterialX_v1_39_5::StringResolver = None) str

Return the resolved value string of an element, applying any string substitutions that are defined at the element’s scope.

Parameters:

resolver – An optional string resolver, which will be used to apply string substitutions. By default, a new string resolver will be created at this scope and applied to the return value.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit string of an element.

getUnitType(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit type of an element.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getValue()

Return the typed value of an element.

getValueString(self: MaterialX.PyMaterialXCore.ValueElement) str

Get the value string of a element.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an implementation name.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an interface name.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasUnit(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit string.

hasUnitType(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit type.

hasValueString(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a value string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setImplementationName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the implementation name of an element.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the interface name of an element.

setIsUniform(self: MaterialX.PyMaterialXCore.ValueElement, arg0: bool) None

Set the uniform attribute flag on this element.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setUnit(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit string of an element.

setUnitType(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit type of an element.

setValue(value, typeString='')

Set the typed value of an element.

setValueString(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the value string of an element.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'token'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
ENUM_ATTRIBUTE = 'enum'
ENUM_VALUES_ATTRIBUTE = 'enumvalues'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
IMPLEMENTATION_NAME_ATTRIBUTE = 'implname'
IMPLEMENTATION_TYPE_ATTRIBUTE = 'impltype'
INHERIT_ATTRIBUTE = 'inherit'
INTERFACE_NAME_ATTRIBUTE = 'interfacename'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
UI_ADVANCED_ATTRIBUTE = 'uiadvanced'
UI_FOLDER_ATTRIBUTE = 'uifolder'
UI_MAX_ATTRIBUTE = 'uimax'
UI_MIN_ATTRIBUTE = 'uimin'
UI_NAME_ATTRIBUTE = 'uiname'
UI_SOFT_MAX_ATTRIBUTE = 'uisoftmax'
UI_SOFT_MIN_ATTRIBUTE = 'uisoftmin'
UI_STEP_ATTRIBUTE = 'uistep'
UNIT_ATTRIBUTE = 'unit'
VALUE_ATTRIBUTE = 'value'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.TreeIterator

Bases: pybind11_object

An iterator object representing the state of a tree traversal.

getElement(self: MaterialX.PyMaterialXCore.TreeIterator) MaterialX.PyMaterialXCore.Element

Return the current element in the traversal.

getElementDepth(self: MaterialX.PyMaterialXCore.TreeIterator) int

Return the element depth of the current traversal, where the starting element represents a depth of zero.

getPruneSubtree(self: MaterialX.PyMaterialXCore.TreeIterator) bool

Return the prune subtree flag, which controls whether the current subtree is pruned from traversal.

setPruneSubtree(self: MaterialX.PyMaterialXCore.TreeIterator, arg0: bool) None

Set the prune subtree flag, which controls whether the current subtree is pruned from traversal.

Parameters:

prune – If set to true, then the current subtree will be pruned.

class MaterialX.PyMaterialXCore.TypeDef

Bases: Element

A type definition element within a Document.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addMember(self: MaterialX.PyMaterialXCore.TypeDef, name: str = '') MaterialX_v1_39_5::Member

Add a Member to the TypeDef.

Parameters:

name – The name of the new Member. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Member.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getContext(self: MaterialX.PyMaterialXCore.TypeDef) str

Return the context string of the TypeDef.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getMember(self: MaterialX.PyMaterialXCore.TypeDef, arg0: str) MaterialX_v1_39_5::Member

Return the Member, if any, with the given name.

getMembers(self: MaterialX.PyMaterialXCore.TypeDef) list[MaterialX_v1_39_5::Member]

Return a vector of all Member elements in the TypeDef.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSemantic(self: MaterialX.PyMaterialXCore.TypeDef) str

Return the semantic string of the TypeDef.

getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasContext(self: MaterialX.PyMaterialXCore.TypeDef) bool

Return true if the given TypeDef has a context string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSemantic(self: MaterialX.PyMaterialXCore.TypeDef) bool

Return true if the given TypeDef has a semantic string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeMember(self: MaterialX.PyMaterialXCore.TypeDef, arg0: str) None

Remove the Member, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setContext(self: MaterialX.PyMaterialXCore.TypeDef, arg0: str) None

Set the context string of the TypeDef.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSemantic(self: MaterialX.PyMaterialXCore.TypeDef, arg0: str) None

Set the semantic string of the TypeDef.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'typedef'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
CONTEXT_ATTRIBUTE = 'context'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
SEMANTIC_ATTRIBUTE = 'semantic'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.TypedElement

Bases: Element

The base class for typed elements.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.TypedValue_boolean

Bases: Value

static createValue(arg0: bool) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_boolean) bool
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_boolean) str
TYPE = 'boolean'
class MaterialX.PyMaterialXCore.TypedValue_booleanarray

Bases: Value

static createValue(arg0: collections.abc.Sequence[bool]) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_booleanarray) list[bool]
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_booleanarray) str
TYPE = 'booleanarray'
class MaterialX.PyMaterialXCore.TypedValue_color3

Bases: Value

static createValue(arg0: MaterialX_v1_39_5::Color3) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_color3) MaterialX_v1_39_5::Color3
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_color3) str
TYPE = 'color3'
class MaterialX.PyMaterialXCore.TypedValue_color4

Bases: Value

static createValue(arg0: MaterialX_v1_39_5::Color4) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_color4) MaterialX_v1_39_5::Color4
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_color4) str
TYPE = 'color4'
class MaterialX.PyMaterialXCore.TypedValue_float

Bases: Value

static createValue(arg0: SupportsFloat) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_float) float
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_float) str
TYPE = 'float'
class MaterialX.PyMaterialXCore.TypedValue_floatarray

Bases: Value

static createValue(arg0: collections.abc.Sequence[SupportsFloat]) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_floatarray) list[float]
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_floatarray) str
TYPE = 'floatarray'
class MaterialX.PyMaterialXCore.TypedValue_integer

Bases: Value

static createValue(arg0: SupportsInt) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_integer) int
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_integer) str
TYPE = 'integer'
class MaterialX.PyMaterialXCore.TypedValue_integerarray

Bases: Value

static createValue(arg0: collections.abc.Sequence[SupportsInt]) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_integerarray) list[int]
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_integerarray) str
TYPE = 'integerarray'
class MaterialX.PyMaterialXCore.TypedValue_matrix33

Bases: Value

static createValue(arg0: MaterialX_v1_39_5::Matrix33) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_matrix33) MaterialX_v1_39_5::Matrix33
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_matrix33) str
TYPE = 'matrix33'
class MaterialX.PyMaterialXCore.TypedValue_matrix44

Bases: Value

static createValue(arg0: MaterialX_v1_39_5::Matrix44) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_matrix44) MaterialX_v1_39_5::Matrix44
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_matrix44) str
TYPE = 'matrix44'
class MaterialX.PyMaterialXCore.TypedValue_string

Bases: Value

static createValue(arg0: str) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_string) str
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_string) str
TYPE = 'string'
class MaterialX.PyMaterialXCore.TypedValue_stringarray

Bases: Value

static createValue(arg0: collections.abc.Sequence[str]) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_stringarray) list[str]
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_stringarray) str
TYPE = 'stringarray'
class MaterialX.PyMaterialXCore.TypedValue_vector2

Bases: Value

static createValue(arg0: MaterialX_v1_39_5::Vector2) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_vector2) MaterialX_v1_39_5::Vector2
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_vector2) str
TYPE = 'vector2'
class MaterialX.PyMaterialXCore.TypedValue_vector3

Bases: Value

static createValue(arg0: MaterialX_v1_39_5::Vector3) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_vector3) MaterialX_v1_39_5::Vector3
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_vector3) str
TYPE = 'vector3'
class MaterialX.PyMaterialXCore.TypedValue_vector4

Bases: Value

static createValue(arg0: MaterialX_v1_39_5::Vector4) MaterialX.PyMaterialXCore.Value
static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getData(self: MaterialX.PyMaterialXCore.TypedValue_vector4) MaterialX_v1_39_5::Vector4
getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.TypedValue_vector4) str
TYPE = 'vector4'
class MaterialX.PyMaterialXCore.Unit

Bases: Element

A unit declaration within a UnitDef.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'unit'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.UnitConverter

Bases: pybind11_object

An abstract base class for unit converters.

Each unit converter instance is responsible for a single unit type.

convert(*args, **kwargs)

Overloaded function.

  1. convert(self: MaterialX.PyMaterialXCore.UnitConverter, arg0: typing.SupportsFloat, arg1: str, arg2: str) -> float

  2. convert(self: MaterialX.PyMaterialXCore.UnitConverter, arg0: MaterialX.PyMaterialXCore.Vector2, arg1: str, arg2: str) -> MaterialX.PyMaterialXCore.Vector2

  3. convert(self: MaterialX.PyMaterialXCore.UnitConverter, arg0: MaterialX.PyMaterialXCore.Vector3, arg1: str, arg2: str) -> MaterialX.PyMaterialXCore.Vector3

  4. convert(self: MaterialX.PyMaterialXCore.UnitConverter, arg0: MaterialX.PyMaterialXCore.Vector4, arg1: str, arg2: str) -> MaterialX.PyMaterialXCore.Vector4

getUnitAsInteger(self: MaterialX.PyMaterialXCore.UnitConverter, arg0: str) int

Given a unit name return a value that it can map to as an integer Returns -1 value if not found.

getUnitFromInteger(self: MaterialX.PyMaterialXCore.UnitConverter, arg0: SupportsInt) str

Given an integer index return the unit name in the map used by the converter Returns Empty string if not found.

class MaterialX.PyMaterialXCore.UnitConverterRegistry

Bases: pybind11_object

A registry for unit converters.

static create() MaterialX.PyMaterialXCore.UnitConverterRegistry

Creator.

addUnitConverter(self: MaterialX.PyMaterialXCore.UnitConverterRegistry, arg0: MaterialX.PyMaterialXCore.UnitTypeDef, arg1: MaterialX.PyMaterialXCore.UnitConverter) bool

Add a unit converter for a given UnitDef.

Returns false if a converter has already been registered for the given UnitDef

clearUnitConverters(self: MaterialX.PyMaterialXCore.UnitConverterRegistry) None

Clear all unit converters from the registry.

getUnitConverter(self: MaterialX.PyMaterialXCore.UnitConverterRegistry, arg0: MaterialX.PyMaterialXCore.UnitTypeDef) MaterialX.PyMaterialXCore.UnitConverter

Get a unit converter for a given UnitDef Returns any empty pointer if a converter does not exist for the given UnitDef.

removeUnitConverter(self: MaterialX.PyMaterialXCore.UnitConverterRegistry, arg0: MaterialX.PyMaterialXCore.UnitTypeDef) bool

Remove a unit converter for a given UnitDef.

Returns false if a converter does not exist for the given UnitDef

class MaterialX.PyMaterialXCore.UnitDef

Bases: Element

A unit definition element within a Document.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addUnit(self: MaterialX.PyMaterialXCore.UnitDef, arg0: str) MaterialX.PyMaterialXCore.Unit

Add a Unit to the UnitDef.

Parameters:

name – The name of the new Unit. An exception is thrown if the name provided is an empty string.

Returns:

A shared pointer to the new Unit.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUnit(self: MaterialX.PyMaterialXCore.UnitDef, arg0: str) MaterialX.PyMaterialXCore.Unit

Return the Unit, if any, with the given name.

getUnitType(self: MaterialX.PyMaterialXCore.UnitDef) str

Return the element’s type string.

getUnits(self: MaterialX.PyMaterialXCore.UnitDef) list[MaterialX.PyMaterialXCore.Unit]

Return a vector of all Unit elements in the UnitDef.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasUnitType(self: MaterialX.PyMaterialXCore.UnitDef) bool

Return true if the given element has a unittype string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setUnitType(self: MaterialX.PyMaterialXCore.UnitDef, arg0: str) None

Set the element’s unittype string.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'unitdef'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
UNITTYPE_ATTRIBUTE = 'unittype'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.UnitTypeDef

Bases: Element

A unit type definition element within a Document.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUnitDefs(self: MaterialX.PyMaterialXCore.UnitTypeDef) list[MaterialX.PyMaterialXCore.UnitDef]

Find all UnitDefs for the UnitTypeDef.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'unittypedef'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Value

Bases: pybind11_object

A generic, discriminated value, whose type may be queried dynamically.

static createValueFromStrings(value: str, type: str, typeDefPtr: MaterialX_v1_39_5::TypeDef = None) MaterialX.PyMaterialXCore.Value

Create a new value instance from value and type strings.

Returns:

A shared pointer to a typed value, or an empty shared pointer if the conversion to the given data type cannot be performed.

getTypeString(self: MaterialX.PyMaterialXCore.Value) str

Return the type string for this value.

getValueString(self: MaterialX.PyMaterialXCore.Value) str

Return the value string for this value.

class MaterialX.PyMaterialXCore.ValueElement

Bases: TypedElement

The base class for elements that support typed values.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit defined by the associated NodeDef if this element is a child of a Node.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDefaultValue()

Return the default value for this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the implementation name of an element.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the interface name of an element.

getIsUniform(self: MaterialX.PyMaterialXCore.ValueElement) bool

The the uniform attribute flag for this element.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getResolvedValueString(self: MaterialX.PyMaterialXCore.ValueElement, resolver: MaterialX_v1_39_5::StringResolver = None) str

Return the resolved value string of an element, applying any string substitutions that are defined at the element’s scope.

Parameters:

resolver – An optional string resolver, which will be used to apply string substitutions. By default, a new string resolver will be created at this scope and applied to the return value.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUnit(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit string of an element.

getUnitType(self: MaterialX.PyMaterialXCore.ValueElement) str

Return the unit type of an element.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getValue()

Return the typed value of an element.

getValueString(self: MaterialX.PyMaterialXCore.ValueElement) str

Get the value string of a element.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasImplementationName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an implementation name.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has an interface name.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasUnit(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit string.

hasUnitType(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a unit type.

hasValueString(self: MaterialX.PyMaterialXCore.ValueElement) bool

Return true if the given element has a value string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setImplementationName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the implementation name of an element.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInterfaceName(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the interface name of an element.

setIsUniform(self: MaterialX.PyMaterialXCore.ValueElement, arg0: bool) None

Set the uniform attribute flag on this element.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setUnit(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit string of an element.

setUnitType(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the unit type of an element.

setValue(value, typeString='')

Set the typed value of an element.

setValueString(self: MaterialX.PyMaterialXCore.ValueElement, arg0: str) None

Set the value string of an element.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
ENUM_ATTRIBUTE = 'enum'
ENUM_VALUES_ATTRIBUTE = 'enumvalues'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
IMPLEMENTATION_NAME_ATTRIBUTE = 'implname'
IMPLEMENTATION_TYPE_ATTRIBUTE = 'impltype'
INHERIT_ATTRIBUTE = 'inherit'
INTERFACE_NAME_ATTRIBUTE = 'interfacename'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
TYPE_ATTRIBUTE = 'type'
UI_ADVANCED_ATTRIBUTE = 'uiadvanced'
UI_FOLDER_ATTRIBUTE = 'uifolder'
UI_MAX_ATTRIBUTE = 'uimax'
UI_MIN_ATTRIBUTE = 'uimin'
UI_NAME_ATTRIBUTE = 'uiname'
UI_SOFT_MAX_ATTRIBUTE = 'uisoftmax'
UI_SOFT_MIN_ATTRIBUTE = 'uisoftmin'
UI_STEP_ATTRIBUTE = 'uistep'
UNIT_ATTRIBUTE = 'unit'
VALUE_ATTRIBUTE = 'value'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Variant

Bases: InterfaceElement

A variant element within a VariantSet.

addBindInput(name, type='color3')

(Deprecated) Add a BindInput to this shader reference.

addBindParam(name, type='color3')

(Deprecated) Add a BindParam to this shader reference.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addInput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Input

Add an Input to this interface.

Parameters:
  • name – The name of the new Input. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Input.

addOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = '', type: str = 'color3') MaterialX.PyMaterialXCore.Output

Add an Output to this interface.

Parameters:
  • name – The name of the new Output. If no name is specified, then a unique name will automatically be generated.

  • type – An optional type string.

Returns:

A shared pointer to the new Output.

addParameter(name)

(Deprecated) Add a Parameter to this interface.

addToken(self: MaterialX.PyMaterialXCore.InterfaceElement, name: str = 'color3') MaterialX.PyMaterialXCore.Token

Add a Token to this interface.

Parameters:

name – The name of the new Token. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Token.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.InterfaceElement) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the first Input with the given name that belongs to this interface, taking interface inheritance into account.

getActiveInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements that belong to this interface, taking inheritance into account.

getActiveOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the first Output with the given name that belongs to this interface, taking interface inheritance into account.

getActiveOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements that belong to this interface, taking inheritance into account.

getActiveParameters()

(Deprecated) Return a vector of all parameters belonging to this interface, taking inheritance into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getActiveToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the first Token with the given name that belongs to this interface, taking interface inheritance into account.

getActiveTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements that belong to this interface, taking inheritance into account.

getActiveValueElement(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.ValueElement

Return the first value element with the given name that belongs to this interface, taking interface inheritance into account.

Examples of value elements are Input, Output, and Token.

getActiveValueElements(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.ValueElement]

Return a vector of all value elements that belong to this interface, taking inheritance into account.

Examples of value elements are Input, Output, and Token.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getBindInputs()

(Deprecated) Return a vector of all BindInput elements in this shader reference.

getBindParams()

(Deprecated) Return a vector of all BindParam elements in this shader reference.

getBindTokens()

(Deprecated) Return a vector of all BindToken elements in this shader reference.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the output connected to the given input.

If the given input is not present, then an empty OutputPtr is returned.

getDeclaration(self: MaterialX.PyMaterialXCore.InterfaceElement, target: str = '') MaterialX.PyMaterialXCore.InterfaceElement

Return the first declaration of this interface, optionally filtered by the given target name.

Parameters:

target – An optional target name, which will be used to filter the declarations that are considered.

Returns:

A shared pointer to declaration, or an empty shared pointer if no declaration was found.

getDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return the default version flag of this element.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Input

Return the Input, if any, with the given name.

getInputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Input elements.

getInputValue(name, target='')

Return the typed value of an input by its name, taking both the calling element and its declaration into account. If the given input is not found, then None is returned.

getInputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Input]

Return a vector of all Input elements.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the NodeDef string for the interface.

getOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Output

Return the Output, if any, with the given name.

getOutputCount(self: MaterialX.PyMaterialXCore.InterfaceElement) int

Return the number of Output elements.

getOutputs(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all Output elements.

getParameterValue(name, target='')

(Deprecated) Return the typed value of a parameter by its name.

getParameterValueString(name)

(Deprecated) Return the value string of a parameter by its name.

getParameters()

(Deprecated) Return a vector of all Parameter elements.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the target string of this interface.

getToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) MaterialX.PyMaterialXCore.Token

Return the Token, if any, with the given name.

getTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) str

Return the string value of a Token by its name, or an empty string if the given Token is not present.

getTokens(self: MaterialX.PyMaterialXCore.InterfaceElement) list[MaterialX.PyMaterialXCore.Token]

Return a vector of all Token elements.

getType(self: MaterialX.PyMaterialXCore.TypedElement) str

Return the element’s type string.

getTypeDef(self: MaterialX.PyMaterialXCore.TypedElement) MaterialX_v1_39_5::TypeDef

Return the TypeDef declaring the type string of this element.

If no matching TypeDef is found, then an empty shared pointer is returned.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement) tuple[int, int]

Return the major and minor versions as an integer pair.

getVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) str

Return the version string of this interface.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasExactInputMatch(self: MaterialX.PyMaterialXCore.InterfaceElement, declaration: MaterialX.PyMaterialXCore.InterfaceElement, message: str = None) bool

Return true if this instance has an exact input match with the given declaration, where each input of this the instance corresponds to a declaration input of the same name and type.

If an exact input match is not found, and the optional message argument is provided, then an error message will be appended to the given string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a NodeDef string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasTarget(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if the given interface has a target string.

hasType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the given element has a type string.

hasVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement) bool

Return true if this interface has a version string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isColorType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of color type.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

isMultiOutputType(self: MaterialX.PyMaterialXCore.TypedElement) bool

Return true if the element is of multi-output type.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeInput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Input, if any, with the given name.

removeOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Output, if any, with the given name.

removeToken(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Remove the Token, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setConnectedOutput(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: MaterialX.PyMaterialXCore.Output) None

Set the output to which the given input is connected, creating a child input if needed.

If the output argument is null, then any existing output connection on the input will be cleared.

setDefaultVersion(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: bool) None

Set the default version flag of this element.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setInputValue(name, value, typeString='')

Set the typed value of an input by its name, creating a child element to hold the input if needed.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setNodeDefString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the NodeDef string for the interface.

setParameterValue(name, value, typeString='')

(Deprecated) Set the typed value of a parameter by its name.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setTarget(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the target string of this interface.

setTokenValue(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str, arg1: str) MaterialX.PyMaterialXCore.Token

Set the string value of a Token by its name, creating a child element to hold the Token if needed.

setType(self: MaterialX.PyMaterialXCore.TypedElement, arg0: str) None

Set the element’s type string.

setVersionIntegers(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: SupportsInt, arg1: SupportsInt) None

Set the major and minor versions as an integer pair.

setVersionString(self: MaterialX.PyMaterialXCore.InterfaceElement, arg0: str) None

Set the version string of this interface.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'variant'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
NODE_DEF_ATTRIBUTE = 'nodedef'
TYPE_ATTRIBUTE = 'type'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.VariantAssign

Bases: Element

A variant assignment element within a Look.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getVariantSetString(self: MaterialX.PyMaterialXCore.VariantAssign) str

Return the element’s variant set string.

getVariantString(self: MaterialX.PyMaterialXCore.VariantAssign) str

Return the element’s variant string.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasVariantSetString(self: MaterialX.PyMaterialXCore.VariantAssign) bool

Return true if the given element has a variant set string.

hasVariantString(self: MaterialX.PyMaterialXCore.VariantAssign) bool

Return true if the given element has a variant string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setVariantSetString(self: MaterialX.PyMaterialXCore.VariantAssign, arg0: str) None

Set the element’s variant set string.

setVariantString(self: MaterialX.PyMaterialXCore.VariantAssign, arg0: str) None

Set the element’s variant string.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'variantassign'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.VariantSet

Bases: Element

A variant set element within a Document.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

addVariant(self: MaterialX.PyMaterialXCore.VariantSet, name: str = '') MaterialX.PyMaterialXCore.Variant

Add a Variant to the variant set.

Parameters:

name – The name of the new Variant. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new Variant.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getVariant(self: MaterialX.PyMaterialXCore.VariantSet, arg0: str) MaterialX.PyMaterialXCore.Variant

Return the Variant, if any, with the given name.

getVariants(self: MaterialX.PyMaterialXCore.VariantSet) list[MaterialX.PyMaterialXCore.Variant]

Return a vector of all Variant elements in the look.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

removeVariant(self: MaterialX.PyMaterialXCore.VariantSet, arg0: str) None

Remove the Variant, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'variantset'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
class MaterialX.PyMaterialXCore.Vector2(*args, **kwargs)

Bases: VectorBase

A vector of two floating-point values.

Overloaded function.

  1. __init__(self: MaterialX.PyMaterialXCore.Vector2) -> None

  2. __init__(self: MaterialX.PyMaterialXCore.Vector2, arg0: typing.SupportsFloat) -> None

  3. __init__(self: MaterialX.PyMaterialXCore.Vector2, arg0: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat], “FixedSize(2)”]) -> None

  4. __init__(self: MaterialX.PyMaterialXCore.Vector2, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> None

  5. __init__(self: MaterialX.PyMaterialXCore.Vector2, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat) -> None

asTuple(self: MaterialX.PyMaterialXCore.Vector2) tuple[float, float]
copy(self: MaterialX.PyMaterialXCore.Vector2) MaterialX.PyMaterialXCore.Vector2
cross(self: MaterialX.PyMaterialXCore.Vector2, arg0: MaterialX.PyMaterialXCore.Vector2) float

Return the cross product of two vectors.

dot(self: MaterialX.PyMaterialXCore.Vector2, arg0: MaterialX.PyMaterialXCore.Vector2) float
getMagnitude(self: MaterialX.PyMaterialXCore.Vector2) float
getNormalized(self: MaterialX.PyMaterialXCore.Vector2) MaterialX.PyMaterialXCore.Vector2
class MaterialX.PyMaterialXCore.Vector3(*args, **kwargs)

Bases: VectorBase

A vector of three floating-point values.

Overloaded function.

  1. __init__(self: MaterialX.PyMaterialXCore.Vector3) -> None

  2. __init__(self: MaterialX.PyMaterialXCore.Vector3, arg0: typing.SupportsFloat) -> None

  3. __init__(self: MaterialX.PyMaterialXCore.Vector3, arg0: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat], “FixedSize(3)”]) -> None

  4. __init__(self: MaterialX.PyMaterialXCore.Vector3, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> None

  5. __init__(self: MaterialX.PyMaterialXCore.Vector3, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> None

asTuple(self: MaterialX.PyMaterialXCore.Vector3) tuple[float, float, float]
copy(self: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Vector3
cross(self: MaterialX.PyMaterialXCore.Vector3, arg0: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Vector3

Return the cross product of two vectors.

dot(self: MaterialX.PyMaterialXCore.Vector3, arg0: MaterialX.PyMaterialXCore.Vector3) float
getMagnitude(self: MaterialX.PyMaterialXCore.Vector3) float
getNormalized(self: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Vector3
class MaterialX.PyMaterialXCore.Vector4(*args, **kwargs)

Bases: VectorBase

A vector of four floating-point values.

Overloaded function.

  1. __init__(self: MaterialX.PyMaterialXCore.Vector4) -> None

  2. __init__(self: MaterialX.PyMaterialXCore.Vector4, arg0: typing.SupportsFloat) -> None

  3. __init__(self: MaterialX.PyMaterialXCore.Vector4, arg0: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat], “FixedSize(4)”]) -> None

  4. __init__(self: MaterialX.PyMaterialXCore.Vector4, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> None

  5. __init__(self: MaterialX.PyMaterialXCore.Vector4, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat, arg3: typing.SupportsFloat) -> None

asTuple(self: MaterialX.PyMaterialXCore.Vector4) tuple[float, float, float, float]
copy(self: MaterialX.PyMaterialXCore.Vector4) MaterialX.PyMaterialXCore.Vector4
dot(self: MaterialX.PyMaterialXCore.Vector4, arg0: MaterialX.PyMaterialXCore.Vector4) float
getMagnitude(self: MaterialX.PyMaterialXCore.Vector4) float
getNormalized(self: MaterialX.PyMaterialXCore.Vector4) MaterialX.PyMaterialXCore.Vector4
class MaterialX.PyMaterialXCore.VectorBase

Bases: pybind11_object

The base class for vectors of scalar values.

class MaterialX.PyMaterialXCore.Visibility

Bases: GeomElement

A visibility element within a Look.

A Visibility describes the visibility relationship between two geometries or geometric collections.

addChild(elementClass, name, typeString='')

Add a child element of the given subclass, name, and optional type string.

addChildOfCategory(self: MaterialX.PyMaterialXCore.Element, category: str, name: str = '') MaterialX.PyMaterialXCore.Element

Add a child element of the given category and name.

Parameters:
  • category – The category string of the new child element. If the category string is recognized, then the corresponding Element subclass is generated; otherwise, a GenericElement is generated.

  • name – The name of the new child element. If no name is specified, then a unique name will automatically be generated.

Returns:

A shared pointer to the new child element.

asString(self: MaterialX.PyMaterialXCore.Element) str

Return a single-line description of this element, including its category, name, and attributes.

changeChildCategory(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: str) MaterialX.PyMaterialXCore.Element

Change the category of the given child element.

Parameters:
  • child – The child element that will be modified.

  • category – The new category string for the child element.

Returns:

A shared pointer to a new child element, containing the contents of the original child but with a new category and subclass.

clearContent(self: MaterialX.PyMaterialXCore.Element) None

Clear all attributes and descendants from this element.

copyContentFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Copy all attributes and descendants from the given element to this one.

Parameters:

source – The element from which content is copied.

createStringResolver(self: MaterialX.PyMaterialXCore.Element, geom: str = '') MaterialX_v1_39_5::StringResolver

Construct a StringResolver at the scope of this element.

Parameters:

geom – An optional geometry name, which will be used to select the applicable set of geometry token substitutions. By default, no geometry token substitutions are applied. If the universal geometry name “/” is given, then all geometry token substitutions are applied,

Returns:

A shared pointer to a StringResolver.

createValidChildName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Using the input name as a starting point, modify it to create a valid, unique name for a child element.

getActiveColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the color space string that is active at the scope of this element, taking all ancestor elements into account.

getActiveFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the file prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the geom prefix string that is active at the scope of this element, taking all ancestor elements into account.

getActiveSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the source URI that is active at the scope of this element, taking all ancestor elements into account.

getAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return the value string of the given attribute.

If the given attribute is not present, then an empty string is returned.

getAttributeNames(self: MaterialX.PyMaterialXCore.Element) list[str]

Return a vector of stored attribute names, in the order they were set.

getCategory(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s category string.

The category of a MaterialX element represents its role within the document, with common examples being “material”, “nodegraph”, and “image”.

getChild(name)

Return the child element, if any, with the given name.

getChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str) int

Return the index of the child, if any, with the given name.

If no child with the given name is found, then -1 is returned.

getChildOfType(elementClass, name)

Return the child element, if any, with the given name and subclass.

getChildren(self: MaterialX.PyMaterialXCore.Element) list[MaterialX.PyMaterialXCore.Element]

Return a constant vector of all child elements.

The returned vector maintains the order in which children were added.

getChildrenOfType(elementClass)

Return a list of all child elements that are instances of the given type. The returned list maintains the order in which children were added.

getCollection(self: MaterialX.PyMaterialXCore.GeomElement) MaterialX_v1_39_5::Collection

Return the Collection that is assigned to this element.

getCollectionString(self: MaterialX.PyMaterialXCore.GeomElement) str

Return the collection string of this element.

getColorSpace(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s color space string.

getDescendant(self: MaterialX.PyMaterialXCore.Element, arg0: str) MaterialX.PyMaterialXCore.Element

Return the element specified by the given hierarchical name path, relative to the current element.

Parameters:

namePath – The relative name path of the specified element.

getDocString(self: MaterialX.PyMaterialXCore.Element) str

Return the documentation string of this element.

getDocument(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::Document
getFilePrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s file prefix string.

getGeom(self: MaterialX.PyMaterialXCore.GeomElement) str

Return the geometry string of this element.

getGeomPrefix(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s geom prefix string.

getInheritString(self: MaterialX.PyMaterialXCore.Element) str

Return the inherit string of this element.

getInheritsFrom(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element

Return the element, if any, that this one directly inherits from.

getName(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s name string.

getNamePath(self: MaterialX.PyMaterialXCore.Element, relativeTo: MaterialX.PyMaterialXCore.Element = None) str

Return the element’s hierarchical name path, relative to the root document.

Parameters:

relativeTo – If a valid ancestor element is specified, then the returned path will be relative to this ancestor.

getNamespace(self: MaterialX.PyMaterialXCore.Element) str

Return the namespace string of this element.

getParent(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getQualifiedName(self: MaterialX.PyMaterialXCore.Element, arg0: str) str

Return a qualified version of the given name, taking the namespace at the scope of this element into account.

getRoot(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSelf(self: MaterialX.PyMaterialXCore.Element) MaterialX.PyMaterialXCore.Element
getSourceUri(self: MaterialX.PyMaterialXCore.Element) str

Return the element’s source URI.

getUpstreamEdge(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX_v1_39_5::Edge

Return the Edge with the given index that lies directly upstream from this element in the dataflow graph.

Parameters:

index – An optional index of the edge to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Edge, if valid, or an empty Edge object.

getUpstreamEdgeCount(self: MaterialX.PyMaterialXCore.Element) int

Return the number of queryable upstream edges for this element.

getUpstreamElement(self: MaterialX.PyMaterialXCore.Element, index: SupportsInt = 0) MaterialX.PyMaterialXCore.Element

Return the Element with the given index that lies directly upstream from this one in the dataflow graph.

Parameters:

index – An optional index of the element to be returned, where the valid index range may be determined with getUpstreamEdgeCount.

Returns:

The upstream Element, if valid, or an empty ElementPtr.

getViewerCollection(self: MaterialX.PyMaterialXCore.Visibility) str

Return the viewer collection string of the element.

getViewerGeom(self: MaterialX.PyMaterialXCore.Visibility) str

Return the viewer geom string of the element.

getVisibilityType(self: MaterialX.PyMaterialXCore.Visibility) str

Return the visibility type string of the element.

getVisible(self: MaterialX.PyMaterialXCore.Visibility) bool

Return the visible boolean of the element.

hasAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) bool

Return true if the given attribute is present.

hasCollectionString(self: MaterialX.PyMaterialXCore.GeomElement) bool

Return true if this element has a collection string.

hasColorSpace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a color space string.

hasFilePrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a file prefix string.

hasGeom(self: MaterialX.PyMaterialXCore.GeomElement) bool

Return true if this element has a geometry string.

hasGeomPrefix(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the given element has a geom prefix string.

hasInheritString(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has an inherit string.

hasInheritanceCycle(self: MaterialX.PyMaterialXCore.Element) bool

Return true if the inheritance chain for this element contains a cycle.

hasInheritedBase(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has the given element as an inherited base, taking the full inheritance chain into account.

hasNamespace(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a namespace string.

hasSourceUri(self: MaterialX.PyMaterialXCore.Element) bool

Return true if this element has a source URI.

hasViewerCollection(self: MaterialX.PyMaterialXCore.Visibility) bool

Return true if the given element has a viewer collection string.

hasViewerGeom(self: MaterialX.PyMaterialXCore.Visibility) bool

Return true if the given element has a viewer geom string.

hasVisibilityType(self: MaterialX.PyMaterialXCore.Visibility) bool

Return true if the given element has a visibility type string.

isA(elementClass, category='')

Return True if this element is an instance of the given subclass. If a category string is specified, then both subclass and category matches are required.

isEquivalent(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element, arg1: MaterialX_v1_39_5::ElementEquivalenceOptions) tuple[bool, str]

Return true if the given element tree, including all descendents, is considered to be equivalent to this one based on the equivalence criteria provided.

Parameters:
  • rhs – Element to compare against

  • options – Equivalence criteria

  • message – Optional text description of differences

Returns:

True if the elements are equivalent. False otherwise.

removeAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the given attribute, if present.

removeChild(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Remove the child element, if any, with the given name.

removeChildOfType(elementClass, name)

Remove the typed child element, if any, with the given name.

setAttribute(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: str) None

Set the value string of the given attribute.

setCategory(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s category string.

setChildIndex(self: MaterialX.PyMaterialXCore.Element, arg0: str, arg1: SupportsInt) None

Set the index of the child, if any, with the given name.

If the given index is out of bounds, then an exception is thrown.

setCollection(self: MaterialX.PyMaterialXCore.GeomElement, arg0: MaterialX_v1_39_5::Collection) None

Assign a Collection to this element.

setCollectionString(self: MaterialX.PyMaterialXCore.GeomElement, arg0: str) None

Set the collection string of this element.

setColorSpace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s color space string.

setDocString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the documentation string of this element.

setFilePrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s file prefix string.

setGeom(self: MaterialX.PyMaterialXCore.GeomElement, arg0: str) None

Set the geometry string of this element.

setGeomPrefix(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s geom prefix string.

setInheritString(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the inherit string of this element.

setInheritsFrom(self: MaterialX.PyMaterialXCore.Element, arg0: MaterialX.PyMaterialXCore.Element) None

Set the element that this one directly inherits from.

setName(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s name string.

setNamespace(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the namespace string of this element.

setSourceUri(self: MaterialX.PyMaterialXCore.Element, arg0: str) None

Set the element’s source URI.

Parameters:

sourceUri – A URI string representing the resource from which this element originates. This string may be used by serialization and deserialization routines to maintain hierarchies of include references.

setViewerCollection(self: MaterialX.PyMaterialXCore.Visibility, arg0: str) None

Set the viewer geom string of the element.

setViewerGeom(self: MaterialX.PyMaterialXCore.Visibility, arg0: str) None

Set the viewer geom string of the element.

setVisibilityType(self: MaterialX.PyMaterialXCore.Visibility, arg0: str) None

Set the visibility type string of the element.

setVisible(self: MaterialX.PyMaterialXCore.Visibility, arg0: bool) None

Set the visible boolean of the element.

traverseGraph(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::GraphIterator

Traverse the dataflow graph from the given element to each of its upstream sources in depth-first order, using pre-order visitation.

Returns:

A GraphIterator object.

traverseInheritance(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::InheritanceIterator

Traverse the inheritance chain from the given element to each element from which it inherits.

Returns:

An InheritanceIterator object.

traverseTree(self: MaterialX.PyMaterialXCore.Element) MaterialX_v1_39_5::TreeIterator

Traverse the tree from the given element to each of its descendants in depth-first order, using pre-order visitation.

Returns:

A TreeIterator object.

validate(self: MaterialX.PyMaterialXCore.Element) tuple[bool, str]

Validate that the given element tree, including all descendants, is consistent with the MaterialX specification.

CATEGORY = 'visibility'
COLOR_SPACE_ATTRIBUTE = 'colorspace'
DOC_ATTRIBUTE = 'doc'
FILE_PREFIX_ATTRIBUTE = 'fileprefix'
GEOM_PREFIX_ATTRIBUTE = 'geomprefix'
INHERIT_ATTRIBUTE = 'inherit'
NAMESPACE_ATTRIBUTE = 'namespace'
NAME_ATTRIBUTE = 'name'
XPOS_ATTRIBUTE = 'xpos'
YPOS_ATTRIBUTE = 'ypos'
MaterialX.PyMaterialXCore.createDocument() MaterialX_v1_39_5::Document
MaterialX.PyMaterialXCore.createNamePath(arg0: collections.abc.Sequence[str]) str

Create a name path from a string vector.

MaterialX.PyMaterialXCore.createValidName(name: str, replaceChar: str = '_') str

Create a valid MaterialX name from the given string.

MaterialX.PyMaterialXCore.geomStringsMatch(arg0: str, arg1: str, arg2: bool) bool

Given two geometry strings, each containing an array of geom names, return true if they have any geometries in common.

An empty geometry string matches no geometries, while the universal geometry string “/” matches all non-empty geometries.

If the contains argument is set to true, then we require that a geom path in the first string completely contains a geom path in the second string.

MaterialX.PyMaterialXCore.getConnectedOutputs(arg0: MaterialX.PyMaterialXCore.Node) list[MaterialX.PyMaterialXCore.Output]

Return a vector of all outputs connected to the given node’s inputs.

MaterialX.PyMaterialXCore.getGeometryBindings(materialNode: MaterialX_v1_39_5::Node, geom: str = '/') list[MaterialX.PyMaterialXCore.MaterialAssign]

Return a vector of all MaterialAssign elements that bind this material node to the given geometry string.

Parameters:
  • materialNode – Node to examine

  • geom – The geometry for which material bindings should be returned. By default, this argument is the universal geometry string “/”, and all material bindings are returned.

Returns:

Vector of MaterialAssign elements

MaterialX.PyMaterialXCore.getShaderNodes(materialNode: MaterialX.PyMaterialXCore.Node, nodeType: str = 'surfaceshader', target: str = '') list[MaterialX.PyMaterialXCore.Node]

Return a vector of all shader nodes connected to the given material node’s inputs, filtered by the given shader type and target.

Parameters:
  • materialNode – The node to examine.

  • nodeType – THe shader node type to return. Defaults to the surface shader type.

  • target – An optional target name, which will be used to filter the returned nodes.

MaterialX.PyMaterialXCore.getVersionIntegers() tuple[int, int, int]

Return the major, minor, and build versions of the MaterialX library as an integer tuple.

MaterialX.PyMaterialXCore.getVersionString() str

Return the version of the MaterialX library as a string.

MaterialX.PyMaterialXCore.incrementName(arg0: str) str

Increment the numeric suffix of a name.

MaterialX.PyMaterialXCore.isValidName(arg0: str) bool

Return true if the given string is a valid MaterialX name.

MaterialX.PyMaterialXCore.joinStrings(arg0: collections.abc.Sequence[str], arg1: str) str

Join a vector of substrings into a single string, placing the given separator between each substring.

MaterialX.PyMaterialXCore.parentNamePath(arg0: str) str

Given a name path, return the parent name path.

MaterialX.PyMaterialXCore.prettyPrint(arg0: MaterialX.PyMaterialXCore.Element) str

Pretty print the given element tree, calling asString recursively on each element in depth-first order.

MaterialX.PyMaterialXCore.replaceSubstrings(arg0: str, arg1: collections.abc.Mapping[str, str]) str

Apply the given substring substitutions to the input string.

MaterialX.PyMaterialXCore.splitNamePath(arg0: str) list[str]

Split a name path into string vector.

MaterialX.PyMaterialXCore.splitString(arg0: str, arg1: str) list[str]

Split a string into a vector of substrings using the given set of separator characters.

MaterialX.PyMaterialXCore.stringEndsWith(arg0: str, arg1: str) bool

Return true if the given string ends with the given suffix.

MaterialX.PyMaterialXCore.stringStartsWith(arg0: str, arg1: str) bool

Return true if the given string starts with the given prefix.

MaterialX.PyMaterialXCore.targetStringsMatch(arg0: str, arg1: str) bool

Given two target strings, each containing a string array of target names, return true if they have any targets in common.

An empty target string matches all targets.