MaterialX Python API Reference¶
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:
TypedElementAn 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.
- 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:
ElementA 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.
- 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:
ElementA 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.
- 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:
VectorBaseA three-component color value.
Overloaded function.
__init__(self: MaterialX.PyMaterialXCore.Color3) -> None
__init__(self: MaterialX.PyMaterialXCore.Color3, arg0: typing.SupportsFloat) -> None
__init__(self: MaterialX.PyMaterialXCore.Color3, arg0: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat], “FixedSize(3)”]) -> None
__init__(self: MaterialX.PyMaterialXCore.Color3, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> None
__init__(self: MaterialX.PyMaterialXCore.Color3, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> None
- asTuple(self: MaterialX.PyMaterialXCore.Color3) tuple[float, float, float]¶
- 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:
VectorBaseA four-component color value.
Overloaded function.
__init__(self: MaterialX.PyMaterialXCore.Color4) -> None
__init__(self: MaterialX.PyMaterialXCore.Color4, arg0: typing.SupportsFloat) -> None
__init__(self: MaterialX.PyMaterialXCore.Color4, arg0: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat], “FixedSize(4)”]) -> None
__init__(self: MaterialX.PyMaterialXCore.Color4, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> None
__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]¶
- 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:
ElementAn 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.
- 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:
GraphElementA 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.
addNodeDefFromGraph(self: MaterialX.PyMaterialXCore.Document, arg0: MaterialX.PyMaterialXCore.NodeGraph, arg1: str, arg2: str, arg3: str) -> MaterialX.PyMaterialXCore.NodeDef
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.
- 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_objectAn 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_objectThe 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.
- 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_objectA 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:
ElementA 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.
- 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:
ElementThe 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.
- 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:
GeomElementA 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.
- 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:
ValueElementA 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.
- 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:
TypedElementAn 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.
getGeomProp(self: MaterialX.PyMaterialXCore.GeomPropDef) -> str
Return the geometric property string of this element.
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.
- 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.
hasGeomProp(self: MaterialX.PyMaterialXCore.GeomPropDef) -> bool
Return true if this element has a geometric property string.
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.
setGeomProp(self: MaterialX.PyMaterialXCore.GeomPropDef, arg0: str) -> None
Set the geometric property string of this element.
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:
InterfaceElementThe 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.
- 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_objectAn 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:
InterfaceElementAn 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.
- 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_objectAn iterator object representing the current state of an inheritance traversal.
- class MaterialX.PyMaterialXCore.Input¶
Bases:
PortElementAn 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.
- 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:
TypedElementThe 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.
- 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:
UnitConverterA 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.
convert(self: MaterialX.PyMaterialXCore.LinearUnitConverter, arg0: typing.SupportsFloat, arg1: str, arg2: str) -> float
convert(self: MaterialX.PyMaterialXCore.LinearUnitConverter, arg0: MaterialX.PyMaterialXCore.Vector2, arg1: str, arg2: str) -> MaterialX.PyMaterialXCore.Vector2
convert(self: MaterialX.PyMaterialXCore.LinearUnitConverter, arg0: MaterialX.PyMaterialXCore.Vector3, arg1: str, arg2: str) -> MaterialX.PyMaterialXCore.Vector3
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:
ElementA 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.
- 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:
ElementA 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.
- 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:
GeomElementA 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.
- 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:
MatrixBaseA 3x3 matrix of floating-point values.
Vector transformation methods follow the row-vector convention, with matrix-vector multiplication computed as v’ = vM.
Overloaded function.
__init__(self: MaterialX.PyMaterialXCore.Matrix33) -> None
__init__(self: MaterialX.PyMaterialXCore.Matrix33, arg0: typing.SupportsFloat) -> None
__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¶
- 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:
MatrixBaseA 4x4 matrix of floating-point values.
Vector transformation methods follow the row-vector convention, with matrix-vector multiplication computed as v’ = vM.
Overloaded function.
__init__(self: MaterialX.PyMaterialXCore.Matrix44) -> None
__init__(self: MaterialX.PyMaterialXCore.Matrix44, arg0: typing.SupportsFloat) -> None
__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¶
- 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_objectThe base class for square matrices of scalar values.
- class MaterialX.PyMaterialXCore.Member¶
Bases:
TypedElementA 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.
- 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:
ElementAn 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.
- 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:
InterfaceElementA 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.
- 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:
InterfaceElementA 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.
- 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:
GraphElementA 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.
- 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:
PortElementA 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.
- 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:
ValueElementThe 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.
- 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:
ValueElementA 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.
- 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:
ValueElementA 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.
- 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:
ElementA 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.
- 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:
GeomElementA 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.
- 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_objectA 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:
TypedElementA 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.
- 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:
ValueElementA 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.
- 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_objectAn 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:
ElementA 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.
- 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:
ElementThe 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.
- 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:
ElementA 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.
- 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_objectAn abstract base class for unit converters.
Each unit converter instance is responsible for a single unit type.
- convert(*args, **kwargs)¶
Overloaded function.
convert(self: MaterialX.PyMaterialXCore.UnitConverter, arg0: typing.SupportsFloat, arg1: str, arg2: str) -> float
convert(self: MaterialX.PyMaterialXCore.UnitConverter, arg0: MaterialX.PyMaterialXCore.Vector2, arg1: str, arg2: str) -> MaterialX.PyMaterialXCore.Vector2
convert(self: MaterialX.PyMaterialXCore.UnitConverter, arg0: MaterialX.PyMaterialXCore.Vector3, arg1: str, arg2: str) -> MaterialX.PyMaterialXCore.Vector3
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_objectA 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:
ElementA 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.
- 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:
ElementA 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.
- 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_objectA 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:
TypedElementThe 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.
- 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:
InterfaceElementA 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.
- 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:
ElementA 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.
- 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:
ElementA 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.
- 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:
VectorBaseA vector of two floating-point values.
Overloaded function.
__init__(self: MaterialX.PyMaterialXCore.Vector2) -> None
__init__(self: MaterialX.PyMaterialXCore.Vector2, arg0: typing.SupportsFloat) -> None
__init__(self: MaterialX.PyMaterialXCore.Vector2, arg0: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat], “FixedSize(2)”]) -> None
__init__(self: MaterialX.PyMaterialXCore.Vector2, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> None
__init__(self: MaterialX.PyMaterialXCore.Vector2, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat) -> None
- asTuple(self: MaterialX.PyMaterialXCore.Vector2) tuple[float, float]¶
- 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:
VectorBaseA vector of three floating-point values.
Overloaded function.
__init__(self: MaterialX.PyMaterialXCore.Vector3) -> None
__init__(self: MaterialX.PyMaterialXCore.Vector3, arg0: typing.SupportsFloat) -> None
__init__(self: MaterialX.PyMaterialXCore.Vector3, arg0: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat], “FixedSize(3)”]) -> None
__init__(self: MaterialX.PyMaterialXCore.Vector3, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> None
__init__(self: MaterialX.PyMaterialXCore.Vector3, arg0: typing.SupportsFloat, arg1: typing.SupportsFloat, arg2: typing.SupportsFloat) -> None
- asTuple(self: MaterialX.PyMaterialXCore.Vector3) tuple[float, float, float]¶
- 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:
VectorBaseA vector of four floating-point values.
Overloaded function.
__init__(self: MaterialX.PyMaterialXCore.Vector4) -> None
__init__(self: MaterialX.PyMaterialXCore.Vector4, arg0: typing.SupportsFloat) -> None
__init__(self: MaterialX.PyMaterialXCore.Vector4, arg0: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat], “FixedSize(4)”]) -> None
__init__(self: MaterialX.PyMaterialXCore.Vector4, arg0: collections.abc.Sequence[typing.SupportsFloat]) -> None
__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]¶
- 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_objectThe base class for vectors of scalar values.
- class MaterialX.PyMaterialXCore.Visibility¶
Bases:
GeomElementA 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.
- 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.
Cross-platform support for document serialization and file utilities.
- exception MaterialX.PyMaterialXFormat.ExceptionFileMissing¶
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.PyMaterialXFormat.ExceptionParseError¶
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.PyMaterialXFormat.FilePath(*args, **kwargs)¶
Bases:
pybind11_objectA generic file path, supporting both syntactic and file system operations.
Overloaded function.
__init__(self: MaterialX.PyMaterialXFormat.FilePath) -> None
__init__(self: MaterialX.PyMaterialXFormat.FilePath, arg0: str) -> None
- static getCurrentPath() MaterialX.PyMaterialXFormat.FilePath¶
Return the current working directory of the file system.
- static getModulePath() MaterialX.PyMaterialXFormat.FilePath¶
Return the directory containing the executable module.
- addExtension(self: MaterialX.PyMaterialXFormat.FilePath, arg0: str) None¶
Add a file extension to the given path.
- asString(self: MaterialX.PyMaterialXFormat.FilePath, format: MaterialX.PyMaterialXFormat.Format = <Format.FormatWindows: 0>) str¶
Return this path as a standard string with the given format.
- createDirectory(self: MaterialX.PyMaterialXFormat.FilePath, recursive: bool = False) None¶
Create a directory on the file system at the given path.
If recursive is true, any missing parent directories will be created as well.
- exists(self: MaterialX.PyMaterialXFormat.FilePath) bool¶
Return true if the given path exists on the file system.
- getBaseName(self: MaterialX.PyMaterialXFormat.FilePath) str¶
Return the base name of the given path, with leading directory information removed.
- getExtension(self: MaterialX.PyMaterialXFormat.FilePath) str¶
Return the file extension of the given path.
- getFilesInDirectory(self: MaterialX.PyMaterialXFormat.FilePath, arg0: str) list[MaterialX.PyMaterialXFormat.FilePath]¶
Return a vector of all files in the given directory with the given extension.
If extension is empty all files are returned.
- getNormalized(self: MaterialX.PyMaterialXFormat.FilePath) MaterialX.PyMaterialXFormat.FilePath¶
Return a normalized version of the given path, collapsing current path and parent path references so that ‘a/.
/b’ and ‘c/../d/../a/b’ become ‘a/b’.
- getParentPath(self: MaterialX.PyMaterialXFormat.FilePath) MaterialX.PyMaterialXFormat.FilePath¶
Return the parent directory of the given path, if any.
If no parent directory is present, then the empty path is returned.
- getSubDirectories(self: MaterialX.PyMaterialXFormat.FilePath) list[MaterialX.PyMaterialXFormat.FilePath]¶
Return a vector of all directories at or beneath the given path.
- isAbsolute(self: MaterialX.PyMaterialXFormat.FilePath) bool¶
Return true if the given path is absolute.
- isDirectory(self: MaterialX.PyMaterialXFormat.FilePath) bool¶
Return true if the given path is a directory on the file system.
- isEmpty(self: MaterialX.PyMaterialXFormat.FilePath) bool¶
Return true if the given path is empty.
- removeExtension(self: MaterialX.PyMaterialXFormat.FilePath) None¶
Remove the file extension, if any, from the given path.
- size(self: MaterialX.PyMaterialXFormat.FilePath) int¶
Return the number of strings in the path.
- class MaterialX.PyMaterialXFormat.FileSearchPath(*args, **kwargs)¶
Bases:
pybind11_objectA sequence of file paths, which may be queried to find the first instance of a given filename on the file system.
Overloaded function.
__init__(self: MaterialX.PyMaterialXFormat.FileSearchPath) -> None
__init__(self: MaterialX.PyMaterialXFormat.FileSearchPath, searchPath: str, sep: str = ‘;’) -> None
- append(*args, **kwargs)¶
Overloaded function.
append(self: MaterialX.PyMaterialXFormat.FileSearchPath, arg0: MaterialX.PyMaterialXFormat.FilePath) -> None
append(self: MaterialX.PyMaterialXFormat.FileSearchPath, arg0: MaterialX.PyMaterialXFormat.FileSearchPath) -> None
- asString(self: MaterialX.PyMaterialXFormat.FileSearchPath, sep: str = ';') str¶
Convert this sequence to a string using the given separator.
- clear(self: MaterialX.PyMaterialXFormat.FileSearchPath) None¶
Clear all paths from the sequence.
- find(self: MaterialX.PyMaterialXFormat.FileSearchPath, arg0: MaterialX.PyMaterialXFormat.FilePath) MaterialX.PyMaterialXFormat.FilePath¶
Given an input filename, iterate through each path in this sequence, returning the first combined path found on the file system.
On success, the combined path is returned; otherwise the original filename is returned unmodified.
- isEmpty(self: MaterialX.PyMaterialXFormat.FileSearchPath) bool¶
Return true if the search path is empty.
- prepend(self: MaterialX.PyMaterialXFormat.FileSearchPath, arg0: MaterialX.PyMaterialXFormat.FilePath) None¶
Prepend the given path to the sequence.
- size(self: MaterialX.PyMaterialXFormat.FileSearchPath) int¶
Return the number of paths in the sequence.
- class MaterialX.PyMaterialXFormat.Format(self: MaterialX.PyMaterialXFormat.Format, value: SupportsInt)¶
Bases:
pybind11_objectMembers:
FormatWindows
FormatPosix
FormatNative
- FormatNative = <Format.FormatWindows: 0>¶
- FormatPosix = <Format.FormatPosix: 1>¶
- FormatWindows = <Format.FormatWindows: 0>¶
- Format.name -> str
- property value¶
- class MaterialX.PyMaterialXFormat.Type(self: MaterialX.PyMaterialXFormat.Type, value: SupportsInt)¶
Bases:
pybind11_objectMembers:
TypeRelative
TypeAbsolute
TypeNetwork
- TypeAbsolute = <Type.TypeAbsolute: 1>¶
- TypeNetwork = <Type.TypeNetwork: 2>¶
- TypeRelative = <Type.TypeRelative: 0>¶
- Type.name -> str
- property value¶
- class MaterialX.PyMaterialXFormat.XmlReadOptions(self: MaterialX.PyMaterialXFormat.XmlReadOptions)¶
Bases:
pybind11_objectA set of options for controlling the behavior of XML read functions.
- property parentXIncludes¶
- property readComments¶
- property readNewlines¶
- property readXIncludeFunction¶
- property upgradeVersion¶
- class MaterialX.PyMaterialXFormat.XmlWriteOptions(self: MaterialX.PyMaterialXFormat.XmlWriteOptions)¶
Bases:
pybind11_objectA set of options for controlling the behavior of XML write functions.
- property elementPredicate¶
- property writeXIncludeEnable¶
- MaterialX.PyMaterialXFormat.flattenFilenames(doc: MaterialX.PyMaterialXCore.Document, searchPath: MaterialX.PyMaterialXFormat.FileSearchPath = <MaterialX.PyMaterialXFormat.FileSearchPath object at 0x00000251AFEA4CB0>, customResolver: MaterialX.PyMaterialXCore.StringResolver = None) None¶
Flatten all filenames in the given document, applying string resolvers at the scope of each element and removing all fileprefix attributes.
- Parameters:
doc – The document to modify.
searchPath – An optional search path for relative to absolute path conversion.
customResolver – An optional custom resolver to apply.
- MaterialX.PyMaterialXFormat.getEnvironmentPath(sep: str = ';') MaterialX.PyMaterialXFormat.FileSearchPath¶
Return a FileSearchPath object from search path environment variable.
- MaterialX.PyMaterialXFormat.getSourceSearchPath(arg0: MaterialX.PyMaterialXCore.Document) MaterialX.PyMaterialXFormat.FileSearchPath¶
Return a file search path containing the parent folder of each source URI in the given document.
- MaterialX.PyMaterialXFormat.getSubdirectories(arg0: collections.abc.Sequence[MaterialX.PyMaterialXFormat.FilePath], arg1: MaterialX.PyMaterialXFormat.FileSearchPath, arg2: collections.abc.Sequence[MaterialX.PyMaterialXFormat.FilePath]) None¶
Get all subdirectories for a given set of directories and search paths.
- MaterialX.PyMaterialXFormat.loadDocuments(rootPath: MaterialX.PyMaterialXFormat.FilePath, searchPath: MaterialX.PyMaterialXFormat.FileSearchPath, skipFiles: collections.abc.Set[str], includeFiles: collections.abc.Set[str], documents: collections.abc.Sequence[MaterialX.PyMaterialXCore.Document], documentsPaths: collections.abc.Sequence[str], readOptions: MaterialX.PyMaterialXFormat.XmlReadOptions = None, errors: collections.abc.Sequence[str] = None) None¶
Scans for all documents under a root path and returns documents which can be loaded.
- MaterialX.PyMaterialXFormat.loadLibraries(libraryFolders: collections.abc.Sequence[MaterialX.PyMaterialXFormat.FilePath], searchPath: MaterialX.PyMaterialXFormat.FileSearchPath, doc: MaterialX.PyMaterialXCore.Document, excludeFiles: collections.abc.Set[str] = set(), readOptions: MaterialX.PyMaterialXFormat.XmlReadOptions = None) set[str]¶
Load all MaterialX files within the given library folders into a document, using the given search path to locate the folders on the file system.
- MaterialX.PyMaterialXFormat.loadLibrary(file: MaterialX.PyMaterialXFormat.FilePath, doc: MaterialX.PyMaterialXCore.Document, searchPath: MaterialX.PyMaterialXFormat.FileSearchPath = <MaterialX.PyMaterialXFormat.FileSearchPath object at 0x00000251AFEA4B30>, readOptions: MaterialX.PyMaterialXFormat.XmlReadOptions = None) None¶
Load a given MaterialX library into a document.
- MaterialX.PyMaterialXFormat.prependXInclude(arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX.PyMaterialXFormat.FilePath) None¶
- MaterialX.PyMaterialXFormat.readFile(arg0: MaterialX.PyMaterialXFormat.FilePath) str¶
Read the given file and return a string containing its contents; if the read is not successful, then the empty string is returned.
- MaterialX.PyMaterialXFormat.readFromXmlFileBase(doc: MaterialX.PyMaterialXCore.Document, filename: MaterialX.PyMaterialXFormat.FilePath, searchPath: MaterialX.PyMaterialXFormat.FileSearchPath = <MaterialX.PyMaterialXFormat.FileSearchPath object at 0x00000251AFE51830>, readOptions: MaterialX.PyMaterialXFormat.XmlReadOptions = None) None¶
Read a Document as XML from the given filename.
- Parameters:
doc – The Document into which data is read.
filename – The filename from which data is read. This argument can be supplied either as a FilePath or a standard string.
searchPath – An optional sequence of file paths that will be applied in order when searching for the given file and its includes. This argument can be supplied either as a FileSearchPath, or as a standard string with paths separated by the PATH_SEPARATOR character.
readOptions – An optional pointer to an XmlReadOptions object. If provided, then the given options will affect the behavior of the read function. Defaults to a null pointer.
- MaterialX.PyMaterialXFormat.readFromXmlString(doc: MaterialX.PyMaterialXCore.Document, str: str, searchPath: MaterialX.PyMaterialXFormat.FileSearchPath = <MaterialX.PyMaterialXFormat.FileSearchPath object at 0x00000251AFE81AF0>, readOptions: MaterialX.PyMaterialXFormat.XmlReadOptions = None) None¶
Read a Document as XML from the given string.
- Parameters:
doc – The Document into which data is read.
str – The string from which data is read.
searchPath – An optional sequence of file paths that will be applied in order when searching for the given file and its includes. This argument can be supplied either as a FileSearchPath, or as a standard string with paths separated by the PATH_SEPARATOR character.
readOptions – An optional pointer to an XmlReadOptions object. If provided, then the given options will affect the behavior of the read function. Defaults to a null pointer.
- MaterialX.PyMaterialXFormat.writeToXmlFile(doc: MaterialX.PyMaterialXCore.Document, filename: MaterialX.PyMaterialXFormat.FilePath, writeOptions: MaterialX.PyMaterialXFormat.XmlWriteOptions = None) None¶
- MaterialX.PyMaterialXFormat.writeToXmlString(doc: MaterialX.PyMaterialXCore.Document, writeOptions: MaterialX.PyMaterialXFormat.XmlWriteOptions = None) str¶
Shader generation using the OpenGL Shading Language.
- class MaterialX.PyMaterialXGenGlsl.EsslShaderGenerator¶
Bases:
GlslShaderGeneratorAn ESSL (OpenGL ES Shading Language) shader generator.
- static create() MaterialX.PyMaterialXGenShader.ShaderGenerator¶
- bindLightShader(self: MaterialX.PyMaterialXCore.NodeDef, arg0: SupportsInt, arg1: MaterialX.PyMaterialXGenShader.GenContext) None¶
- generate(self: MaterialX.PyMaterialXGenGlsl.EsslShaderGenerator, arg0: str, arg1: MaterialX.PyMaterialXCore.Element, arg2: MaterialX.PyMaterialXGenShader.GenContext) MaterialX.PyMaterialXGenShader.Shader¶
- getColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX.PyMaterialXGenShader.ColorManagementSystem¶
Returns the color management system.
- getTarget(self: MaterialX.PyMaterialXGenGlsl.EsslShaderGenerator) str¶
Return a unique identifier for the target this generator is for.
- getTokenSubstitutions(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) dict[str, str]¶
Return the map of token substitutions used by the generator.
- getUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX_v1_39_5::UnitSystem¶
Returns the unit system.
- getVersion(self: MaterialX.PyMaterialXGenGlsl.EsslShaderGenerator) str¶
Return the version string for the ESSL version this generator is for.
- registerShaderMetadata(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX_v1_39_5::GenContext) None¶
Register metadata that should be exported to the generated shaders.
Supported metadata includes standard UI attributes like “uiname”, “uifolder”, “uimin”, “uimax”, etc. But it is also extendable by defining custom attributes using AttributeDefs. Any AttributeDef in the given document with exportable=”true” will be exported as shader metadata when found on nodes during shader generation. Derived shader generators may override this method to change the registration. Applications must explicitly call this method before shader generation to enable export of metadata.
- registerTypeDefs(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document) None¶
Register type definitions from the document.
- setColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXGenShader.ColorManagementSystem) None¶
Sets the color management system.
- setUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX_v1_39_5::UnitSystem) None¶
Sets the unit system.
- unbindLightShader(self: SupportsInt, arg0: MaterialX.PyMaterialXGenShader.GenContext) None¶
- unbindLightShaders(self: MaterialX.PyMaterialXGenShader.GenContext) None¶
- class MaterialX.PyMaterialXGenGlsl.GlslResourceBindingContext(self: MaterialX.PyMaterialXGenGlsl.GlslResourceBindingContext, arg0: SupportsInt, arg1: SupportsInt)¶
Bases:
HwResourceBindingContextClass representing a resource binding for Glsl shader resources.
- static create(arg0: SupportsInt, arg1: SupportsInt) MaterialX.PyMaterialXGenGlsl.GlslResourceBindingContext¶
- emitDirectives(self: MaterialX.PyMaterialXGenGlsl.GlslResourceBindingContext, arg0: MaterialX.PyMaterialXGenShader.GenContext, arg1: MaterialX.PyMaterialXGenShader.ShaderStage) None¶
- emitResourceBindings(self: MaterialX.PyMaterialXGenGlsl.GlslResourceBindingContext, arg0: MaterialX.PyMaterialXGenShader.GenContext, arg1: MaterialX.PyMaterialXGenShader.VariableBlock, arg2: MaterialX.PyMaterialXGenShader.ShaderStage) None¶
- class MaterialX.PyMaterialXGenGlsl.GlslShaderGenerator¶
Bases:
HwShaderGeneratorBase class for GLSL (OpenGL Shading Language) code generation.
A generator for a specific GLSL target should be derived from this class.
- static create() MaterialX.PyMaterialXGenShader.ShaderGenerator¶
- bindLightShader(self: MaterialX.PyMaterialXCore.NodeDef, arg0: SupportsInt, arg1: MaterialX.PyMaterialXGenShader.GenContext) None¶
- generate(self: MaterialX.PyMaterialXGenGlsl.GlslShaderGenerator, arg0: str, arg1: MaterialX.PyMaterialXCore.Element, arg2: MaterialX.PyMaterialXGenShader.GenContext) MaterialX.PyMaterialXGenShader.Shader¶
Generate a shader starting from the given element, translating the element and all dependencies upstream into shader code.
- getColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX.PyMaterialXGenShader.ColorManagementSystem¶
Returns the color management system.
- getTarget(self: MaterialX.PyMaterialXGenGlsl.GlslShaderGenerator) str¶
Return a unique identifier for the target this generator is for.
- getTokenSubstitutions(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) dict[str, str]¶
Return the map of token substitutions used by the generator.
- getUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX_v1_39_5::UnitSystem¶
Returns the unit system.
- getVersion(self: MaterialX.PyMaterialXGenGlsl.GlslShaderGenerator) str¶
Return the version string for the GLSL version this generator is for.
- registerShaderMetadata(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX_v1_39_5::GenContext) None¶
Register metadata that should be exported to the generated shaders.
Supported metadata includes standard UI attributes like “uiname”, “uifolder”, “uimin”, “uimax”, etc. But it is also extendable by defining custom attributes using AttributeDefs. Any AttributeDef in the given document with exportable=”true” will be exported as shader metadata when found on nodes during shader generation. Derived shader generators may override this method to change the registration. Applications must explicitly call this method before shader generation to enable export of metadata.
- registerTypeDefs(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document) None¶
Register type definitions from the document.
- setColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXGenShader.ColorManagementSystem) None¶
Sets the color management system.
- setUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX_v1_39_5::UnitSystem) None¶
Sets the unit system.
- unbindLightShader(self: SupportsInt, arg0: MaterialX.PyMaterialXGenShader.GenContext) None¶
- unbindLightShaders(self: MaterialX.PyMaterialXGenShader.GenContext) None¶
- class MaterialX.PyMaterialXGenGlsl.VkShaderGenerator¶
Bases:
GlslShaderGeneratorA Vulkan GLSL shader generator.
- static create() MaterialX.PyMaterialXGenShader.ShaderGenerator¶
- bindLightShader(self: MaterialX.PyMaterialXCore.NodeDef, arg0: SupportsInt, arg1: MaterialX.PyMaterialXGenShader.GenContext) None¶
- generate(self: MaterialX.PyMaterialXGenGlsl.VkShaderGenerator, arg0: str, arg1: MaterialX.PyMaterialXCore.Element, arg2: MaterialX.PyMaterialXGenShader.GenContext) MaterialX.PyMaterialXGenShader.Shader¶
- getColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX.PyMaterialXGenShader.ColorManagementSystem¶
Returns the color management system.
- getTarget(self: MaterialX.PyMaterialXGenGlsl.VkShaderGenerator) str¶
Return a unique identifier for the target this generator is for.
- getTokenSubstitutions(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) dict[str, str]¶
Return the map of token substitutions used by the generator.
- getUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX_v1_39_5::UnitSystem¶
Returns the unit system.
- getVersion(self: MaterialX.PyMaterialXGenGlsl.VkShaderGenerator) str¶
Return the version string for the GLSL version this generator is for.
- registerShaderMetadata(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX_v1_39_5::GenContext) None¶
Register metadata that should be exported to the generated shaders.
Supported metadata includes standard UI attributes like “uiname”, “uifolder”, “uimin”, “uimax”, etc. But it is also extendable by defining custom attributes using AttributeDefs. Any AttributeDef in the given document with exportable=”true” will be exported as shader metadata when found on nodes during shader generation. Derived shader generators may override this method to change the registration. Applications must explicitly call this method before shader generation to enable export of metadata.
- registerTypeDefs(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document) None¶
Register type definitions from the document.
- setColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXGenShader.ColorManagementSystem) None¶
Sets the color management system.
- setUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX_v1_39_5::UnitSystem) None¶
Sets the unit system.
- unbindLightShader(self: SupportsInt, arg0: MaterialX.PyMaterialXGenShader.GenContext) None¶
- unbindLightShaders(self: MaterialX.PyMaterialXGenShader.GenContext) None¶
- class MaterialX.PyMaterialXGenGlsl.WgslShaderGenerator¶
Bases:
GlslShaderGeneratorWGSL Flavor of Vulkan GLSL shader generator.
- static create() MaterialX.PyMaterialXGenShader.ShaderGenerator¶
- bindLightShader(self: MaterialX.PyMaterialXCore.NodeDef, arg0: SupportsInt, arg1: MaterialX.PyMaterialXGenShader.GenContext) None¶
- generate(self: MaterialX.PyMaterialXGenGlsl.WgslShaderGenerator, arg0: str, arg1: MaterialX.PyMaterialXCore.Element, arg2: MaterialX.PyMaterialXGenShader.GenContext) MaterialX.PyMaterialXGenShader.Shader¶
- getColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX.PyMaterialXGenShader.ColorManagementSystem¶
Returns the color management system.
- getTarget(self: MaterialX.PyMaterialXGenGlsl.WgslShaderGenerator) str¶
- getTokenSubstitutions(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) dict[str, str]¶
Return the map of token substitutions used by the generator.
- getUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX_v1_39_5::UnitSystem¶
Returns the unit system.
- getVersion(self: MaterialX.PyMaterialXGenGlsl.WgslShaderGenerator) str¶
- registerShaderMetadata(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX_v1_39_5::GenContext) None¶
Register metadata that should be exported to the generated shaders.
Supported metadata includes standard UI attributes like “uiname”, “uifolder”, “uimin”, “uimax”, etc. But it is also extendable by defining custom attributes using AttributeDefs. Any AttributeDef in the given document with exportable=”true” will be exported as shader metadata when found on nodes during shader generation. Derived shader generators may override this method to change the registration. Applications must explicitly call this method before shader generation to enable export of metadata.
- registerTypeDefs(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document) None¶
Register type definitions from the document.
- setColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXGenShader.ColorManagementSystem) None¶
Sets the color management system.
- setUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX_v1_39_5::UnitSystem) None¶
Sets the unit system.
- unbindLightShader(self: SupportsInt, arg0: MaterialX.PyMaterialXGenShader.GenContext) None¶
- unbindLightShaders(self: MaterialX.PyMaterialXGenShader.GenContext) None¶
Shader generation using the Material Definition Language.
- class MaterialX.PyMaterialXGenMdl.MdlShaderGenerator¶
Bases:
ShaderGeneratorShader generator for MDL (Material Definition Language).
- static create() MaterialX.PyMaterialXGenShader.ShaderGenerator¶
- generate(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: str, arg1: MaterialX.PyMaterialXCore.Element, arg2: MaterialX_v1_39_5::GenContext) MaterialX.PyMaterialXGenShader.Shader¶
Generate a shader starting from the given element, translating the element and all dependencies upstream into shader code.
- getColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX.PyMaterialXGenShader.ColorManagementSystem¶
Returns the color management system.
- getTarget(self: MaterialX.PyMaterialXGenMdl.MdlShaderGenerator) str¶
Return a unique identifier for the target this generator is for.
- getTokenSubstitutions(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) dict[str, str]¶
Return the map of token substitutions used by the generator.
- getUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX_v1_39_5::UnitSystem¶
Returns the unit system.
- registerShaderMetadata(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX_v1_39_5::GenContext) None¶
Register metadata that should be exported to the generated shaders.
Supported metadata includes standard UI attributes like “uiname”, “uifolder”, “uimin”, “uimax”, etc. But it is also extendable by defining custom attributes using AttributeDefs. Any AttributeDef in the given document with exportable=”true” will be exported as shader metadata when found on nodes during shader generation. Derived shader generators may override this method to change the registration. Applications must explicitly call this method before shader generation to enable export of metadata.
- registerTypeDefs(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document) None¶
Register type definitions from the document.
- setColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXGenShader.ColorManagementSystem) None¶
Sets the color management system.
- setUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX_v1_39_5::UnitSystem) None¶
Sets the unit system.
Shader generation using the Metal Shading Language.
- class MaterialX.PyMaterialXGenMsl.MslResourceBindingContext(self: MaterialX.PyMaterialXGenMsl.MslResourceBindingContext, arg0: SupportsInt, arg1: SupportsInt)¶
Bases:
HwResourceBindingContext- static create(arg0: SupportsInt, arg1: SupportsInt) MaterialX.PyMaterialXGenMsl.MslResourceBindingContext¶
- emitDirectives(self: MaterialX.PyMaterialXGenMsl.MslResourceBindingContext, arg0: MaterialX.PyMaterialXGenShader.GenContext, arg1: MaterialX.PyMaterialXGenShader.ShaderStage) None¶
- emitResourceBindings(self: MaterialX.PyMaterialXGenMsl.MslResourceBindingContext, arg0: MaterialX.PyMaterialXGenShader.GenContext, arg1: MaterialX.PyMaterialXGenShader.VariableBlock, arg2: MaterialX.PyMaterialXGenShader.ShaderStage) None¶
- class MaterialX.PyMaterialXGenMsl.MslShaderGenerator¶
Bases:
HwShaderGenerator- static create() MaterialX.PyMaterialXGenShader.ShaderGenerator¶
- bindLightShader(self: MaterialX.PyMaterialXCore.NodeDef, arg0: SupportsInt, arg1: MaterialX.PyMaterialXGenShader.GenContext) None¶
- generate(self: MaterialX.PyMaterialXGenMsl.MslShaderGenerator, arg0: str, arg1: MaterialX.PyMaterialXCore.Element, arg2: MaterialX.PyMaterialXGenShader.GenContext) MaterialX.PyMaterialXGenShader.Shader¶
- getColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX.PyMaterialXGenShader.ColorManagementSystem¶
Returns the color management system.
- getTarget(self: MaterialX.PyMaterialXGenMsl.MslShaderGenerator) str¶
- getTokenSubstitutions(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) dict[str, str]¶
Return the map of token substitutions used by the generator.
- getUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX_v1_39_5::UnitSystem¶
Returns the unit system.
- getVersion(self: MaterialX.PyMaterialXGenMsl.MslShaderGenerator) str¶
- registerShaderMetadata(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX_v1_39_5::GenContext) None¶
Register metadata that should be exported to the generated shaders.
Supported metadata includes standard UI attributes like “uiname”, “uifolder”, “uimin”, “uimax”, etc. But it is also extendable by defining custom attributes using AttributeDefs. Any AttributeDef in the given document with exportable=”true” will be exported as shader metadata when found on nodes during shader generation. Derived shader generators may override this method to change the registration. Applications must explicitly call this method before shader generation to enable export of metadata.
- registerTypeDefs(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document) None¶
Register type definitions from the document.
- setColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXGenShader.ColorManagementSystem) None¶
Sets the color management system.
- setUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX_v1_39_5::UnitSystem) None¶
Sets the unit system.
- unbindLightShader(self: SupportsInt, arg0: MaterialX.PyMaterialXGenShader.GenContext) None¶
- unbindLightShaders(self: MaterialX.PyMaterialXGenShader.GenContext) None¶
Shader generation using Open Shading Language.
- class MaterialX.PyMaterialXGenOsl.OslShaderGenerator¶
Bases:
ShaderGeneratorBase class for OSL (Open Shading Language) shader generators.
A generator for a specific OSL target should be derived from this class.
- static create() MaterialX.PyMaterialXGenShader.ShaderGenerator¶
- generate(self: MaterialX.PyMaterialXGenOsl.OslShaderGenerator, arg0: str, arg1: MaterialX.PyMaterialXCore.Element, arg2: MaterialX.PyMaterialXGenShader.GenContext) MaterialX.PyMaterialXGenShader.Shader¶
Generate a shader starting from the given element, translating the element and all dependencies upstream into shader code.
- getColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX.PyMaterialXGenShader.ColorManagementSystem¶
Returns the color management system.
- getTarget(self: MaterialX.PyMaterialXGenOsl.OslShaderGenerator) str¶
Return a unique identifier for the target this generator is for.
- getTokenSubstitutions(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) dict[str, str]¶
Return the map of token substitutions used by the generator.
- getUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX_v1_39_5::UnitSystem¶
Returns the unit system.
- registerShaderMetadata(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX_v1_39_5::GenContext) None¶
Register metadata that should be exported to the generated shaders.
Supported metadata includes standard UI attributes like “uiname”, “uifolder”, “uimin”, “uimax”, etc. But it is also extendable by defining custom attributes using AttributeDefs. Any AttributeDef in the given document with exportable=”true” will be exported as shader metadata when found on nodes during shader generation. Derived shader generators may override this method to change the registration. Applications must explicitly call this method before shader generation to enable export of metadata.
- registerTypeDefs(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document) None¶
Register type definitions from the document.
- setColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXGenShader.ColorManagementSystem) None¶
Sets the color management system.
- setUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX_v1_39_5::UnitSystem) None¶
Sets the unit system.
Core shader generation support for MaterialX.
- class MaterialX.PyMaterialXGenShader.ApplicationVariableHandler¶
Bases:
pybind11_object
- class MaterialX.PyMaterialXGenShader.ColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ColorManagementSystem)¶
Bases:
pybind11_objectAbstract base class for color management systems.
- getName(self: MaterialX.PyMaterialXGenShader.ColorManagementSystem) str¶
Return the ColorManagementSystem name.
- loadLibrary(self: MaterialX.PyMaterialXGenShader.ColorManagementSystem, arg0: MaterialX.PyMaterialXCore.Document) None¶
Load a library of implementations from the provided document, replacing any previously loaded content.
- supportsTransform(self: MaterialX.PyMaterialXGenShader.ColorManagementSystem, arg0: MaterialX.PyMaterialXGenShader.ColorSpaceTransform) bool¶
Returns whether this color management system supports a provided transform.
- class MaterialX.PyMaterialXGenShader.ColorSpaceTransform(self: MaterialX.PyMaterialXGenShader.ColorSpaceTransform, arg0: str, arg1: str, arg2: MaterialX_v1_39_5::TypeDesc)¶
Bases:
pybind11_objectStructure that represents color space transform information.
- property sourceSpace¶
- property targetSpace¶
- property type¶
- class MaterialX.PyMaterialXGenShader.DefaultColorManagementSystem¶
Bases:
ColorManagementSystemClass for a default color management system.
- static create(arg0: str) MaterialX.PyMaterialXGenShader.DefaultColorManagementSystem¶
Create a new DefaultColorManagementSystem.
- getName(self: MaterialX.PyMaterialXGenShader.DefaultColorManagementSystem) str¶
Return the DefaultColorManagementSystem name.
- loadLibrary(self: MaterialX.PyMaterialXGenShader.ColorManagementSystem, arg0: MaterialX.PyMaterialXCore.Document) None¶
Load a library of implementations from the provided document, replacing any previously loaded content.
- supportsTransform(self: MaterialX.PyMaterialXGenShader.ColorManagementSystem, arg0: MaterialX.PyMaterialXGenShader.ColorSpaceTransform) bool¶
Returns whether this color management system supports a provided transform.
- class MaterialX.PyMaterialXGenShader.GenContext(self: MaterialX.PyMaterialXGenShader.GenContext, arg0: MaterialX.PyMaterialXGenShader.ShaderGenerator)¶
Bases:
pybind11_objectA context class for shader generation.
Used for thread local storage of data needed during shader generation.
- getApplicationVariableHandler(self: MaterialX.PyMaterialXGenShader.GenContext) collections.abc.Callable[[MaterialX_v1_39_5::ShaderNode, MaterialX.PyMaterialXGenShader.GenContext], None]¶
Get handler for application variables.
- getOptions(self: MaterialX.PyMaterialXGenShader.GenContext) MaterialX_v1_39_5::GenOptions¶
- getShaderGenerator(self: MaterialX.PyMaterialXGenShader.GenContext) MaterialX.PyMaterialXGenShader.ShaderGenerator¶
Return shader generatior.
- getTypeDesc(self: MaterialX.PyMaterialXGenShader.GenContext, arg0: str) MaterialX_v1_39_5::TypeDesc¶
Return a TypeDesc for the given type name.
- pushUserData(self: MaterialX.PyMaterialXGenShader.GenContext, arg0: str, arg1: MaterialX_v1_39_5::GenUserData) None¶
Add user data to the context to make it available during shader generator.
- registerSourceCodeSearchPath(*args, **kwargs)¶
Overloaded function.
registerSourceCodeSearchPath(self: MaterialX.PyMaterialXGenShader.GenContext, arg0: MaterialX.PyMaterialXFormat.FilePath) -> None
registerSourceCodeSearchPath(self: MaterialX.PyMaterialXGenShader.GenContext, arg0: MaterialX.PyMaterialXFormat.FileSearchPath) -> None
- resolveSourceFile(self: MaterialX.PyMaterialXGenShader.GenContext, arg0: MaterialX.PyMaterialXFormat.FilePath, arg1: MaterialX.PyMaterialXFormat.FilePath) MaterialX.PyMaterialXFormat.FilePath¶
Resolve a source code filename, first checking the given local path then checking any file paths registered by the user.
- setApplicationVariableHandler(self: MaterialX.PyMaterialXGenShader.GenContext, arg0: collections.abc.Callable[[MaterialX_v1_39_5::ShaderNode, MaterialX.PyMaterialXGenShader.GenContext], None]) None¶
Set handler for application variables.
- class MaterialX.PyMaterialXGenShader.GenOptions(self: MaterialX.PyMaterialXGenShader.GenOptions)¶
Bases:
pybind11_objectClass holding options to configure shader generation.
- property addUpstreamDependencies¶
- property distributeLayerOverBsdfMix¶
- property elideConstantNodes¶
- property emitColorTransforms¶
- property fileTextureVerticalFlip¶
- property hwAmbientOcclusion¶
- property hwImplicitBitangents¶
- property hwMaxActiveLightSources¶
- property hwNormalizeUdimTexCoords¶
- property hwShadowMap¶
- property hwSpecularEnvironmentMethod¶
- property hwSrgbEncodeOutput¶
- property hwTransparency¶
- property hwWriteAlbedoTable¶
- property hwWriteDepthMoments¶
- property hwWriteEnvPrefilter¶
- property libraryPrefix¶
- property premultipliedBsdfAdd¶
- property shaderInterfaceType¶
- property targetColorSpaceOverride¶
- property targetDistanceUnit¶
- class MaterialX.PyMaterialXGenShader.GenUserData¶
Bases:
pybind11_objectBase class for custom user data needed during shader generation.
- class MaterialX.PyMaterialXGenShader.HwResourceBindingContext¶
Bases:
GenUserData- emitDirectives(self: MaterialX.PyMaterialXGenShader.HwResourceBindingContext, arg0: MaterialX.PyMaterialXGenShader.GenContext, arg1: MaterialX.PyMaterialXGenShader.ShaderStage) None¶
- emitResourceBindings(self: MaterialX.PyMaterialXGenShader.HwResourceBindingContext, arg0: MaterialX.PyMaterialXGenShader.GenContext, arg1: MaterialX.PyMaterialXGenShader.VariableBlock, arg2: MaterialX.PyMaterialXGenShader.ShaderStage) None¶
- class MaterialX.PyMaterialXGenShader.HwShaderGenerator¶
Bases:
ShaderGenerator- bindLightShader(self: MaterialX.PyMaterialXCore.NodeDef, arg0: SupportsInt, arg1: MaterialX.PyMaterialXGenShader.GenContext) None¶
- generate(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: str, arg1: MaterialX.PyMaterialXCore.Element, arg2: MaterialX_v1_39_5::GenContext) MaterialX.PyMaterialXGenShader.Shader¶
Generate a shader starting from the given element, translating the element and all dependencies upstream into shader code.
- getColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX.PyMaterialXGenShader.ColorManagementSystem¶
Returns the color management system.
- getTarget(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) str¶
Return the name of the target this generator is for.
- getTokenSubstitutions(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) dict[str, str]¶
Return the map of token substitutions used by the generator.
- getUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX_v1_39_5::UnitSystem¶
Returns the unit system.
- registerShaderMetadata(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX_v1_39_5::GenContext) None¶
Register metadata that should be exported to the generated shaders.
Supported metadata includes standard UI attributes like “uiname”, “uifolder”, “uimin”, “uimax”, etc. But it is also extendable by defining custom attributes using AttributeDefs. Any AttributeDef in the given document with exportable=”true” will be exported as shader metadata when found on nodes during shader generation. Derived shader generators may override this method to change the registration. Applications must explicitly call this method before shader generation to enable export of metadata.
- registerTypeDefs(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document) None¶
Register type definitions from the document.
- setColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXGenShader.ColorManagementSystem) None¶
Sets the color management system.
- setUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX_v1_39_5::UnitSystem) None¶
Sets the unit system.
- unbindLightShader(self: SupportsInt, arg0: MaterialX.PyMaterialXGenShader.GenContext) None¶
- unbindLightShaders(self: MaterialX.PyMaterialXGenShader.GenContext) None¶
- class MaterialX.PyMaterialXGenShader.HwSpecularEnvironmentMethod(self: MaterialX.PyMaterialXGenShader.HwSpecularEnvironmentMethod, value: SupportsInt)¶
Bases:
pybind11_objectMembers:
SPECULAR_ENVIRONMENT_PREFILTER
SPECULAR_ENVIRONMENT_FIS
SPECULAR_ENVIRONMENT_NONE
- SPECULAR_ENVIRONMENT_FIS = <HwSpecularEnvironmentMethod.SPECULAR_ENVIRONMENT_FIS: 1>¶
- SPECULAR_ENVIRONMENT_NONE = <HwSpecularEnvironmentMethod.SPECULAR_ENVIRONMENT_NONE: 0>¶
- SPECULAR_ENVIRONMENT_PREFILTER = <HwSpecularEnvironmentMethod.SPECULAR_ENVIRONMENT_PREFILTER: 2>¶
- HwSpecularEnvironmentMethod.name -> str
- property value¶
- class MaterialX.PyMaterialXGenShader.Shader(self: MaterialX.PyMaterialXGenShader.Shader, arg0: str, arg1: MaterialX_v1_39_5::ShaderGraph)¶
Bases:
pybind11_objectClass containing all data needed during shader generation.
After generation is completed it will contain the resulting source code emitted by shader generators.
The class contains a default implementation using a single shader stage. Derived shaders can override this, as well as overriding all methods that add code to the shader.
- getAttribute(self: MaterialX.PyMaterialXGenShader.Shader, arg0: str) MaterialX.PyMaterialXCore.Value¶
Return the value for a named attribute, or nullptr if no such attribute is found.
- getName(self: MaterialX.PyMaterialXGenShader.Shader) str¶
Return the shader name.
- getSourceCode(self: MaterialX.PyMaterialXGenShader.Shader, arg0: str) str¶
Return the shader source code for a given shader stage.
- getStage(*args, **kwargs)¶
Overloaded function.
getStage(self: MaterialX.PyMaterialXGenShader.Shader, arg0: typing.SupportsInt) -> MaterialX_v1_39_5::ShaderStage
getStage(self: MaterialX.PyMaterialXGenShader.Shader, arg0: str) -> MaterialX_v1_39_5::ShaderStage
- hasAttribute(self: MaterialX.PyMaterialXGenShader.Shader, arg0: str) bool¶
Return true if the shader has a given named attribute.
- hasStage(self: MaterialX.PyMaterialXGenShader.Shader, arg0: str) bool¶
Return if stage exists.
- numStages(self: MaterialX.PyMaterialXGenShader.Shader) int¶
Return the number of shader stages for this shader.
- setAttribute(*args, **kwargs)¶
Overloaded function.
setAttribute(self: MaterialX.PyMaterialXGenShader.Shader, arg0: str) -> None
setAttribute(self: MaterialX.PyMaterialXGenShader.Shader, arg0: str, arg1: MaterialX.PyMaterialXCore.Value) -> None
- class MaterialX.PyMaterialXGenShader.ShaderGenerator¶
Bases:
pybind11_objectBase class for shader generators All third-party shader generators should derive from this class.
Derived classes should use DECLARE_SHADER_GENERATOR / DEFINE_SHADER_GENERATOR in their declaration / definition, and register with the Registry class.
- generate(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: str, arg1: MaterialX.PyMaterialXCore.Element, arg2: MaterialX_v1_39_5::GenContext) MaterialX.PyMaterialXGenShader.Shader¶
Generate a shader starting from the given element, translating the element and all dependencies upstream into shader code.
- getColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX.PyMaterialXGenShader.ColorManagementSystem¶
Returns the color management system.
- getTarget(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) str¶
Return the name of the target this generator is for.
- getTokenSubstitutions(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) dict[str, str]¶
Return the map of token substitutions used by the generator.
- getUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX_v1_39_5::UnitSystem¶
Returns the unit system.
- registerShaderMetadata(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX_v1_39_5::GenContext) None¶
Register metadata that should be exported to the generated shaders.
Supported metadata includes standard UI attributes like “uiname”, “uifolder”, “uimin”, “uimax”, etc. But it is also extendable by defining custom attributes using AttributeDefs. Any AttributeDef in the given document with exportable=”true” will be exported as shader metadata when found on nodes during shader generation. Derived shader generators may override this method to change the registration. Applications must explicitly call this method before shader generation to enable export of metadata.
- registerTypeDefs(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document) None¶
Register type definitions from the document.
- setColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXGenShader.ColorManagementSystem) None¶
Sets the color management system.
- setUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX_v1_39_5::UnitSystem) None¶
Sets the unit system.
- class MaterialX.PyMaterialXGenShader.ShaderInterfaceType(self: MaterialX.PyMaterialXGenShader.ShaderInterfaceType, value: SupportsInt)¶
Bases:
pybind11_objectMembers:
SHADER_INTERFACE_COMPLETE
SHADER_INTERFACE_REDUCED
- SHADER_INTERFACE_COMPLETE = <ShaderInterfaceType.SHADER_INTERFACE_COMPLETE: 0>¶
- SHADER_INTERFACE_REDUCED = <ShaderInterfaceType.SHADER_INTERFACE_REDUCED: 1>¶
- ShaderInterfaceType.name -> str
- property value¶
- class MaterialX.PyMaterialXGenShader.ShaderPort¶
Bases:
pybind11_objectAn input or output port on a ShaderNode.
- getColorSpace(self: MaterialX.PyMaterialXGenShader.ShaderPort) str¶
Return the source color space for the value on this port.
- getFullName(self: MaterialX.PyMaterialXGenShader.ShaderPort) str¶
Return the name of this port.
- getGeomProp(self: MaterialX.PyMaterialXGenShader.ShaderPort) str¶
Get geomprop name.
- getName(self: MaterialX.PyMaterialXGenShader.ShaderPort) str¶
Return the name of this port.
- getPath(self: MaterialX.PyMaterialXGenShader.ShaderPort) str¶
Return the path to this port.
- getSemantic(self: MaterialX.PyMaterialXGenShader.ShaderPort) str¶
Return the variable semantic of this port.
- getType(self: MaterialX.PyMaterialXGenShader.ShaderPort) MaterialX_v1_39_5::TypeDesc¶
Return the data type for this port.
- getUnit(self: MaterialX.PyMaterialXGenShader.ShaderPort) str¶
Return the unit type for the value on this port.
- getValue(self: MaterialX.PyMaterialXGenShader.ShaderPort) MaterialX.PyMaterialXCore.Value¶
Return the value set on this port.
- getValueString(self: MaterialX.PyMaterialXGenShader.ShaderPort) str¶
Return the value set on this port as a string, or an empty string if there is no value.
- getVariable(self: MaterialX.PyMaterialXGenShader.ShaderPort) str¶
Return the variable name of this port.
- isEmitted(self: MaterialX.PyMaterialXGenShader.ShaderPort) bool¶
Return the emitted state of this port.
- isUniform(self: MaterialX.PyMaterialXGenShader.ShaderPort) bool¶
Return the uniform flag on this port.
- setColorSpace(self: MaterialX.PyMaterialXGenShader.ShaderPort, arg0: str) None¶
Set a source color space for the value on this port.
- setGeomProp(self: MaterialX.PyMaterialXGenShader.ShaderPort, arg0: str) None¶
Set geomprop name if the input has a default geomprop to be assigned when it is unconnected.
- setName(self: MaterialX.PyMaterialXGenShader.ShaderPort, arg0: str) None¶
Set the name of this port.
- setPath(self: MaterialX.PyMaterialXGenShader.ShaderPort, arg0: str) None¶
Set the path to this port.
- setSemantic(self: MaterialX.PyMaterialXGenShader.ShaderPort, arg0: str) None¶
Set the variable semantic of this port.
- setType(self: MaterialX.PyMaterialXGenShader.ShaderPort, arg0: MaterialX_v1_39_5::TypeDesc) None¶
Set the data type for this port.
- setUnit(self: MaterialX.PyMaterialXGenShader.ShaderPort, arg0: str) None¶
Set a unit type for the value on this port.
- setValue(self: MaterialX.PyMaterialXGenShader.ShaderPort, arg0: MaterialX.PyMaterialXCore.Value, arg1: bool) None¶
Set a value on this port.
- setVariable(self: MaterialX.PyMaterialXGenShader.ShaderPort, arg0: str) None¶
Set the variable name of this port.
- class MaterialX.PyMaterialXGenShader.ShaderPortPredicate¶
Bases:
pybind11_object
- class MaterialX.PyMaterialXGenShader.ShaderStage(self: MaterialX.PyMaterialXGenShader.ShaderStage, arg0: str, arg1: MaterialX_v1_39_5::Syntax)¶
Bases:
pybind11_objectA shader stage, containing the state and resulting source code for the stage.
- getConstantBlock(self: MaterialX.PyMaterialXGenShader.ShaderStage) MaterialX.PyMaterialXGenShader.VariableBlock¶
- getFunctionName(self: MaterialX.PyMaterialXGenShader.ShaderStage) str¶
Return the stage function name.
- getIncludes(self: MaterialX.PyMaterialXGenShader.ShaderStage) set[str]¶
Return a set of all include files.
- getInputBlock(self: MaterialX.PyMaterialXGenShader.ShaderStage, arg0: str) MaterialX.PyMaterialXGenShader.VariableBlock¶
- getInputBlocks(self: MaterialX.PyMaterialXGenShader.ShaderStage) dict[str, MaterialX.PyMaterialXGenShader.VariableBlock]¶
Return a map of all input blocks.
- getName(self: MaterialX.PyMaterialXGenShader.ShaderStage) str¶
Return the stage name.
- getOutputBlock(self: MaterialX.PyMaterialXGenShader.ShaderStage, arg0: str) MaterialX.PyMaterialXGenShader.VariableBlock¶
- getOutputBlocks(self: MaterialX.PyMaterialXGenShader.ShaderStage) dict[str, MaterialX.PyMaterialXGenShader.VariableBlock]¶
Return a map of all output blocks.
- getSourceCode(self: MaterialX.PyMaterialXGenShader.ShaderStage) str¶
Return the stage source code.
- getSourceDependencies(self: MaterialX.PyMaterialXGenShader.ShaderStage) set[str]¶
Return a set of all source dependencies.
- getUniformBlock(self: MaterialX.PyMaterialXGenShader.ShaderStage, arg0: str) MaterialX.PyMaterialXGenShader.VariableBlock¶
- getUniformBlocks(self: MaterialX.PyMaterialXGenShader.ShaderStage) dict[str, MaterialX.PyMaterialXGenShader.VariableBlock]¶
Return a map of all uniform blocks.
- class MaterialX.PyMaterialXGenShader.ShaderTranslator¶
Bases:
pybind11_objectA helper class for translating content between shading models.
- static create() MaterialX.PyMaterialXGenShader.ShaderTranslator¶
- translateAllMaterials(self: MaterialX.PyMaterialXGenShader.ShaderTranslator, arg0: MaterialX.PyMaterialXCore.Document, arg1: str) None¶
Translate each material in the input document to the destination shading model.
- translateShader(self: MaterialX.PyMaterialXGenShader.ShaderTranslator, arg0: MaterialX.PyMaterialXCore.Node, arg1: str) None¶
Translate a shader node to the destination shading model.
- class MaterialX.PyMaterialXGenShader.TypeDesc¶
Bases:
pybind11_objectA type descriptor for MaterialX data types.
All types need to have a type descriptor registered in order for shader generators to know about the type. It can be used for type comparisons as well as getting more information about the type. Type descriptors for all standard library data types are defined by default and can be accessed from the Type namespace, e.g. Type::FLOAT. Custom struct types defined through typedef elements in a data library are loaded in and registered by calling the ShaderGenerator::registerTypeDefs method. The TypeSystem class, see below, is used to manage all type descriptions. It can be used to query the registered types.
- getBaseType(self: MaterialX.PyMaterialXGenShader.TypeDesc) int¶
Return the basetype for the type.
- getName(self: MaterialX.PyMaterialXGenShader.TypeDesc) str¶
Return the name of the type.
- getSemantic(self: MaterialX.PyMaterialXGenShader.TypeDesc) int¶
Return the semantic for the type.
- getSize(self: MaterialX.PyMaterialXGenShader.TypeDesc) int¶
Return the number of elements the type is composed of.
Will return 1 for scalar types and a size greater than 1 for aggregate type. For array types 0 is returned since the number of elements is undefined until an array is instantiated.
- isAggregate(self: MaterialX.PyMaterialXGenShader.TypeDesc) bool¶
Return true if the type is an aggregate type.
- isArray(self: MaterialX.PyMaterialXGenShader.TypeDesc) bool¶
Return true if the type is an array type.
- isClosure(self: MaterialX.PyMaterialXGenShader.TypeDesc) bool¶
Return true if the type represents a closure.
- isFloat2(self: MaterialX.PyMaterialXGenShader.TypeDesc) bool¶
Return true if the type is an aggregate of 2 floats.
- isFloat3(self: MaterialX.PyMaterialXGenShader.TypeDesc) bool¶
Return true if the type is an aggregate of 3 floats.
- isFloat4(self: MaterialX.PyMaterialXGenShader.TypeDesc) bool¶
Return true if the type is an aggregate of 4 floats.
- isScalar(self: MaterialX.PyMaterialXGenShader.TypeDesc) bool¶
Return true if the type is a scalar type.
- class MaterialX.PyMaterialXGenShader.UnitSystem¶
Bases:
pybind11_objectBase unit system support.
- static create(arg0: str) MaterialX.PyMaterialXGenShader.UnitSystem¶
Create a new UnitSystem.
- getName(self: MaterialX.PyMaterialXGenShader.UnitSystem) str¶
Return the UnitSystem name.
- getUnitConverterRegistry(self: MaterialX.PyMaterialXGenShader.UnitSystem) MaterialX.PyMaterialXCore.UnitConverterRegistry¶
Returns the currently assigned unit converter registry.
- loadLibrary(self: MaterialX.PyMaterialXGenShader.UnitSystem, arg0: MaterialX.PyMaterialXCore.Document) None¶
assign document with unit implementations replacing any previously loaded content.
- setUnitConverterRegistry(self: MaterialX.PyMaterialXGenShader.UnitSystem, arg0: MaterialX.PyMaterialXCore.UnitConverterRegistry) None¶
Assign unit converter registry replacing any previous assignment.
- supportsTransform(self: MaterialX.PyMaterialXGenShader.UnitSystem, arg0: MaterialX.PyMaterialXGenShader.UnitTransform) bool¶
Returns whether this unit system supports a provided transform.
- class MaterialX.PyMaterialXGenShader.UnitTransform(self: MaterialX.PyMaterialXGenShader.UnitTransform, arg0: str, arg1: str, arg2: MaterialX.PyMaterialXGenShader.TypeDesc, arg3: str)¶
Bases:
pybind11_objectStructure that represents unit transform information.
- property sourceUnit¶
- property targetUnit¶
- property type¶
- property unitType¶
- class MaterialX.PyMaterialXGenShader.VariableBlock(self: MaterialX.PyMaterialXGenShader.VariableBlock, arg0: str, arg1: str)¶
Bases:
pybind11_objectA block of variables in a shader stage.
- empty(self: MaterialX.PyMaterialXGenShader.VariableBlock) bool¶
Return true if the block has no variables.
- find(*args, **kwargs)¶
Overloaded function.
find(self: MaterialX.PyMaterialXGenShader.VariableBlock, arg0: str) -> MaterialX.PyMaterialXGenShader.ShaderPort
find(self: MaterialX.PyMaterialXGenShader.VariableBlock, arg0: collections.abc.Callable[[MaterialX.PyMaterialXGenShader.ShaderPort], bool]) -> MaterialX.PyMaterialXGenShader.ShaderPort
- getInstance(self: MaterialX.PyMaterialXGenShader.VariableBlock) str¶
Get the instance name of this block.
- getName(self: MaterialX.PyMaterialXGenShader.VariableBlock) str¶
Get the name of this block.
- size(self: MaterialX.PyMaterialXGenShader.VariableBlock) int¶
Return the number of variables in this block.
- MaterialX.PyMaterialXGenShader.connectsToWorldSpaceNode(arg0: MaterialX.PyMaterialXCore.Output) MaterialX.PyMaterialXCore.Node¶
Determine whether the given output is directly connected to a node that generates world-space coordinates (e.g.
- Parameters:
output – Output to check
- Returns:
Return the node if found.
- MaterialX.PyMaterialXGenShader.elementRequiresShading(arg0: MaterialX.PyMaterialXCore.TypedElement) bool¶
Determine if a given element requires shading / lighting for rendering.
- MaterialX.PyMaterialXGenShader.findRenderableElements(doc: MaterialX.PyMaterialXCore.Document, includeReferencedGraphs: bool = False) list[MaterialX.PyMaterialXCore.TypedElement]¶
- MaterialX.PyMaterialXGenShader.findRenderableMaterialNodes(arg0: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXCore.TypedElement]¶
- MaterialX.PyMaterialXGenShader.getNodeDefInput(arg0: MaterialX.PyMaterialXCore.Input, arg1: str) MaterialX.PyMaterialXCore.Input¶
Given a node input, return the corresponding input within its matching nodedef.
The optional target string can be used to guide the selection of nodedef declarations.
- MaterialX.PyMaterialXGenShader.getUdimCoordinates(arg0: collections.abc.Sequence[str]) list[MaterialX.PyMaterialXCore.Vector2]¶
Compute the UDIM coordinates for a set of UDIM identifiers.
- Returns:
List of UDIM coordinates
- MaterialX.PyMaterialXGenShader.getUdimScaleAndOffset(arg0: collections.abc.Sequence[MaterialX.PyMaterialXCore.Vector2], arg1: MaterialX.PyMaterialXCore.Vector2, arg2: MaterialX.PyMaterialXCore.Vector2) None¶
Get the UV scale and offset to transform uv coordinates from UDIM uv space to 0..1 space.
- MaterialX.PyMaterialXGenShader.hasElementAttributes(arg0: MaterialX.PyMaterialXCore.Output, arg1: collections.abc.Sequence[str]) bool¶
Returns true if there is are any value elements with a given set of attributes either on the starting node or any graph upsstream of that node.
- Parameters:
output – Starting node
attributes – Attributes to test for
- MaterialX.PyMaterialXGenShader.isTransparentSurface(arg0: MaterialX.PyMaterialXCore.Element, arg1: str) bool¶
Returns true if the given element is a surface shader with the potential of being transparent.
This can be used by HW shader generators to determine if a shader will require transparency handling.
Note: This function will check some common cases for how a surface shader can be transparent. It is not covering all possible cases for how transparency can be done and target applications might need to do additional checks to track transparency correctly. For example, custom surface shader nodes implemented in source code will not be tracked by this function and transparency for such nodes must be tracked separately by the target application.
- MaterialX.PyMaterialXGenShader.mapValueToColor(arg0: MaterialX.PyMaterialXCore.Value, arg1: MaterialX.PyMaterialXCore.Color4) None¶
Maps a value to a four channel color if it is of the appropriate type.
Supported types include float, Vector2, Vector3, Vector4, and Color4. If not mapping is possible the color value is set to opaque black.
- MaterialX.PyMaterialXGenShader.requiresImplementation(arg0: MaterialX.PyMaterialXCore.NodeDef) bool¶
Return whether a nodedef requires an implementation.
- MaterialX.PyMaterialXGenShader.tokenSubstitution(arg0: collections.abc.Mapping[str, str], arg1: str) None¶
Perform token substitutions on the given source string, using the given substitution map.
Tokens are required to start with ‘$’ and can only consist of alphanumeric characters. The full token name, including ‘$’ and all following alphanumeric character, will be replaced by the corresponding string in the substitution map, if the token exists in the map.
Shader generation using the Slang shading language.
- class MaterialX.PyMaterialXGenSlang.SlangShaderGenerator¶
Bases:
HwShaderGeneratorBase class for Slang code generation.
A generator for a specific Slang target should be derived from this class.
- static create() MaterialX.PyMaterialXGenShader.ShaderGenerator¶
- bindLightShader(self: MaterialX.PyMaterialXCore.NodeDef, arg0: SupportsInt, arg1: MaterialX.PyMaterialXGenShader.GenContext) None¶
- generate(self: MaterialX.PyMaterialXGenSlang.SlangShaderGenerator, arg0: str, arg1: MaterialX.PyMaterialXCore.Element, arg2: MaterialX.PyMaterialXGenShader.GenContext) MaterialX.PyMaterialXGenShader.Shader¶
Generate a shader starting from the given element, translating the element and all dependencies upstream into shader code.
- getColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX.PyMaterialXGenShader.ColorManagementSystem¶
Returns the color management system.
- getTarget(self: MaterialX.PyMaterialXGenSlang.SlangShaderGenerator) str¶
Return a unique identifier for the target this generator is for.
- getTokenSubstitutions(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) dict[str, str]¶
Return the map of token substitutions used by the generator.
- getUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator) MaterialX_v1_39_5::UnitSystem¶
Returns the unit system.
- getVersion(self: MaterialX.PyMaterialXGenSlang.SlangShaderGenerator) str¶
Return the version string for the Slang version this generator is for.
- registerShaderMetadata(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX_v1_39_5::GenContext) None¶
Register metadata that should be exported to the generated shaders.
Supported metadata includes standard UI attributes like “uiname”, “uifolder”, “uimin”, “uimax”, etc. But it is also extendable by defining custom attributes using AttributeDefs. Any AttributeDef in the given document with exportable=”true” will be exported as shader metadata when found on nodes during shader generation. Derived shader generators may override this method to change the registration. Applications must explicitly call this method before shader generation to enable export of metadata.
- registerTypeDefs(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXCore.Document) None¶
Register type definitions from the document.
- setColorManagementSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX.PyMaterialXGenShader.ColorManagementSystem) None¶
Sets the color management system.
- setUnitSystem(self: MaterialX.PyMaterialXGenShader.ShaderGenerator, arg0: MaterialX_v1_39_5::UnitSystem) None¶
Sets the unit system.
- unbindLightShader(self: SupportsInt, arg0: MaterialX.PyMaterialXGenShader.GenContext) None¶
- unbindLightShaders(self: MaterialX.PyMaterialXGenShader.GenContext) None¶
Core rendering support for MaterialX.
- exception MaterialX.PyMaterialXRender.ExceptionRenderError¶
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.PyMaterialXRender.BaseType(self: MaterialX.PyMaterialXRender.BaseType, value: SupportsInt)¶
Bases:
pybind11_objectMembers:
UINT8
INT8
UINT16
INT16
HALF
FLOAT
- FLOAT = <BaseType.FLOAT: 5>¶
- HALF = <BaseType.HALF: 4>¶
- INT16 = <BaseType.INT16: 3>¶
- INT8 = <BaseType.INT8: 1>¶
- UINT16 = <BaseType.UINT16: 2>¶
- UINT8 = <BaseType.UINT8: 0>¶
- BaseType.name -> str
- property value¶
- class MaterialX.PyMaterialXRender.Camera¶
Bases:
pybind11_objectA simple camera class, supporting transform matrices and arcball functionality for object-viewing applications.
- static create() MaterialX.PyMaterialXRender.Camera¶
Create a new camera.
- static createOrthographicMatrix(arg0: SupportsFloat, arg1: SupportsFloat, arg2: SupportsFloat, arg3: SupportsFloat, arg4: SupportsFloat, arg5: SupportsFloat) MaterialX.PyMaterialXCore.Matrix44¶
Create an orthographic projection matrix given a set of clip planes with [-1,1] projected Z.
- static createPerspectiveMatrix(arg0: SupportsFloat, arg1: SupportsFloat, arg2: SupportsFloat, arg3: SupportsFloat, arg4: SupportsFloat, arg5: SupportsFloat) MaterialX.PyMaterialXCore.Matrix44¶
Create a perspective projection matrix given a set of clip planes with [-1,1] projected Z.
- static createViewMatrix(arg0: MaterialX.PyMaterialXCore.Vector3, arg1: MaterialX.PyMaterialXCore.Vector3, arg2: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Matrix44¶
Create a view matrix given an eye position, a target position and an up vector.
- static transformPointPerspective(arg0: MaterialX.PyMaterialXCore.Matrix44, arg1: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Vector3¶
Apply a perspective transform to the given 3D point, performing a homogeneous divide on the transformed result.
- getProjectionMatrix(self: MaterialX.PyMaterialXRender.Camera) MaterialX.PyMaterialXCore.Matrix44¶
Return the projection matrix.
- getViewDirection(self: MaterialX.PyMaterialXRender.Camera) MaterialX.PyMaterialXCore.Vector3¶
Derive viewer direction from the view matrix.
- getViewMatrix(self: MaterialX.PyMaterialXRender.Camera) MaterialX.PyMaterialXCore.Matrix44¶
Return the view matrix.
- getViewPosition(self: MaterialX.PyMaterialXRender.Camera) MaterialX.PyMaterialXCore.Vector3¶
Derive viewer position from the view matrix.
- getViewportSize(self: MaterialX.PyMaterialXRender.Camera) MaterialX.PyMaterialXCore.Vector2¶
Return the size of the viewport window.
- getWorldMatrix(self: MaterialX.PyMaterialXRender.Camera) MaterialX.PyMaterialXCore.Matrix44¶
Return the world matrix.
- getWorldViewProjMatrix(self: MaterialX.PyMaterialXRender.Camera) MaterialX.PyMaterialXCore.Matrix44¶
Compute our full model-view-projection matrix.
- projectToViewport(self: MaterialX.PyMaterialXRender.Camera, arg0: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Vector3¶
Project a position from object to viewport space.
- setProjectionMatrix(self: MaterialX.PyMaterialXRender.Camera, arg0: MaterialX.PyMaterialXCore.Matrix44) None¶
Set the projection matrix.
- setViewMatrix(self: MaterialX.PyMaterialXRender.Camera, arg0: MaterialX.PyMaterialXCore.Matrix44) None¶
Set the view matrix.
- setViewportSize(self: MaterialX.PyMaterialXRender.Camera, arg0: MaterialX.PyMaterialXCore.Vector2) None¶
Set the size of the viewport window.
- setWorldMatrix(self: MaterialX.PyMaterialXRender.Camera, arg0: MaterialX.PyMaterialXCore.Matrix44) None¶
Set the world matrix.
- unprojectFromViewport(self: MaterialX.PyMaterialXRender.Camera, arg0: MaterialX.PyMaterialXCore.Vector3) MaterialX.PyMaterialXCore.Vector3¶
Unproject a position from viewport to object space.
- class MaterialX.PyMaterialXRender.CgltfLoader(self: MaterialX.PyMaterialXRender.CgltfLoader)¶
Bases:
GeometryLoaderWrapper for loader to read in GLTF files using the Cgltf library.
- static create() MaterialX.PyMaterialXRender.CgltfLoader¶
Create a new loader.
- load(self: MaterialX.PyMaterialXRender.CgltfLoader, arg0: MaterialX.PyMaterialXFormat.FilePath, arg1: collections.abc.Sequence[MaterialX.PyMaterialXRender.Mesh], arg2: bool) bool¶
Load geometry from file path.
- supportedExtensions(self: MaterialX.PyMaterialXRender.GeometryLoader) set[str]¶
Returns a list of supported extensions.
- Returns:
List of support extensions
- class MaterialX.PyMaterialXRender.GeometryHandler(self: MaterialX.PyMaterialXRender.GeometryHandler)¶
Bases:
pybind11_objectClass which holds a set of geometry loaders.
Each loader is associated with a given set of file extensions.
- static create() MaterialX.PyMaterialXRender.GeometryHandler¶
Create a new geometry handler.
- addLoader(self: MaterialX.PyMaterialXRender.GeometryHandler, arg0: MaterialX.PyMaterialXRender.GeometryLoader) None¶
Add a geometry loader.
- Parameters:
loader – Loader to add to list of available loaders.
- clearGeometry(self: MaterialX.PyMaterialXRender.GeometryHandler) None¶
Clear all loaded geometry.
- findParentMesh(self: MaterialX.PyMaterialXRender.GeometryHandler, arg0: MaterialX.PyMaterialXRender.MeshPartition) MaterialX.PyMaterialXRender.Mesh¶
Return the first mesh in our list containing the given partition.
If no matching mesh is found, then nullptr is returned.
- getGeometry(self: MaterialX.PyMaterialXRender.GeometryHandler, arg0: collections.abc.Sequence[MaterialX.PyMaterialXRender.Mesh], arg1: str) None¶
- getMaximumBounds(self: MaterialX.PyMaterialXRender.GeometryHandler) MaterialX.PyMaterialXCore.Vector3¶
Return the minimum bounds for all meshes.
- getMeshes(self: MaterialX.PyMaterialXRender.GeometryHandler) list[MaterialX.PyMaterialXRender.Mesh]¶
Get list of meshes.
- getMinimumBounds(self: MaterialX.PyMaterialXRender.GeometryHandler) MaterialX.PyMaterialXCore.Vector3¶
Return the minimum bounds for all meshes.
- hasGeometry(self: MaterialX.PyMaterialXRender.GeometryHandler, arg0: str) bool¶
- loadGeometry(self: MaterialX.PyMaterialXRender.GeometryHandler, arg0: MaterialX.PyMaterialXFormat.FilePath, arg1: bool) bool¶
Load geometry from a given location.
- Parameters:
filePath – Path to geometry
texcoordVerticalFlip – Flip texture coordinates in V. Default is to not flip.
- class MaterialX.PyMaterialXRender.GeometryLoader(self: MaterialX.PyMaterialXRender.GeometryLoader)¶
Bases:
pybind11_objectBase class representing a geometry loader.
A loader can be associated with one or more file extensions.
- load(self: MaterialX.PyMaterialXRender.GeometryLoader, arg0: MaterialX.PyMaterialXFormat.FilePath, arg1: collections.abc.Sequence[MaterialX.PyMaterialXRender.Mesh], arg2: bool) bool¶
Load geometry from disk.
- Parameters:
filePath – Path to file to load
meshList – List of meshes to update
texcoordVerticalFlip – Flip texture coordinates in V when loading
- Returns:
True if load was successful
- supportedExtensions(self: MaterialX.PyMaterialXRender.GeometryLoader) set[str]¶
Returns a list of supported extensions.
- Returns:
List of support extensions
- class MaterialX.PyMaterialXRender.Image¶
Bases:
pybind11_objectClass representing an image in system memory.
- static create(arg0: SupportsInt, arg1: SupportsInt, arg2: SupportsInt, arg3: MaterialX.PyMaterialXRender.BaseType) MaterialX.PyMaterialXRender.Image¶
Create an empty image with the given properties.
- applyBoxBlur(self: MaterialX.PyMaterialXRender.Image) MaterialX.PyMaterialXRender.Image¶
Apply a 3x3 box blur to this image, returning a new blurred image.
- applyBoxDownsample(self: MaterialX.PyMaterialXRender.Image, arg0: SupportsInt) MaterialX.PyMaterialXRender.Image¶
Downsample this image by an integer factor using a box filter, returning the new reduced image.
- applyGammaTransform(self: MaterialX.PyMaterialXRender.Image, arg0: SupportsFloat) None¶
Apply the given gamma transform to all texels of this image.
- applyGaussianBlur(self: MaterialX.PyMaterialXRender.Image) MaterialX.PyMaterialXRender.Image¶
Apply a 7x7 Gaussian blur to this image, returning a new blurred image.
- applyMatrixTransform(self: MaterialX.PyMaterialXRender.Image, arg0: MaterialX.PyMaterialXCore.Matrix33) None¶
Apply the given matrix transform to all texels of this image.
- copy(self: MaterialX.PyMaterialXRender.Image, arg0: SupportsInt, arg1: MaterialX.PyMaterialXRender.BaseType) MaterialX.PyMaterialXRender.Image¶
Create a copy of this image with the given channel count and base type.
- createResourceBuffer(self: MaterialX.PyMaterialXRender.Image) None¶
Allocate a resource buffer for this image that matches its properties.
- getBaseStride(self: MaterialX.PyMaterialXRender.Image) int¶
Return the stride of our base type in bytes.
- getBaseType(self: MaterialX.PyMaterialXRender.Image) MaterialX.PyMaterialXRender.BaseType¶
Return the base type of the image.
- getChannelCount(self: MaterialX.PyMaterialXRender.Image) int¶
Return the channel count of the image.
- getHeight(self: MaterialX.PyMaterialXRender.Image) int¶
Return the height of the image.
- getMaxMipCount(self: MaterialX.PyMaterialXRender.Image) int¶
Return the maximum number of mipmaps for this image.
- getResourceBuffer(self: MaterialX.PyMaterialXRender.Image) int¶
Return the resource buffer for this image.
- getResourceBufferDeallocator(self: MaterialX.PyMaterialXRender.Image) collections.abc.Callable[[typing_extensions.CapsuleType], None]¶
Return the resource buffer deallocator for this image.
- getTexelColor(self: MaterialX.PyMaterialXRender.Image, arg0: SupportsInt, arg1: SupportsInt) MaterialX.PyMaterialXCore.Color4¶
Return the texel color at the given coordinates.
If the coordinates or image resource buffer are invalid, then an exception is thrown.
- getWidth(self: MaterialX.PyMaterialXRender.Image) int¶
Return the width of the image.
- isUniformColor(self: MaterialX.PyMaterialXRender.Image, arg0: MaterialX.PyMaterialXCore.Color4) bool¶
Return true if all texels of this image are identical in color.
- Parameters:
uniformColor – Return the uniform color of the image, if any.
- releaseResourceBuffer(self: MaterialX.PyMaterialXRender.Image) None¶
Release the resource buffer for this image.
- setResourceBuffer(self: MaterialX.PyMaterialXRender.Image, arg0: typing_extensions.CapsuleType) None¶
Set the resource buffer for this image.
- setResourceBufferDeallocator(self: MaterialX.PyMaterialXRender.Image, arg0: collections.abc.Callable[[typing_extensions.CapsuleType], None]) None¶
Set the resource buffer deallocator for this image.
- setTexelColor(self: MaterialX.PyMaterialXRender.Image, arg0: SupportsInt, arg1: SupportsInt, arg2: MaterialX.PyMaterialXCore.Color4) None¶
Set the texel color at the given coordinates.
If the coordinates or image resource buffer are invalid, then an exception is thrown.
- setUniformColor(self: MaterialX.PyMaterialXRender.Image, arg0: MaterialX.PyMaterialXCore.Color4) None¶
Set all texels of this image to a uniform color.
- splitByLuminance(self: MaterialX.PyMaterialXRender.Image, arg0: SupportsFloat) tuple[MaterialX.PyMaterialXRender.Image, MaterialX.PyMaterialXRender.Image]¶
Split this image by the given luminance threshold, returning the resulting underflow and overflow images.
- class MaterialX.PyMaterialXRender.ImageBufferDeallocator¶
Bases:
pybind11_object
- class MaterialX.PyMaterialXRender.ImageHandler¶
Bases:
pybind11_objectBase image handler class.
Keeps track of images which are loaded from disk via supplied ImageLoader. Derived classes are responsible for determining how to perform the logic for “binding” of these resources for a given target (such as a given shading language).
- static create(arg0: MaterialX.PyMaterialXRender.ImageLoader) MaterialX.PyMaterialXRender.ImageHandler¶
- acquireImage(self: MaterialX.PyMaterialXRender.ImageHandler, filePath: MaterialX.PyMaterialXFormat.FilePath, defaultColor: MaterialX.PyMaterialXCore.Color4 = <MaterialX.PyMaterialXCore.Color4 object at 0x00000251BA562170>) MaterialX.PyMaterialXRender.Image¶
Acquire an image from the cache or file system.
- Parameters:
filePath – File path of the image.
defaultColor – Default color to use as a fallback for missing images.
- Returns:
On success, a shared pointer to the acquired image.
- addLoader(self: MaterialX.PyMaterialXRender.ImageHandler, arg0: MaterialX.PyMaterialXRender.ImageLoader) None¶
Add another image loader to the handler, which will be invoked if existing loaders cannot load a given image.
- bindImage(self: MaterialX.PyMaterialXRender.ImageHandler, arg0: MaterialX.PyMaterialXRender.Image, arg1: MaterialX.PyMaterialXRender.ImageSamplingProperties) bool¶
Bind an image for rendering.
- Parameters:
image – The image to bind.
samplingProperties – Sampling properties for the image.
- clearImageCache(self: MaterialX.PyMaterialXRender.ImageHandler) None¶
Clear the contents of the image cache, first releasing any render resources associated with cached images.
- createRenderResources(self: MaterialX.PyMaterialXRender.ImageHandler, arg0: MaterialX.PyMaterialXRender.Image, arg1: bool, arg2: bool) bool¶
Create rendering resources for the given image.
- getFilenameResolver(self: MaterialX.PyMaterialXRender.ImageHandler) MaterialX.PyMaterialXCore.StringResolver¶
Return the filename resolver for images.
- getReferencedImages(self: MaterialX.PyMaterialXRender.ImageHandler, arg0: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXRender.Image]¶
Acquire all images referenced by the given document, and return the images in a vector.
- getSearchPath(self: MaterialX.PyMaterialXRender.ImageHandler) MaterialX.PyMaterialXFormat.FileSearchPath¶
Return the image search path.
- getZeroImage(self: MaterialX.PyMaterialXRender.ImageHandler) MaterialX.PyMaterialXRender.Image¶
Return a fallback image with zeroes in all channels.
- releaseRenderResources(self: MaterialX.PyMaterialXRender.ImageHandler, image: MaterialX.PyMaterialXRender.Image = None) None¶
Release rendering resources for the given image, or for all cached images if no image pointer is specified.
- saveImage(self: MaterialX.PyMaterialXRender.ImageHandler, filePath: MaterialX.PyMaterialXFormat.FilePath, image: MaterialX.PyMaterialXRender.Image, verticalFlip: bool = False) bool¶
Save image to disk.
- Parameters:
filePath – File path to be written
image – The image to be saved
verticalFlip – Whether the image should be flipped in Y during save
- Returns:
if save succeeded
- setFilenameResolver(self: MaterialX.PyMaterialXRender.ImageHandler, arg0: MaterialX.PyMaterialXCore.StringResolver) None¶
Set the filename resolver for images.
- setSearchPath(self: MaterialX.PyMaterialXRender.ImageHandler, arg0: MaterialX.PyMaterialXFormat.FileSearchPath) None¶
Set the search path to be used for finding images on the file system.
- unbindImage(self: MaterialX.PyMaterialXRender.ImageHandler, arg0: MaterialX.PyMaterialXRender.Image) bool¶
Unbind an image, making it no longer active for rendering.
- Parameters:
image – The image to unbind.
- unbindImages(self: MaterialX.PyMaterialXRender.ImageHandler) None¶
Unbind all images that are currently stored in the cache.
- class MaterialX.PyMaterialXRender.ImageLoader(self: MaterialX.PyMaterialXRender.ImageLoader)¶
Bases:
pybind11_objectAbstract base class for file-system image loaders.
- loadImage(self: MaterialX.PyMaterialXRender.ImageLoader, arg0: MaterialX.PyMaterialXFormat.FilePath) MaterialX.PyMaterialXRender.Image¶
Load an image from the file system.
- Parameters:
filePath – The requested image file path.
- Returns:
On success, a shared pointer to the loaded image; otherwise an empty shared pointer.
- saveImage(self: MaterialX.PyMaterialXRender.ImageLoader, arg0: MaterialX.PyMaterialXFormat.FilePath, arg1: MaterialX.PyMaterialXRender.Image, arg2: bool) bool¶
Save an image to the file system.
- Parameters:
filePath – File path to be written
image – The image to be saved
verticalFlip – Whether the image should be flipped in Y during save
- Returns:
if save succeeded
- supportedExtensions(self: MaterialX.PyMaterialXRender.ImageLoader) set[str]¶
Returns a list of supported extensions.
- Returns:
List of support extensions
- BMP_EXTENSION = 'bmp'¶
- EXR_EXTENSION = 'exr'¶
- GIF_EXTENSION = 'gif'¶
- HDR_EXTENSION = 'hdr'¶
- JPEG_EXTENSION = 'jpeg'¶
- JPG_EXTENSION = 'jpg'¶
- PIC_EXTENSION = 'pic'¶
- PNG_EXTENSION = 'png'¶
- PSD_EXTENSION = 'psd'¶
- TGA_EXTENSION = 'tga'¶
- TIFF_EXTENSION = 'tiff'¶
- TIF_EXTENSION = 'tif'¶
- TXT_EXTENSION = 'txt'¶
- class MaterialX.PyMaterialXRender.ImageSamplingProperties¶
Bases:
pybind11_objectInterface to describe sampling properties for images.
- property defaultColor¶
- property filterType¶
- property uaddressMode¶
- property vaddressMode¶
- class MaterialX.PyMaterialXRender.LightHandler(self: MaterialX.PyMaterialXRender.LightHandler)¶
Bases:
pybind11_objectUtility light handler for creating and providing light data for shader binding.
- static create() MaterialX.PyMaterialXRender.LightHandler¶
Create a new light handler.
- addLightSource(self: MaterialX.PyMaterialXRender.LightHandler, arg0: MaterialX.PyMaterialXCore.Node) None¶
Add a light source.
- computeLightIdMap(self: MaterialX.PyMaterialXRender.LightHandler, arg0: collections.abc.Sequence[MaterialX.PyMaterialXCore.Node]) dict[str, int]¶
From a set of nodes, create a mapping of corresponding nodedef identifiers to numbers.
- findLights(self: MaterialX.PyMaterialXRender.LightHandler, arg0: MaterialX.PyMaterialXCore.Document, arg1: collections.abc.Sequence[MaterialX.PyMaterialXCore.Node]) None¶
Find lights to use based on an input document.
- Parameters:
doc – Document to scan for lights
lights – List of lights found in document
- getAlbedoTable(self: MaterialX.PyMaterialXRender.LightHandler) MaterialX_v1_39_5::Image¶
Return the directional albedo table.
- getDirectLighting(self: MaterialX.PyMaterialXRender.LightHandler) bool¶
Return whether direct lighting is enabled.
- getEnvIrradianceMap(self: MaterialX.PyMaterialXRender.LightHandler) MaterialX_v1_39_5::Image¶
Return the environment irradiance map.
- getEnvRadianceMap(self: MaterialX.PyMaterialXRender.LightHandler) MaterialX_v1_39_5::Image¶
Return the environment radiance map.
- getEnvSampleCount(self: MaterialX.PyMaterialXRender.LightHandler) int¶
Return the environment lighting sample count.
- getFirstLightOfCategory(self: MaterialX.PyMaterialXRender.LightHandler, arg0: str) MaterialX.PyMaterialXCore.Node¶
Return the first light source, if any, of the given category.
- getIndirectLighting(self: MaterialX.PyMaterialXRender.LightHandler) bool¶
Return whether indirect lighting is enabled.
- getLightIdMap(self: MaterialX.PyMaterialXRender.LightHandler) dict[str, int]¶
Get a list of identifiers associated with a given light nodedef.
- getLightSources(self: MaterialX.PyMaterialXRender.LightHandler) list[MaterialX.PyMaterialXCore.Node]¶
Return the vector of light sources.
- getLightTransform(self: MaterialX.PyMaterialXRender.LightHandler) MaterialX.PyMaterialXCore.Matrix44¶
Return the light transform.
- getRefractionTwoSided(self: MaterialX.PyMaterialXRender.LightHandler) int¶
Return the two-sided refraction property.
- registerLights(self: MaterialX.PyMaterialXRender.LightHandler, arg0: MaterialX.PyMaterialXCore.Document, arg1: collections.abc.Sequence[MaterialX.PyMaterialXCore.Node], arg2: MaterialX.PyMaterialXGenShader.GenContext) None¶
Register light node definitions and light count with a given generation context.
- Parameters:
doc – Document containing light nodes and definitions
lights – Lights to register
context – Context to update
- setAlbedoTable(self: MaterialX.PyMaterialXRender.LightHandler, arg0: MaterialX_v1_39_5::Image) None¶
Set the directional albedo table.
- setDirectLighting(self: MaterialX.PyMaterialXRender.LightHandler, arg0: bool) None¶
Set whether direct lighting is enabled.
- setEnvIrradianceMap(self: MaterialX.PyMaterialXRender.LightHandler, arg0: MaterialX_v1_39_5::Image) None¶
Set the environment irradiance map.
- setEnvRadianceMap(self: MaterialX.PyMaterialXRender.LightHandler, arg0: MaterialX_v1_39_5::Image) None¶
Set the environment radiance map.
- setEnvSampleCount(self: MaterialX.PyMaterialXRender.LightHandler, arg0: SupportsInt) None¶
Set the environment lighting sample count.
- setIndirectLighting(self: MaterialX.PyMaterialXRender.LightHandler, arg0: bool) None¶
Set whether indirect lighting is enabled.
- setLightSources(self: MaterialX.PyMaterialXRender.LightHandler, arg0: collections.abc.Sequence[MaterialX.PyMaterialXCore.Node]) None¶
Set the vector of light sources.
- setLightTransform(self: MaterialX.PyMaterialXRender.LightHandler, arg0: MaterialX.PyMaterialXCore.Matrix44) None¶
Set the light transform.
- setRefractionTwoSided(self: MaterialX.PyMaterialXRender.LightHandler, arg0: bool) None¶
Set the two-sided refraction property.
- class MaterialX.PyMaterialXRender.Mesh(self: MaterialX.PyMaterialXRender.Mesh, arg0: str)¶
Bases:
pybind11_objectContainer for mesh data.
- static create(arg0: str) MaterialX.PyMaterialXRender.Mesh¶
Create a new mesh.
- addPartition(self: MaterialX.PyMaterialXRender.Mesh, arg0: MaterialX.PyMaterialXRender.MeshPartition) None¶
Add a partition.
- addStream(self: MaterialX.PyMaterialXRender.Mesh, arg0: MaterialX.PyMaterialXRender.MeshStream) None¶
Add a mesh stream.
- generateBitangents(self: MaterialX.PyMaterialXRender.Mesh, arg0: MaterialX.PyMaterialXRender.MeshStream, arg1: MaterialX.PyMaterialXRender.MeshStream) MaterialX.PyMaterialXRender.MeshStream¶
Generate bitangents from the given normals and tangents.
- Parameters:
normalStream – Input normal stream
tangentStream – Input tangent stream
- Returns:
The generated bitangent stream, on success; otherwise, a null pointer.
- generateNormals(self: MaterialX.PyMaterialXRender.Mesh, arg0: MaterialX.PyMaterialXRender.MeshStream) MaterialX.PyMaterialXRender.MeshStream¶
Generate face normals from the given positions.
- Parameters:
positionStream – Input position stream
- Returns:
The generated normal stream
- generateTangents(self: MaterialX.PyMaterialXRender.Mesh, arg0: MaterialX.PyMaterialXRender.MeshStream, arg1: MaterialX.PyMaterialXRender.MeshStream, arg2: MaterialX.PyMaterialXRender.MeshStream) MaterialX.PyMaterialXRender.MeshStream¶
Generate tangents from the given positions, normals, and texture coordinates.
- Parameters:
positionStream – Input position stream
normalStream – Input normal stream
texcoordStream – Input texcoord stream
- Returns:
The generated tangent stream, on success; otherwise, a null pointer.
- generateTextureCoordinates(self: MaterialX.PyMaterialXRender.Mesh, arg0: MaterialX.PyMaterialXRender.MeshStream) MaterialX.PyMaterialXRender.MeshStream¶
Create texture coordinates from the given positions.
- Parameters:
positionStream – Input position stream
- Returns:
The generated texture coordinate stream
- getMaximumBounds(self: MaterialX.PyMaterialXRender.Mesh) MaterialX.PyMaterialXCore.Vector3¶
Return the minimum bounds for the geometry.
- getMinimumBounds(self: MaterialX.PyMaterialXRender.Mesh) MaterialX.PyMaterialXCore.Vector3¶
Return the minimum bounds for the geometry.
- getName(self: MaterialX.PyMaterialXRender.Mesh) str¶
Return the name of this mesh.
- getPartition(self: MaterialX.PyMaterialXRender.Mesh, arg0: SupportsInt) MaterialX.PyMaterialXRender.MeshPartition¶
Return a reference to a mesh partition.
- getPartitionCount(self: MaterialX.PyMaterialXRender.Mesh) int¶
Return the number of mesh partitions.
- getSourceUri(self: MaterialX.PyMaterialXRender.Mesh) str¶
Return the mesh’s source URI.
- getSphereCenter(self: MaterialX.PyMaterialXRender.Mesh) MaterialX.PyMaterialXCore.Vector3¶
Return center of the bounding sphere.
- getSphereRadius(self: MaterialX.PyMaterialXRender.Mesh) float¶
Return radius of the bounding sphere.
- getStream(*args, **kwargs)¶
Overloaded function.
getStream(self: MaterialX.PyMaterialXRender.Mesh, arg0: str) -> MaterialX.PyMaterialXRender.MeshStream
getStream(self: MaterialX.PyMaterialXRender.Mesh, arg0: str, arg1: typing.SupportsInt) -> MaterialX.PyMaterialXRender.MeshStream
- getVertexCount(self: MaterialX.PyMaterialXRender.Mesh) int¶
Get vertex count.
- hasSourceUri(self: MaterialX.PyMaterialXRender.Mesh) bool¶
Return true if this mesh has a source URI.
- mergePartitions(self: MaterialX.PyMaterialXRender.Mesh) None¶
Merge all mesh partitions into one.
- setMaximumBounds(self: MaterialX.PyMaterialXRender.Mesh, arg0: MaterialX.PyMaterialXCore.Vector3) None¶
Set the minimum bounds for the geometry.
- setMinimumBounds(self: MaterialX.PyMaterialXRender.Mesh, arg0: MaterialX.PyMaterialXCore.Vector3) None¶
Set the minimum bounds for the geometry.
- setSourceUri(self: MaterialX.PyMaterialXRender.Mesh, arg0: str) None¶
Set the mesh’s source URI.
- setSphereCenter(self: MaterialX.PyMaterialXRender.Mesh, arg0: MaterialX.PyMaterialXCore.Vector3) None¶
Set center of the bounding sphere.
- setSphereRadius(self: MaterialX.PyMaterialXRender.Mesh, arg0: SupportsFloat) None¶
Set radius of the bounding sphere.
- setVertexCount(self: MaterialX.PyMaterialXRender.Mesh, arg0: SupportsInt) None¶
Set vertex count.
- splitByUdims(self: MaterialX.PyMaterialXRender.Mesh) None¶
Split the mesh into a single partition per UDIM.
- class MaterialX.PyMaterialXRender.MeshPartition(self: MaterialX.PyMaterialXRender.MeshPartition)¶
Bases:
pybind11_objectClass that describes a sub-region of a mesh using vertex indexing.
Note that a face is considered to be a triangle.
- static create() MaterialX.PyMaterialXRender.MeshPartition¶
Create a new mesh partition.
- addSourceName(self: MaterialX.PyMaterialXRender.MeshPartition, arg0: str) None¶
Add a source name, representing a partition that was processed to generate this one.
- getFaceCount(self: MaterialX.PyMaterialXRender.MeshPartition) int¶
Return number of faces.
- getIndices(self: MaterialX.PyMaterialXRender.MeshPartition) list[int]¶
- getName(self: MaterialX.PyMaterialXRender.MeshPartition) str¶
Return the name of this partition.
- getSourceNames(self: MaterialX.PyMaterialXRender.MeshPartition) set[str]¶
Return the vector of source names, representing all partitions that were processed to generate this one.
- resize(self: MaterialX.PyMaterialXRender.MeshPartition, arg0: SupportsInt) None¶
Resize data to the given number of indices.
- setFaceCount(self: MaterialX.PyMaterialXRender.MeshPartition, arg0: SupportsInt) None¶
Set face count.
- setName(self: MaterialX.PyMaterialXRender.MeshPartition, arg0: str) None¶
Set the name of this partition.
- class MaterialX.PyMaterialXRender.MeshStream(self: MaterialX.PyMaterialXRender.MeshStream, arg0: str, arg1: str, arg2: SupportsInt)¶
Bases:
pybind11_objectClass to represent a mesh data stream.
- static create(arg0: str, arg1: str, arg2: SupportsInt) MaterialX.PyMaterialXRender.MeshStream¶
Create a new mesh stream.
- getData(self: MaterialX.PyMaterialXRender.MeshStream) list[float]¶
- getIndex(self: MaterialX.PyMaterialXRender.MeshStream) int¶
Get stream index.
- getName(self: MaterialX.PyMaterialXRender.MeshStream) str¶
Get stream name.
- getSize(self: MaterialX.PyMaterialXRender.MeshStream) int¶
Get the number of elements.
- getStride(self: MaterialX.PyMaterialXRender.MeshStream) int¶
Get stride between elements.
- getType(self: MaterialX.PyMaterialXRender.MeshStream) str¶
Get stream attribute name.
- reserve(self: MaterialX.PyMaterialXRender.MeshStream, arg0: SupportsInt) None¶
Reserve memory for a given number of elements.
- resize(self: MaterialX.PyMaterialXRender.MeshStream, arg0: SupportsInt) None¶
Resize data to an given number of elements.
- setStride(self: MaterialX.PyMaterialXRender.MeshStream, arg0: SupportsInt) None¶
Set stride between elements.
- transform(self: MaterialX.PyMaterialXRender.MeshStream, arg0: MaterialX.PyMaterialXCore.Matrix44) None¶
Transform elements by a matrix.
- BITANGENT_ATTRIBUTE = 'bitangent'¶
- COLOR_ATTRIBUTE = 'color'¶
- GEOMETRY_PROPERTY_ATTRIBUTE = 'geomprop'¶
- NORMAL_ATTRIBUTE = 'normal'¶
- POSITION_ATTRIBUTE = 'position'¶
- TANGENT_ATTRIBUTE = 'tangent'¶
- TEXCOORD_ATTRIBUTE = 'texcoord'¶
- class MaterialX.PyMaterialXRender.ShaderRenderer¶
Bases:
pybind11_objectBase class for renderers that generate shader code to produce images.
- createProgram(*args, **kwargs)¶
Overloaded function.
createProgram(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXGenShader.Shader) -> None
createProgram(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: collections.abc.Mapping[str, str]) -> None
- getCamera(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.Camera¶
Return the camera.
- getGeometryHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.GeometryHandler¶
Return the geometry handler.
- getImageHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.ImageHandler¶
Return the image handler.
- getLightHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.LightHandler¶
Return the light handler.
- initialize(self: MaterialX.PyMaterialXRender.ShaderRenderer, renderContextHandle: typing_extensions.CapsuleType = None) None¶
Initialize the renderer.
- render(self: MaterialX.PyMaterialXRender.ShaderRenderer) None¶
Render the current program to produce an image.
- setCamera(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.Camera) None¶
Set the camera.
- setGeometryHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.GeometryHandler) None¶
Set the geometry handler.
- setImageHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.ImageHandler) None¶
Set the image handler used by this renderer for image I/O.
- setLightHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.LightHandler) None¶
Set the light handler used by this renderer for light bindings.
- setSize(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: SupportsInt, arg1: SupportsInt) None¶
Set the size of the rendered image.
- updateUniform(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: str, arg1: MaterialX.PyMaterialXCore.Value) None¶
Update the program with value of the uniform.
- validateInputs(self: MaterialX.PyMaterialXRender.ShaderRenderer) None¶
Validate inputs for the program.
- class MaterialX.PyMaterialXRender.StbImageLoader¶
Bases:
ImageLoaderStb image file loader.
- static create() MaterialX.PyMaterialXRender.StbImageLoader¶
Create a new stb image loader.
- loadImage(self: MaterialX.PyMaterialXRender.StbImageLoader, arg0: MaterialX.PyMaterialXFormat.FilePath) MaterialX.PyMaterialXRender.Image¶
Load an image from the file system.
- saveImage(self: MaterialX.PyMaterialXRender.StbImageLoader, arg0: MaterialX.PyMaterialXFormat.FilePath, arg1: MaterialX.PyMaterialXRender.Image, arg2: bool) bool¶
Save an image to the file system.
- supportedExtensions(self: MaterialX.PyMaterialXRender.ImageLoader) set[str]¶
Returns a list of supported extensions.
- Returns:
List of support extensions
- BMP_EXTENSION = 'bmp'¶
- EXR_EXTENSION = 'exr'¶
- GIF_EXTENSION = 'gif'¶
- HDR_EXTENSION = 'hdr'¶
- JPEG_EXTENSION = 'jpeg'¶
- JPG_EXTENSION = 'jpg'¶
- PIC_EXTENSION = 'pic'¶
- PNG_EXTENSION = 'png'¶
- PSD_EXTENSION = 'psd'¶
- TGA_EXTENSION = 'tga'¶
- TIFF_EXTENSION = 'tiff'¶
- TIF_EXTENSION = 'tif'¶
- TXT_EXTENSION = 'txt'¶
- class MaterialX.PyMaterialXRender.TinyObjLoader(self: MaterialX.PyMaterialXRender.TinyObjLoader)¶
Bases:
GeometryLoaderWrapper for geometry loader to read in OBJ files using the TinyObj library.
- static create() MaterialX.PyMaterialXRender.TinyObjLoader¶
Create a new TinyObjLoader.
- load(self: MaterialX.PyMaterialXRender.TinyObjLoader, arg0: MaterialX.PyMaterialXFormat.FilePath, arg1: collections.abc.Sequence[MaterialX.PyMaterialXRender.Mesh], arg2: bool) bool¶
Load geometry from disk.
- supportedExtensions(self: MaterialX.PyMaterialXRender.GeometryLoader) set[str]¶
Returns a list of supported extensions.
- Returns:
List of support extensions
- MaterialX.PyMaterialXRender.createImageStrip(arg0: collections.abc.Sequence[MaterialX.PyMaterialXRender.Image]) MaterialX.PyMaterialXRender.Image¶
Create a horizontal image strip from a vector of images with identical resolutions and formats.
- MaterialX.PyMaterialXRender.createUniformImage(arg0: SupportsInt, arg1: SupportsInt, arg2: SupportsInt, arg3: MaterialX.PyMaterialXRender.BaseType, arg4: MaterialX.PyMaterialXCore.Color4) MaterialX.PyMaterialXRender.Image¶
Create a uniform-color image with the given properties.
- MaterialX.PyMaterialXRender.getMaxDimensions(arg0: collections.abc.Sequence[MaterialX.PyMaterialXRender.Image]) tuple[int, int]¶
Compute the maximum width and height of all images in the given vector.
Rendering support for the OpenGL Shading Language.
- class MaterialX.PyMaterialXRenderGlsl.GLTextureHandler¶
Bases:
ImageHandlerAn OpenGL texture handler class.
- static create(arg0: MaterialX.PyMaterialXRender.ImageLoader) MaterialX.PyMaterialXRender.ImageHandler¶
- acquireImage(self: MaterialX.PyMaterialXRender.ImageHandler, filePath: MaterialX.PyMaterialXFormat.FilePath, defaultColor: MaterialX.PyMaterialXCore.Color4 = <MaterialX.PyMaterialXCore.Color4 object at 0x00000251BA562170>) MaterialX.PyMaterialXRender.Image¶
Acquire an image from the cache or file system.
- Parameters:
filePath – File path of the image.
defaultColor – Default color to use as a fallback for missing images.
- Returns:
On success, a shared pointer to the acquired image.
- addLoader(self: MaterialX.PyMaterialXRender.ImageHandler, arg0: MaterialX.PyMaterialXRender.ImageLoader) None¶
Add another image loader to the handler, which will be invoked if existing loaders cannot load a given image.
- bindImage(self: MaterialX.PyMaterialXRenderGlsl.GLTextureHandler, arg0: MaterialX.PyMaterialXRender.Image, arg1: MaterialX.PyMaterialXRender.ImageSamplingProperties) bool¶
Bind an image.
This method will bind the texture to an active texture unit as defined by the corresponding image description. The method will fail if there are not enough available image units to bind to.
- clearImageCache(self: MaterialX.PyMaterialXRender.ImageHandler) None¶
Clear the contents of the image cache, first releasing any render resources associated with cached images.
- createRenderResources(self: MaterialX.PyMaterialXRenderGlsl.GLTextureHandler, arg0: MaterialX.PyMaterialXRender.Image, arg1: bool, arg2: bool) bool¶
Create rendering resources for the given image.
- getFilenameResolver(self: MaterialX.PyMaterialXRender.ImageHandler) MaterialX.PyMaterialXCore.StringResolver¶
Return the filename resolver for images.
- getReferencedImages(self: MaterialX.PyMaterialXRender.ImageHandler, arg0: MaterialX.PyMaterialXCore.Document) list[MaterialX.PyMaterialXRender.Image]¶
Acquire all images referenced by the given document, and return the images in a vector.
- getSearchPath(self: MaterialX.PyMaterialXRender.ImageHandler) MaterialX.PyMaterialXFormat.FileSearchPath¶
Return the image search path.
- getZeroImage(self: MaterialX.PyMaterialXRender.ImageHandler) MaterialX.PyMaterialXRender.Image¶
Return a fallback image with zeroes in all channels.
- releaseRenderResources(self: MaterialX.PyMaterialXRenderGlsl.GLTextureHandler, image: MaterialX.PyMaterialXRender.Image = None) None¶
Release rendering resources for the given image, or for all cached images if no image pointer is specified.
- saveImage(self: MaterialX.PyMaterialXRender.ImageHandler, filePath: MaterialX.PyMaterialXFormat.FilePath, image: MaterialX.PyMaterialXRender.Image, verticalFlip: bool = False) bool¶
Save image to disk.
- Parameters:
filePath – File path to be written
image – The image to be saved
verticalFlip – Whether the image should be flipped in Y during save
- Returns:
if save succeeded
- setFilenameResolver(self: MaterialX.PyMaterialXRender.ImageHandler, arg0: MaterialX.PyMaterialXCore.StringResolver) None¶
Set the filename resolver for images.
- setSearchPath(self: MaterialX.PyMaterialXRender.ImageHandler, arg0: MaterialX.PyMaterialXFormat.FileSearchPath) None¶
Set the search path to be used for finding images on the file system.
- unbindImage(self: MaterialX.PyMaterialXRenderGlsl.GLTextureHandler, arg0: MaterialX.PyMaterialXRender.Image) bool¶
Unbind an image.
- unbindImages(self: MaterialX.PyMaterialXRender.ImageHandler) None¶
Unbind all images that are currently stored in the cache.
- class MaterialX.PyMaterialXRenderGlsl.GlslProgram¶
Bases:
pybind11_objectA class representing an executable GLSL program.
There are two main interfaces which can be used. One which takes in a HwShader and one which allows for explicit setting of shader stage code.
- static create() MaterialX.PyMaterialXRenderGlsl.GlslProgram¶
Create a GLSL program instance.
- addStage(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, arg0: str, arg1: str) None¶
Set the code stages based on a list of stage strings.
- Parameters:
stage – Name of the shader stage.
sourceCode – Source code of the shader stage.
- bind(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram) bool¶
Bind the program.
- Returns:
False if failed
- bindAttribute(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, arg0: collections.abc.Mapping[str, MaterialX_v1_39_5::GlslProgram::Input], arg1: MaterialX.PyMaterialXRender.Mesh) None¶
Bind attribute buffers to attribute inputs.
- Parameters:
inputs – Attribute inputs to bind to
mesh – Mesh containing streams to bind
- bindLighting(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, arg0: MaterialX.PyMaterialXRender.LightHandler, arg1: MaterialX.PyMaterialXRender.ImageHandler) None¶
Bind lighting.
- bindMesh(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, arg0: MaterialX.PyMaterialXRender.Mesh) None¶
Bind input geometry streams.
- bindPartition(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, arg0: MaterialX.PyMaterialXRender.MeshPartition) None¶
Bind input geometry partition (indexing).
- bindTextures(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, arg0: MaterialX.PyMaterialXRender.ImageHandler) None¶
Bind any input textures.
- bindTimeAndFrame(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, time: SupportsFloat = 0.0, frame: SupportsFloat = 1.0) None¶
Bind time and frame.
- bindUniform(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, arg0: str, arg1: MaterialX.PyMaterialXCore.Value, arg2: bool) None¶
Bind a value to the uniform with the given name.
- bindViewInformation(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, arg0: MaterialX.PyMaterialXRender.Camera) None¶
Bind view information.
- build(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram) None¶
Build shader program data from the source code set for each shader stage.
An exception is thrown if the program cannot be built. The exception will contain a list of compilation errors.
- clearBuiltData(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram) None¶
- findInputs(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, arg0: str, arg1: collections.abc.Mapping[str, MaterialX_v1_39_5::GlslProgram::Input], arg2: collections.abc.Mapping[str, MaterialX_v1_39_5::GlslProgram::Input], arg3: bool) None¶
Find the locations in the program which starts with a given variable name.
- Parameters:
variable – Variable to search for
variableList – List of program inputs to search
foundList – Returned list of found program inputs. Empty if none found.
exactMatch – Search for exact variable name match.
- getAttributesList(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram) dict[str, MaterialX_v1_39_5::GlslProgram::Input]¶
Get list of program input attributes.
- Returns:
Program attributes list.
- getShader(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram) MaterialX.PyMaterialXGenShader.Shader¶
Return the shader, if any, used to generate this program.
- getStageSourceCode(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, arg0: str) str¶
Get source code string for a given stage.
- Returns:
Shader stage string. String is empty if not found.
- getUniformsList(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram) dict[str, MaterialX_v1_39_5::GlslProgram::Input]¶
Get list of program input uniforms.
- Returns:
Program uniforms list.
- hasActiveAttributes(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram) bool¶
Return true if the program has active attributes.
- hasBuiltData(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram) bool¶
Return true if built shader program data is present.
- setStages(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram, arg0: MaterialX.PyMaterialXGenShader.Shader) None¶
Set up code stages to validate based on an input hardware shader.
- Parameters:
shader – Hardware shader to use
- unbind(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram) None¶
Unbind the program. Equivalent to binding no program.
- unbindGeometry(self: MaterialX.PyMaterialXRenderGlsl.GlslProgram) None¶
Unbind any bound geometry.
- UNDEFINED_OPENGL_PROGRAM_LOCATION = -1¶
- UNDEFINED_OPENGL_RESOURCE_ID = 0¶
- class MaterialX.PyMaterialXRenderGlsl.GlslRenderer¶
Bases:
ShaderRendererHelper class for rendering generated GLSL code to produce images.
There are two main interfaces which can be used. One which takes in a HwShader and one which allows for explicit setting of shader stage code.
The main services provided are: Validation: All shader stages are compiled and atteched to a GLSL shader program. Introspection: The compiled shader program is examined for uniforms and attributes. Binding: Uniforms and attributes which match the predefined variables generated the GLSL code generator will have values assigned to this. This includes matrices, attribute streams, and textures. Rendering: The program with bound inputs will be used to drawing geometry to an offscreen buffer. An interface is provided to save this offscreen buffer to disk using an externally defined image handler.
- static create(arg0: SupportsInt, arg1: SupportsInt, arg2: MaterialX.PyMaterialXRender.BaseType) MaterialX.PyMaterialXRenderGlsl.GlslRenderer¶
Create a GLSL renderer instance.
- captureImage(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer, arg0: MaterialX.PyMaterialXRender.Image) MaterialX.PyMaterialXRender.Image¶
Capture the current contents of the off-screen hardware buffer as an image.
- createProgram(*args, **kwargs)¶
Overloaded function.
createProgram(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer, arg0: MaterialX.PyMaterialXGenShader.Shader) -> None
createProgram(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer, arg0: collections.abc.Mapping[str, str]) -> None
- getCamera(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.Camera¶
Return the camera.
- getGeometryHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.GeometryHandler¶
Return the geometry handler.
- getImageHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.ImageHandler¶
Return the image handler.
- getLightHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.LightHandler¶
Return the light handler.
- getProgram(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer) MaterialX.PyMaterialXRenderGlsl.GlslProgram¶
Return the GLSL program.
- initialize(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer, renderContextHandle: typing_extensions.CapsuleType = None) None¶
Internal initialization of stages and OpenGL constructs required for program validation and rendering.
- Parameters:
renderContextHandle – allows initializing the GlslRenderer with a Shared OpenGL Context
- render(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer) None¶
Render the current program to an offscreen buffer.
- renderTextureSpace(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer, arg0: MaterialX.PyMaterialXCore.Vector2, arg1: MaterialX.PyMaterialXCore.Vector2) None¶
Render the current program in texture space to an off-screen buffer.
- setCamera(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.Camera) None¶
Set the camera.
- setGeometryHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.GeometryHandler) None¶
Set the geometry handler.
- setImageHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.ImageHandler) None¶
Set the image handler used by this renderer for image I/O.
- setLightHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.LightHandler) None¶
Set the light handler used by this renderer for light bindings.
- setSize(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: SupportsInt, arg1: SupportsInt) None¶
Set the size of the rendered image.
- updateUniform(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: str, arg1: MaterialX.PyMaterialXCore.Value) None¶
Update the program with value of the uniform.
- validateInputs(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer) None¶
Validate inputs for the program.
- class MaterialX.PyMaterialXRenderGlsl.Input(self: MaterialX.PyMaterialXRenderGlsl.Input, arg0: SupportsInt, arg1: SupportsInt, arg2: SupportsInt, arg3: str)¶
Bases:
pybind11_objectAn 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.
- INVALID_OPENGL_TYPE = -1¶
- property gltype¶
- property isConstant¶
- property location¶
- property path¶
- property size¶
- property typeString¶
- property value¶
- class MaterialX.PyMaterialXRenderGlsl.TextureBaker¶
Bases:
GlslRendererA helper class for baking procedural material content to textures.
TODO: Add support for graphs containing geometric nodes such as position and normal.
- static create(arg0: SupportsInt, arg1: SupportsInt, arg2: MaterialX.PyMaterialXRender.BaseType) MaterialX.PyMaterialXRenderGlsl.TextureBaker¶
- bakeAllMaterials(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX.PyMaterialXFormat.FileSearchPath, arg2: MaterialX.PyMaterialXFormat.FilePath) None¶
- bakeMaterialToDoc(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: MaterialX.PyMaterialXCore.Document, arg1: MaterialX.PyMaterialXFormat.FileSearchPath, arg2: str, arg3: collections.abc.Sequence[str], arg4: str) MaterialX.PyMaterialXCore.Document¶
- captureImage(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer, arg0: MaterialX.PyMaterialXRender.Image) MaterialX.PyMaterialXRender.Image¶
Capture the current contents of the off-screen hardware buffer as an image.
- createProgram(*args, **kwargs)¶
Overloaded function.
createProgram(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer, arg0: MaterialX.PyMaterialXGenShader.Shader) -> None
createProgram(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer, arg0: collections.abc.Mapping[str, str]) -> None
- getAverageImages(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) bool¶
- getBakedGeomInfoName(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) str¶
- getBakedGraphName(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) str¶
- getCamera(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.Camera¶
Return the camera.
- getColorSpace(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) str¶
- getDistanceUnit(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) str¶
- getExtension(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) str¶
- getGeometryHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.GeometryHandler¶
Return the geometry handler.
- getHashImageNames(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) bool¶
- getImageHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.ImageHandler¶
Return the image handler.
- getLightHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.LightHandler¶
Return the light handler.
- getOptimizeConstants(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) bool¶
- getOutputImagePath(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) MaterialX.PyMaterialXFormat.FilePath¶
- getProgram(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer) MaterialX.PyMaterialXRenderGlsl.GlslProgram¶
Return the GLSL program.
- getTextureFilenameTemplate(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) str¶
- getTextureSpaceMax(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) MaterialX.PyMaterialXCore.Vector2¶
- getTextureSpaceMin(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker) MaterialX.PyMaterialXCore.Vector2¶
- initialize(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer, renderContextHandle: typing_extensions.CapsuleType = None) None¶
Internal initialization of stages and OpenGL constructs required for program validation and rendering.
- Parameters:
renderContextHandle – allows initializing the GlslRenderer with a Shared OpenGL Context
- render(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer) None¶
Render the current program to an offscreen buffer.
- renderTextureSpace(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer, arg0: MaterialX.PyMaterialXCore.Vector2, arg1: MaterialX.PyMaterialXCore.Vector2) None¶
Render the current program in texture space to an off-screen buffer.
- setAverageImages(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: bool) None¶
- setBakedGeomInfoName(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: str) None¶
- setBakedGraphName(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: str) None¶
- setCamera(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.Camera) None¶
Set the camera.
- setColorSpace(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: str) None¶
- setDistanceUnit(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: str) None¶
- setExtension(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: str) None¶
- setFilenameTemplateVarOverride(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: str, arg1: str) None¶
- setGeometryHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.GeometryHandler) None¶
Set the geometry handler.
- setHashImageNames(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: bool) None¶
- setImageHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.ImageHandler) None¶
Set the image handler used by this renderer for image I/O.
- setLightHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.LightHandler) None¶
Set the light handler used by this renderer for light bindings.
- setOptimizeConstants(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: bool) None¶
- setOutputImagePath(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: MaterialX.PyMaterialXFormat.FilePath) None¶
- setSize(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: SupportsInt, arg1: SupportsInt) None¶
Set the size of the rendered image.
- setTextureFilenameTemplate(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: str) None¶
- setTextureSpaceMax(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: MaterialX.PyMaterialXCore.Vector2) None¶
- setTextureSpaceMin(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: MaterialX.PyMaterialXCore.Vector2) None¶
- setupUnitSystem(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: MaterialX.PyMaterialXCore.Document) None¶
- updateUniform(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: str, arg1: MaterialX.PyMaterialXCore.Value) None¶
Update the program with value of the uniform.
- validateInputs(self: MaterialX.PyMaterialXRenderGlsl.GlslRenderer) None¶
Validate inputs for the program.
- writeDocumentPerMaterial(self: MaterialX.PyMaterialXRenderGlsl.TextureBaker, arg0: bool) None¶
Rendering support for Open Shading Language.
- class MaterialX.PyMaterialXRenderOsl.OslRenderer¶
Bases:
ShaderRendererHelper class for rendering generated OSL code to produce images.
The main services provided are: Source code validation: Use of “oslc” to compile and test output results Introspection check: None at this time. Binding: None at this time. Render validation: Use of “testrender” to output rendered images. Assumes source compilation was success as it depends on the existence of corresponding .oso files.
- static create(arg0: SupportsInt, arg1: SupportsInt, arg2: MaterialX.PyMaterialXRender.BaseType) MaterialX.PyMaterialXRenderOsl.OslRenderer¶
Create an OSL renderer instance.
- captureImage(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: MaterialX.PyMaterialXRender.Image) MaterialX.PyMaterialXRender.Image¶
Capture the current rendered output as an image.
- compileOSL(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: MaterialX.PyMaterialXFormat.FilePath) None¶
Compile OSL code stored in a file.
- Parameters:
oslFilePath – OSL file path.
- createProgram(*args, **kwargs)¶
Overloaded function.
createProgram(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: MaterialX.PyMaterialXGenShader.Shader) -> None
createProgram(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: collections.abc.Mapping[str, str]) -> None
- getCamera(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.Camera¶
Return the camera.
- getGeometryHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.GeometryHandler¶
Return the geometry handler.
- getImageHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.ImageHandler¶
Return the image handler.
- getLightHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer) MaterialX.PyMaterialXRender.LightHandler¶
Return the light handler.
- initialize(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, renderContextHandle: typing_extensions.CapsuleType = None) None¶
Internal initialization required for program validation and rendering.
An exception is thrown on failure. The exception will contain a list of initialization errors.
- render(self: MaterialX.PyMaterialXRenderOsl.OslRenderer) None¶
Render OSL program to disk.
This is done by using either “testshade” or “testrender”. Currently only “testshade” is supported.
Usage of both executables requires compiled source (.oso) files as input. A shader output must be set before running this test via the setOslOutputName() method to ensure that the appropriate .oso files can be located.
- setCamera(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.Camera) None¶
Set the camera.
- setGeometryHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.GeometryHandler) None¶
Set the geometry handler.
- setImageHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.ImageHandler) None¶
Set the image handler used by this renderer for image I/O.
- setLightHandler(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: MaterialX.PyMaterialXRender.LightHandler) None¶
Set the light handler used by this renderer for light bindings.
- setOslCompilerExecutable(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: MaterialX.PyMaterialXFormat.FilePath) None¶
Set the path to the OSL executable.
- Parameters:
executableFilePath – Path to OSL compiler executable
- setOslIncludePath(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: MaterialX.PyMaterialXFormat.FileSearchPath) None¶
Set the search locations for OSL include files.
- Parameters:
dirPath – Include path(s) for the OSL compiler. This should include the path to stdosl.h.
- setOslOutputFilePath(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: MaterialX.PyMaterialXFormat.FilePath) None¶
Set the location where compiled OSL files will reside.
- Parameters:
dirPath – Path to output location
- setOslShaderName(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: str) None¶
Set the name of the shader to be used for the input XML scene file.
- Parameters:
shaderName – Name of shader
- setOslShaderOutput(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: str, arg1: str) None¶
Set the OSL shader output.
- Parameters:
outputName – Name of shader output
outputType – The MaterialX type of the output
- setOslTestRenderExecutable(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: MaterialX.PyMaterialXFormat.FilePath) None¶
Set the path to the OSL rendering tester.
- Parameters:
executableFilePath – Path to OSL “testrender” executable
- setOslTestRenderSceneTemplateFile(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: MaterialX.PyMaterialXFormat.FilePath) None¶
Set the XML scene file to use for testrender.
This is a template file with the following tokens for replacement: shader% : which will be replaced with the name of the shader to use shader_output% : which will be replace with the name of the shader output to use templateFilePath Scene file name
- Parameters:
templateFilePath – Scene file name
- setOslTestShadeExecutable(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: MaterialX.PyMaterialXFormat.FilePath) None¶
Set the path to the OSL shading tester.
- Parameters:
executableFilePath – Path to OSL “testshade” executable
- setOslUtilityOSOPath(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: MaterialX.PyMaterialXFormat.FilePath) None¶
Set the search path for dependent shaders (.oso files) which are used when rendering with testrender.
- Parameters:
dirPath – Path to location containing .oso files.
- setShaderParameterOverrides(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: collections.abc.Sequence[str]) None¶
Set shader parameter strings to be added to the scene XML file.
These strings will set parameter overrides for the shader.
- setSize(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: SupportsInt, arg1: SupportsInt) None¶
Set the size of the rendered image.
- updateUniform(self: MaterialX.PyMaterialXRender.ShaderRenderer, arg0: str, arg1: MaterialX.PyMaterialXCore.Value) None¶
Update the program with value of the uniform.
- useTestRender(self: MaterialX.PyMaterialXRenderOsl.OslRenderer, arg0: bool) None¶
Used to toggle to either use testrender or testshade during render validation By default testshade is used.
- Parameters:
useTestRender – Indicate whether to use testrender.
- validateInputs(self: MaterialX.PyMaterialXRenderOsl.OslRenderer) None¶
Validate inputs for the compiled OSL program.
Note: Currently no validation has been implemented.
- OSL_CLOSURE_COLOR_STRING = 'closure color'¶
Native Python helper functions for MaterialX data types.
- MaterialX.datatype.createValueFromStrings(valueString, typeString)[source]¶
Convert a MaterialX value and type strings to the corresponding Python value. If the given conversion cannot be performed, then None is returned.
Examples
createValueFromStrings(‘0.1’, ‘float’) -> 0.1 createValueFromStrings(‘0.1, 0.2, 0.3’, ‘color3’) -> mx.Color3(0.1, 0.2, 0.3)
- MaterialX.datatype.getTypeString(value)[source]¶
Return the MaterialX type string associated with the given Python value If the type of the given Python value is not recognized by MaterialX, then None is returned.
Examples
getTypeString(1.0) -> ‘float’ getTypeString(mx.Color3(1)) -> ‘color3’
- MaterialX.datatype.getValueString(value)[source]¶
Return the MaterialX value string associated with the given Python value If the type of the given Python value is not recognized by MaterialX, then None is returned
Examples
getValueString(0.1) -> ‘0.1’ getValueString(mx.Color3(0.1, 0.2, 0.3)) -> ‘0.1, 0.2, 0.3’
- MaterialX.datatype.isColorValue(value)[source]¶
Return True if the given value is a MaterialX color.
- MaterialX.datatype.stringToBoolean(value)[source]¶
Return boolean value found in a string. Throws and exception if a boolean value could not be parsed
Native Python wrappers for PyMaterialX, providing a more Pythonic interface for Elements and Values.
- MaterialX.main.stringToValue(string, t)¶
(Deprecated) Convert a MaterialX value string and Python type to the corresponding Python value.
- MaterialX.main.typeToName(t)¶
(Deprecated) Return the MaterialX type string associated with the given Python type.
- MaterialX.main.valueToString(value)¶
(Deprecated) Convert a Python value to its corresponding MaterialX value string.