UsdRenderPass#
Fully qualified name: usdrt::UsdRenderPass
-
class UsdRenderPass : public usdrt::UsdTyped#
A RenderPass prim encapsulates the necessary information to generate multipass renders. It houses properties for generating dependencies and the necessary commands to run to generate renders, as well as visibility controls for the scene. While RenderSettings describes the information needed to generate images from a single invocation of a renderer, RenderPass describes the additional information needed to generate a time varying set of images.
There are two consumers of RenderPass prims - a runtime executable that generates images from usdRender prims, and pipeline specific code that translates between usdRender prims and the pipeline’s resource scheduling software. We’ll refer to the latter as ‘job submission code’.
The name of the prim is used as the pass’s name.
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.
Public Functions
-
inline explicit UsdRenderPass(const UsdPrim &prim = UsdPrim())#
Construct a UsdRenderPass on UsdPrim
prim
. Equivalent to UsdRenderPass::Get(prim.GetStage(), prim.GetPath()) for a validprim
, but will not immediately throw an error for an invalidprim
.
-
inline explicit UsdRenderPass(const UsdSchemaBase &schemaObj)#
Construct a UsdRenderPass on the prim held by
schemaObj
. Should be preferred over UsdRenderPass(schemaObj.GetPrim()), as it preserves SchemaBase state.
-
inline virtual ~UsdRenderPass()#
Destructor.
-
inline UsdAttribute GetPassTypeAttr() const#
A string used to categorize differently structured or executed types of passes within a customized pipeline.
For example, when multiple DCC’s (e.g. Houdini, Katana, Nuke) each compute and contribute different Products to a final result, it may be clearest and most flexible to create a separate RenderPass for each.
Declaration
uniform token passType
C++ Type
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
-
inline UsdAttribute CreatePassTypeAttr() const#
See GetPassTypeAttr(), 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 GetCommandAttr() const#
The command to run in order to generate renders for this pass. The job submission code can use this to properly send tasks to the job scheduling software that will generate products.
The command can contain variables that will be substituted appropriately during submission, as seen in the example below with {fileName}.
For example: command[0] = “prman” command[1] = “-progress” command[2] = “-pixelvariance” command[3] = “-0.15” command[4] = “{fileName}” # the fileName property will be substituted
Declaration
uniform string[] command
C++ Type
VtArray<std::string>
Usd Type
SdfValueTypeNames->StringArray
Variability
SdfVariabilityUniform
-
inline UsdAttribute CreateCommandAttr() const#
See GetCommandAttr(), 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 GetFileNameAttr() const#
The asset that contains the rendering prims or other information needed to render this pass.
Declaration
uniform asset fileName
C++ Type
Usd Type
SdfValueTypeNames->Asset
Variability
SdfVariabilityUniform
-
inline UsdAttribute CreateFileNameAttr() const#
See GetFileNameAttr(), 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 GetDenoiseEnableAttr() const#
When True, this Pass pass should be denoised.
Declaration
uniform bool denoise:enable = 0
C++ Type
bool
Usd Type
SdfValueTypeNames->Bool
Variability
SdfVariabilityUniform
-
inline UsdAttribute CreateDenoiseEnableAttr() const#
See GetDenoiseEnableAttr(), 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 UsdRelationship GetRenderSourceRel() const#
The source prim to render from. If fileName is not present, the source is assumed to be a RenderSettings prim present in the current Usd stage. If fileName is present, the source should be found in the file there. This relationship might target a string attribute on this or another prim that identifies the appropriate object in the external container.
For example, for a Usd-backed pass, this would point to a RenderSettings prim. Houdini passes would point to a Rop. Nuke passes would point to a write node.
-
inline UsdRelationship CreateRenderSourceRel() const#
See GetRenderSourceRel(), and also Create vs Get Property Methods for when to use Get vs Create.
-
inline UsdRelationship GetInputPassesRel() const#
The set of other Passes that this Pass depends on in order to be constructed properly. For example, a Pass A may generate a texture, which is then used as an input to Pass B.
By default, usdRender makes some assumptions about the relationship between this prim and the prims listed in inputPasses. Namely, when per-frame tasks are generated from these pass prims, usdRender will assume a one-to-one relationship between tasks that share their frame number. Consider a pass named ‘composite’ whose inputPasses targets a Pass prim named ‘beauty. By default, each frame for ‘composite will depend on the same frame from ‘beauty’: beauty.1 -> composite.1 beauty.2 -> composite.2 etc
The consumer of this RenderPass graph of inputs will need to resolve the transitive dependencies.
-
inline UsdRelationship CreateInputPassesRel() const#
See GetInputPassesRel(), and also Create vs Get Property Methods for when to use Get vs Create.
-
inline UsdRelationship GetDenoisePassRel() const#
The The UsdRenderDenoisePass prim from which to source denoise settings.
-
inline UsdRelationship CreateDenoisePassRel() const#
See GetDenoisePassRel(), and also Create vs Get Property Methods for when to use Get vs Create.
-
inline explicit operator bool() const#
Check if this schema object is compatible with it’s held prim and that the prim is valid.
A typed schema object is compatible if the held prim’s type is or is a subtype of the schema’s type. Based on
prim.IsA()
.An API schema object is compatible if the API is of type SingleApplyAPI or UsdSchemaType::MultipleApplyAPI, and the schema has been applied to the prim. Based on
prim.HasAPI
.This method invokes polymorphic behaviour.
See also
- Returns:
True if the help prim is valid, and the schema object is compatible with its held prim.
Public Static Functions
- static inline UsdRenderPass 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
Protected Functions
-
inline virtual bool _IsCompatible() const#
Helper for subclasses to do specific compatibility checking with the given prim. Subclassess may override
_isCompatible
to for example check type compatibility or value compatibility on the prim.Overrides exist for UsdTyped and UsdAPISchemaBase.
This check is called when clients invoke the bool operator.
- Returns:
True if the schema object is compatible with its held prim.
-
inline explicit UsdRenderPass(const UsdPrim &prim = UsdPrim())#