PyMaterialXGenShader.TypeDesc

class TypeDesc

Bases: pybind11_object

A 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 registered by default and can be accessed from the Type namespace, e.g. Type::FLOAT.

To register custom types use the macro TYPEDESC_DEFINE_TYPE to define it in a header and the macro TYPEDESC_REGISTER_TYPE to register it in the type registry. Registration must be done in order to access the type’s name later using getName() and to find the type by name using TypeDesc.get().

The class is a POD type of 64-bits and can efficiently be stored and passed by value. Type compare operations and hash operations are done using a precomputed hash value.

See:

https://materialx.org/docs/api/class_type_desc.html

Methods

__init__(*args, **kwargs)

get(arg0)

getBaseType(self)

getName(self)

getSemantic(self)

getSize(self)

isAggregate(self)

isArray(self)

isClosure(self)

isFloat2(self)

isFloat3(self)

isFloat4(self)

isScalar(self)

Methods

__init__(*args, **kwargs)
static get(arg0: str) TypeDesc
getBaseType(self: TypeDesc) int
getName(self: TypeDesc) str
getSemantic(self: TypeDesc) int
getSize(self: TypeDesc) int
isAggregate(self: TypeDesc) bool
isArray(self: TypeDesc) bool
isClosure(self: TypeDesc) bool
isFloat2(self: TypeDesc) bool
isFloat3(self: TypeDesc) bool
isFloat4(self: TypeDesc) bool
isScalar(self: TypeDesc) bool