usdrt::UsdRenderVar
Defined in usdrt/scenegraph/usd/usdRender/var.h
Functions
usdrt::UsdRenderVar::CreateDataTypeAttr: 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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdRenderVar::CreateSourceNameAttr: 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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdRenderVar::CreateSourceTypeAttr: 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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.usdrt::UsdRenderVar::Define: Attempt to ensure a UsdPrim adhering to this schema at
path
is defined (according to UsdPrim::IsDefined()) on this stage.usdrt::UsdRenderVar::GetDataTypeAttr: The type of this channel, as a USD attribute type.
usdrt::DestructionSchemaDestructibleBaseAPI::GetPath: Return the SdfPath to this schema object's held prim.
usdrt::DestructionSchemaDestructibleBaseAPI::GetPrim: Return this schema object's held prim.
usdrt::UsdRenderVar::GetSourceNameAttr: The renderer should look for an output of this name as the computed value for the RenderVar.
usdrt::UsdRenderVar::GetSourceTypeAttr: Indicates the type of the source.
usdrt::UsdRenderVar::UsdRenderVar: Construct a UsdRenderVar on the prim held by
schemaObj
. Should be preferred over UsdRenderVar (schemaObj.GetPrim()), as it preserves SchemaBase state.usdrt::UsdRenderVar::UsdRenderVar: Construct a UsdRenderVar on UsdPrim
prim
. Equivalent to UsdRenderVar::Get(prim.GetStage(), prim.GetPath()) for a validprim
, but will not immediately throw an error for an invalidprim
.usdrt::UsdRenderVar::operator bool: Boolean operator.
usdrt::UsdRenderVar::~UsdRenderVar: Destructor.
Variables
usdrt::UsdRenderVar::schemaType: Compile time constant representing what kind of schema this class is.
-
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 validprim
, but will not immediately throw an error for an invalidprim
.
-
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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
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
-
inline explicit UsdRenderVar(const UsdPrim &prim = UsdPrim())