usdrt::UsdShadeShader

Defined in usdrt/scenegraph/usd/usdShade/shader.h

Functions

Variables

class UsdShadeShader : public usdrt::UsdTyped

Base class for all USD shaders. Shaders are the building blocks of shading networks. While UsdShadeShader objects are not target specific, each renderer or application target may derive its own renderer-specific shader object types from this base, if needed.

Objects of this class generally represent a single shading object, whether it exists in the target renderer or not. For example, a texture, a fractal, or a mix node.

The UsdShadeNodeDefAPI provides attributes to uniquely identify the type of this node. The id resolution into a renderable shader target type of this node. The id resolution into a renderable shader target is deferred to the consuming application.

The purpose of representing them in Usd is two-fold:

  • To represent, via “connections” the topology of the shading network that must be reconstructed in the renderer. Facilities for authoring and manipulating connections are encapsulated in the API schema UsdShadeConnectableAPI.

  • To present a (partial or full) interface of typed input parameters whose values can be set and overridden in Usd, to be provided later at render-time as parameter values to the actual render shader objects. Shader input parameters are encapsulated in the property schema UsdShadeInput.

Public Functions

inline explicit UsdShadeShader(const UsdPrim &prim = UsdPrim())

Construct a UsdShadeShader on UsdPrim prim. Equivalent to UsdShadeShader::Get(prim.GetStage(), prim.GetPath()) for a valid prim , but will not immediately throw an error for an invalid prim.

inline explicit UsdShadeShader(const UsdSchemaBase &schemaObj)

Construct a UsdShadeShader on the prim held by schemaObj . Should be preferred over UsdShadeShader(schemaObj.GetPrim()), as it preserves SchemaBase state.

inline virtual ~UsdShadeShader()

Destructor.

inline operator bool() const

Boolean operator.

Returns

Return true if the contained prim is an instance of this schema using IsA, and false otherwise.

UsdPrim GetPrim() const

Return this schema object’s held prim.

SdfPath GetPath() const

Return the SdfPath to this schema object’s held prim.

Public Static Functions

static inline UsdShadeShader Define(const UsdStageRefPtr &stage, const SdfPath &path)

Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefined()) on this stage.

Public Static Attributes

static const UsdSchemaType schemaType = UsdSchemaType::ConcreteTyped

Compile time constant representing what kind of schema this class is.

See also

UsdSchemaType