usdrt::UsdRenderVar

Defined in usdrt/scenegraph/usd/usdRender/var.h

Functions

Variables

class UsdRenderVar : public usdrt::UsdTyped

A UsdRenderVar describes a custom data variable for a render to produce. The prim describes the source of the data, which can be a shader output or an LPE (Light Path Expression), and also allows encoding of (generally renderer-specific) parameters that configure the renderer for computing the variable.

For any described attribute Fallback Value or Allowed Values below that are text/tokens, the actual token is published and defined in UsdRenderTokens. So to set an attribute to the value “rightHanded”, use UsdRenderTokens->rightHanded as the value.

Note

The name of the RenderVar prim drives the name of the data variable that the renderer will produce.

Note

In the future, UsdRender may standardize RenderVar representation for well-known variables under the sourceType intrinsic, such as r, g, b, a, z, or id.

Public Functions

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

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

inline explicit UsdRenderVar(const UsdSchemaBase &schemaObj)

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

inline virtual ~UsdRenderVar()

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.

inline UsdAttribute GetDataTypeAttr() const

The type of this channel, as a USD attribute type.

Declaration

uniform token dataType = "color3f"

C++ Type

TfToken

Usd Type

SdfValueTypeNames->Token

Variability

SdfVariabilityUniform

inline UsdAttribute CreateDataTypeAttr() const

See GetDataTypeAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author defaultValue as the attribute’s default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

inline UsdAttribute GetSourceNameAttr() const

The renderer should look for an output of this name as the computed value for the RenderVar.

Declaration

uniform string sourceName = ""

C++ Type

std::string

Usd Type

SdfValueTypeNames->String

Variability

SdfVariabilityUniform

inline UsdAttribute CreateSourceNameAttr() const

See GetSourceNameAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author defaultValue as the attribute’s default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

inline UsdAttribute GetSourceTypeAttr() const

Indicates the type of the source.

  • “raw”: The name should be passed directly to the renderer. This is the default behavior.

  • ”primvar”: This source represents the name of a primvar. Some renderers may use this to ensure that the primvar is provided; other renderers may require that a suitable material network be provided, in which case this is simply an advisory setting.

  • ”lpe”: Specifies a Light Path Expression in the OSL Light Path Expressions language as the source for this RenderVar. Some renderers may use extensions to that syntax, which will necessarily be non-portable.

  • ”intrinsic”: This setting is currently unimplemented, but represents a future namespace for UsdRender to provide portable baseline RenderVars, such as camera depth, that may have varying implementations for each renderer.

Declaration

uniform token sourceType = "raw"

C++ Type

TfToken

Usd Type

SdfValueTypeNames->Token

Variability

SdfVariabilityUniform

Allowed Values

raw, primvar, lpe, intrinsic

inline UsdAttribute CreateSourceTypeAttr() const

See GetSourceTypeAttr(), and also Create vs Get Property Methods for when to use Get vs Create. If specified, author defaultValue as the attribute’s default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

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 UsdRenderVar 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