UsdRi module

Summary: The UsdRi module provides schemas and utilities for authoring USD that encodes Renderman-specific information, and USD/RI data conversions.


Classes:

MaterialAPI

Deprecated

SplineAPI

Deprecated

StatementsAPI

Container namespace schema for all renderman statements.

TextureAPI

Deprecated

Tokens

class pxr.UsdRi.MaterialAPI

Deprecated

Materials should use UsdShadeMaterial instead. This schema will be removed in a future release.

This API provides outputs that connect a material prim to prman shaders and RIS objects.

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

Methods:

Apply

classmethod Apply(prim) -> MaterialAPI

CanApply

classmethod CanApply(prim, whyNot) -> bool

ComputeInterfaceInputConsumersMap(...)

Walks the namespace subtree below the material and computes a map containing the list of all inputs on the material and the associated vector of consumers of their values.

CreateDisplacementAttr(defaultValue, ...)

See GetDisplacementAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

CreateSurfaceAttr(defaultValue, writeSparsely)

See GetSurfaceAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

CreateVolumeAttr(defaultValue, writeSparsely)

See GetVolumeAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

Get

classmethod Get(stage, path) -> MaterialAPI

GetDisplacement(ignoreBaseMaterial)

Returns a valid shader object if the"displacement"output on the material is connected to one.

GetDisplacementAttr()

Declaration

GetDisplacementOutput()

Returns the"displacement"output associated with the material.

GetSchemaAttributeNames

classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

GetSurface(ignoreBaseMaterial)

Returns a valid shader object if the"surface"output on the material is connected to one.

GetSurfaceAttr()

Declaration

GetSurfaceOutput()

Returns the"surface"output associated with the material.

GetVolume(ignoreBaseMaterial)

Returns a valid shader object if the"volume"output on the material is connected to one.

GetVolumeAttr()

Declaration

GetVolumeOutput()

Returns the"volume"output associated with the material.

SetDisplacementSource(displacementPath)

param displacementPath

SetSurfaceSource(surfacePath)

param surfacePath

SetVolumeSource(volumePath)

param volumePath

static Apply()

classmethod Apply(prim) -> MaterialAPI

Applies this single-apply API schema to the given prim .

This information is stored by adding”RiMaterialAPI”to the token- valued, listOp metadata apiSchemas on the prim.

A valid UsdRiMaterialAPI object is returned upon success. An invalid (or empty) UsdRiMaterialAPI object is returned upon failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.

UsdPrim::GetAppliedSchemas()

UsdPrim::HasAPI()

UsdPrim::CanApplyAPI()

UsdPrim::ApplyAPI()

UsdPrim::RemoveAPI()

Parameters

prim (Prim) –

static CanApply()

classmethod CanApply(prim, whyNot) -> bool

Returns true if this single-apply API schema can be applied to the given prim .

If this schema can not be a applied to the prim, this returns false and, if provided, populates whyNot with the reason it can not be applied.

Note that if CanApply returns false, that does not necessarily imply that calling Apply will fail. Callers are expected to call CanApply before calling Apply if they want to ensure that it is valid to apply a schema.

UsdPrim::GetAppliedSchemas()

UsdPrim::HasAPI()

UsdPrim::CanApplyAPI()

UsdPrim::ApplyAPI()

UsdPrim::RemoveAPI()

Parameters
  • prim (Prim) –

  • whyNot (str) –

ComputeInterfaceInputConsumersMap(computeTransitiveConsumers) NodeGraph.InterfaceInputConsumersMap

Walks the namespace subtree below the material and computes a map containing the list of all inputs on the material and the associated vector of consumers of their values.

The consumers can be inputs on shaders within the material or on node- graphs under it.

Parameters

computeTransitiveConsumers (bool) –

CreateDisplacementAttr(defaultValue, writeSparsely) Attribute

See GetDisplacementAttr() , 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 .

Parameters
  • defaultValue (VtValue) –

  • writeSparsely (bool) –

CreateSurfaceAttr(defaultValue, writeSparsely) Attribute

See GetSurfaceAttr() , 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 .

Parameters
  • defaultValue (VtValue) –

  • writeSparsely (bool) –

CreateVolumeAttr(defaultValue, writeSparsely) Attribute

See GetVolumeAttr() , 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 .

Parameters
  • defaultValue (VtValue) –

  • writeSparsely (bool) –

static Get()

classmethod Get(stage, path) -> MaterialAPI

Return a UsdRiMaterialAPI holding the prim adhering to this schema at path on stage .

If no prim exists at path on stage , or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:

UsdRiMaterialAPI(stage->GetPrimAtPath(path));
Parameters
GetDisplacement(ignoreBaseMaterial) Shader

Returns a valid shader object if the”displacement”output on the material is connected to one.

If ignoreBaseMaterial is true and if the”displacement”shader source is specified in the base-material of this material, then this returns an invalid shader object.

Parameters

ignoreBaseMaterial (bool) –

GetDisplacementAttr() Attribute

Declaration

token outputs:ri:displacement

C++ Type

TfToken

Usd Type

SdfValueTypeNames->Token

GetDisplacementOutput() Output

Returns the”displacement”output associated with the material.

static GetSchemaAttributeNames()

classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes.

Does not include attributes that may be authored by custom/extended methods of the schemas involved.

Parameters

includeInherited (bool) –

GetSurface(ignoreBaseMaterial) Shader

Returns a valid shader object if the”surface”output on the material is connected to one.

If ignoreBaseMaterial is true and if the”surface”shader source is specified in the base-material of this material, then this returns an invalid shader object.

Parameters

ignoreBaseMaterial (bool) –

GetSurfaceAttr() Attribute

Declaration

token outputs:ri:surface

C++ Type

TfToken

Usd Type

SdfValueTypeNames->Token

GetSurfaceOutput() Output

Returns the”surface”output associated with the material.

GetVolume(ignoreBaseMaterial) Shader

Returns a valid shader object if the”volume”output on the material is connected to one.

If ignoreBaseMaterial is true and if the”volume”shader source is specified in the base-material of this material, then this returns an invalid shader object.

Parameters

ignoreBaseMaterial (bool) –

GetVolumeAttr() Attribute

Declaration

token outputs:ri:volume

C++ Type

TfToken

Usd Type

SdfValueTypeNames->Token

GetVolumeOutput() Output

Returns the”volume”output associated with the material.

SetDisplacementSource(displacementPath) bool
Parameters

displacementPath (Path) –

SetSurfaceSource(surfacePath) bool
Parameters

surfacePath (Path) –

SetVolumeSource(volumePath) bool
Parameters

volumePath (Path) –

class pxr.UsdRi.SplineAPI

Deprecated

This API schema will be removed in a future release.

RiSplineAPI is a general purpose API schema used to describe a named spline stored as a set of attributes on a prim.

It is an add-on schema that can be applied many times to a prim with different spline names. All the attributes authored by the schema are namespaced under”$NAME:spline:”, with the name of the spline providing a namespace for the attributes.

The spline describes a 2D piecewise cubic curve with a position and value for each knot. This is chosen to give straightforward artistic control over the shape. The supported basis types are:

  • linear (UsdRiTokens->linear)

  • bspline (UsdRiTokens->bspline)

  • Catmull-Rom (UsdRiTokens->catmullRom)

Methods:

Apply

classmethod Apply(prim) -> SplineAPI

CanApply

classmethod CanApply(prim, whyNot) -> bool

CreateInterpolationAttr(defaultValue, ...)

See GetInterpolationAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

CreatePositionsAttr(defaultValue, writeSparsely)

See GetPositionsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

CreateValuesAttr(defaultValue, writeSparsely)

See GetValuesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

Get

classmethod Get(stage, path) -> SplineAPI

GetInterpolationAttr()

Interpolation method for the spline.

GetPositionsAttr()

Positions of the knots.

GetSchemaAttributeNames

classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

GetValuesAttr()

Values of the knots.

GetValuesTypeName()

Returns the intended typename of the values attribute of the spline.

Validate(reason)

Validates the attribute values belonging to the spline.

static Apply()

classmethod Apply(prim) -> SplineAPI

Applies this single-apply API schema to the given prim .

This information is stored by adding”RiSplineAPI”to the token-valued, listOp metadata apiSchemas on the prim.

A valid UsdRiSplineAPI object is returned upon success. An invalid (or empty) UsdRiSplineAPI object is returned upon failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.

UsdPrim::GetAppliedSchemas()

UsdPrim::HasAPI()

UsdPrim::CanApplyAPI()

UsdPrim::ApplyAPI()

UsdPrim::RemoveAPI()

Parameters

prim (Prim) –

static CanApply()

classmethod CanApply(prim, whyNot) -> bool

Returns true if this single-apply API schema can be applied to the given prim .

If this schema can not be a applied to the prim, this returns false and, if provided, populates whyNot with the reason it can not be applied.

Note that if CanApply returns false, that does not necessarily imply that calling Apply will fail. Callers are expected to call CanApply before calling Apply if they want to ensure that it is valid to apply a schema.

UsdPrim::GetAppliedSchemas()

UsdPrim::HasAPI()

UsdPrim::CanApplyAPI()

UsdPrim::ApplyAPI()

UsdPrim::RemoveAPI()

Parameters
  • prim (Prim) –

  • whyNot (str) –

CreateInterpolationAttr(defaultValue, writeSparsely) Attribute

See GetInterpolationAttr() , 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 .

Parameters
  • defaultValue (VtValue) –

  • writeSparsely (bool) –

CreatePositionsAttr(defaultValue, writeSparsely) Attribute

See GetPositionsAttr() , 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 .

Parameters
  • defaultValue (VtValue) –

  • writeSparsely (bool) –

CreateValuesAttr(defaultValue, writeSparsely) Attribute

See GetValuesAttr() , 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 .

Parameters
  • defaultValue (VtValue) –

  • writeSparsely (bool) –

static Get()

classmethod Get(stage, path) -> SplineAPI

Return a UsdRiSplineAPI holding the prim adhering to this schema at path on stage .

If no prim exists at path on stage , or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:

UsdRiSplineAPI(stage->GetPrimAtPath(path));
Parameters
GetInterpolationAttr() Attribute

Interpolation method for the spline.

C++ Type: TfToken Usd Type: SdfValueTypeNames->Token Variability: SdfVariabilityUniform Fallback Value: linear Allowed Values : [linear, constant, bspline, catmullRom]

GetPositionsAttr() Attribute

Positions of the knots.

C++ Type: VtArray<float> Usd Type: SdfValueTypeNames->FloatArray Variability: SdfVariabilityUniform Fallback Value: No Fallback

static GetSchemaAttributeNames()

classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes.

Does not include attributes that may be authored by custom/extended methods of the schemas involved.

Parameters

includeInherited (bool) –

GetValuesAttr() Attribute

Values of the knots.

C++ Type: See GetValuesTypeName() Usd Type: See GetValuesTypeName() Variability: SdfVariabilityUniform Fallback Value: No Fallback

GetValuesTypeName() ValueTypeName

Returns the intended typename of the values attribute of the spline.

Validate(reason) bool

Validates the attribute values belonging to the spline.

Returns true if the spline has all valid attribute values. Returns false and populates the reason output argument if the spline has invalid attribute values.

Here’s the list of validations performed by this method:

  • the SplineAPI must be fully initialized

  • interpolation attribute must exist and use an allowed value

  • the positions array must be a float array

  • the positions array must be sorted by increasing value

  • the values array must use the correct value type

  • the positions and values array must have the same size

Parameters

reason (str) –

class pxr.UsdRi.StatementsAPI

Container namespace schema for all renderman statements.

The longer term goal is for clients to go directly to primvar or render-attribute API’s, instead of using UsdRi StatementsAPI for inherited attributes. Anticpating this, StatementsAPI can smooth the way via a few environment variables:

  • USDRI_STATEMENTS_READ_OLD_ENCODING: Causes StatementsAPI to read old-style attributes instead of primvars in the”ri:”namespace.

Methods:

Apply

classmethod Apply(prim) -> StatementsAPI

CanApply

classmethod CanApply(prim, whyNot) -> bool

CreateRiAttribute(name, riType, nameSpace)

Create a rib attribute on the prim to which this schema is attached.

Get

classmethod Get(stage, path) -> StatementsAPI

GetCoordinateSystem()

Returns the value in the"ri:coordinateSystem"attribute if it exists.

GetModelCoordinateSystems(targets)

Populates the output targets with the authored ri:modelCoordinateSystems, if any.

GetModelScopedCoordinateSystems(targets)

Populates the output targets with the authored ri:modelScopedCoordinateSystems, if any.

GetRiAttribute(name, nameSpace)

Return a UsdAttribute representing the Ri attribute with the name name, in the namespace nameSpace.

GetRiAttributeName

classmethod GetRiAttributeName(prop) -> str

GetRiAttributeNameSpace

classmethod GetRiAttributeNameSpace(prop) -> str

GetRiAttributes(nameSpace)

Return all rib attributes on this prim, or under a specific namespace (e.g."user").

GetSchemaAttributeNames

classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

GetScopedCoordinateSystem()

Returns the value in the"ri:scopedCoordinateSystem"attribute if it exists.

HasCoordinateSystem()

Returns true if the underlying prim has a ri:coordinateSystem opinion.

HasScopedCoordinateSystem()

Returns true if the underlying prim has a ri:scopedCoordinateSystem opinion.

IsRiAttribute

classmethod IsRiAttribute(prop) -> bool

MakeRiAttributePropertyName

classmethod MakeRiAttributePropertyName(attrName) -> str

SetCoordinateSystem(coordSysName)

Sets the"ri:coordinateSystem"attribute to the given string value, creating the attribute if needed.

SetScopedCoordinateSystem(coordSysName)

Sets the"ri:scopedCoordinateSystem"attribute to the given string value, creating the attribute if needed.

static Apply()

classmethod Apply(prim) -> StatementsAPI

Applies this single-apply API schema to the given prim .

This information is stored by adding”StatementsAPI”to the token- valued, listOp metadata apiSchemas on the prim.

A valid UsdRiStatementsAPI object is returned upon success. An invalid (or empty) UsdRiStatementsAPI object is returned upon failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.

UsdPrim::GetAppliedSchemas()

UsdPrim::HasAPI()

UsdPrim::CanApplyAPI()

UsdPrim::ApplyAPI()

UsdPrim::RemoveAPI()

Parameters

prim (Prim) –

static CanApply()

classmethod CanApply(prim, whyNot) -> bool

Returns true if this single-apply API schema can be applied to the given prim .

If this schema can not be a applied to the prim, this returns false and, if provided, populates whyNot with the reason it can not be applied.

Note that if CanApply returns false, that does not necessarily imply that calling Apply will fail. Callers are expected to call CanApply before calling Apply if they want to ensure that it is valid to apply a schema.

UsdPrim::GetAppliedSchemas()

UsdPrim::HasAPI()

UsdPrim::CanApplyAPI()

UsdPrim::ApplyAPI()

UsdPrim::RemoveAPI()

Parameters
  • prim (Prim) –

  • whyNot (str) –

CreateRiAttribute(name, riType, nameSpace) Attribute

Create a rib attribute on the prim to which this schema is attached.

A rib attribute consists of an attribute “nameSpace” and an attribute “name”. For example, the namespace”cull”may define attributes”backfacing”and”hidden”, and user-defined attributes belong to the namespace”user”.

This method makes no attempt to validate that the given nameSpace and name are actually meaningful to prman or any other renderer.

riType

should be a known RenderMan type definition, which can be array- valued. For instance, both”color”and”float[3]”are valid values for riType .

Parameters
  • name (str) –

  • riType (str) –

  • nameSpace (str) –


CreateRiAttribute(name, tfType, nameSpace) -> Attribute

Creates an attribute of the given tfType .

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
  • name (str) –

  • tfType (Type) –

  • nameSpace (str) –

static Get()

classmethod Get(stage, path) -> StatementsAPI

Return a UsdRiStatementsAPI holding the prim adhering to this schema at path on stage .

If no prim exists at path on stage , or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:

UsdRiStatementsAPI(stage->GetPrimAtPath(path));
Parameters
GetCoordinateSystem() str

Returns the value in the”ri:coordinateSystem”attribute if it exists.

GetModelCoordinateSystems(targets) bool

Populates the output targets with the authored ri:modelCoordinateSystems, if any.

Returns true if the query was successful.

Parameters

targets (list[SdfPath]) –

GetModelScopedCoordinateSystems(targets) bool

Populates the output targets with the authored ri:modelScopedCoordinateSystems, if any.

Returns true if the query was successful.

Parameters

targets (list[SdfPath]) –

GetRiAttribute(name, nameSpace) Attribute

Return a UsdAttribute representing the Ri attribute with the name name, in the namespace nameSpace.

The attribute returned may or may not actually exist so it must be checked for validity.

Parameters
  • name (str) –

  • nameSpace (str) –

static GetRiAttributeName()

classmethod GetRiAttributeName(prop) -> str

Return the base, most-specific name of the rib attribute.

For example, the name of the rib attribute”cull:backfacing”is”backfacing”

Parameters

prop (Property) –

static GetRiAttributeNameSpace()

classmethod GetRiAttributeNameSpace(prop) -> str

Return the containing namespace of the rib attribute (e.g.”user”).

Parameters

prop (Property) –

GetRiAttributes(nameSpace) list[Property]

Return all rib attributes on this prim, or under a specific namespace (e.g.”user”).

As noted above, rib attributes can be either UsdAttribute or UsdRelationship, and like all UsdProperties, need not have a defined value.

Parameters

nameSpace (str) –

static GetSchemaAttributeNames()

classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes.

Does not include attributes that may be authored by custom/extended methods of the schemas involved.

Parameters

includeInherited (bool) –

GetScopedCoordinateSystem() str

Returns the value in the”ri:scopedCoordinateSystem”attribute if it exists.

HasCoordinateSystem() bool

Returns true if the underlying prim has a ri:coordinateSystem opinion.

HasScopedCoordinateSystem() bool

Returns true if the underlying prim has a ri:scopedCoordinateSystem opinion.

static IsRiAttribute()

classmethod IsRiAttribute(prop) -> bool

Return true if the property is in the”ri:attributes”namespace.

Parameters

prop (Property) –

static MakeRiAttributePropertyName()

classmethod MakeRiAttributePropertyName(attrName) -> str

Returns the given attrName prefixed with the full Ri attribute namespace, creating a name suitable for an RiAttribute UsdProperty.

This handles conversion of common separator characters used in other packages, such as periods and underscores.

Will return empty string if attrName is not a valid property identifier; otherwise, will return a valid property name that identifies the property as an RiAttribute, according to the following rules:

  • If attrName is already a properly constructed RiAttribute property name, return it unchanged.

  • If attrName contains two or more tokens separated by a colon, consider the first to be the namespace, and the rest the name, joined by underscores

  • If attrName contains two or more tokens separated by a period, consider the first to be the namespace, and the rest the name, joined by underscores

  • If attrName contains two or more tokens separated by an, underscore consider the first to be the namespace, and the rest the name, joined by underscores

  • else, assume attrName is the name, and”user”is the namespace

Parameters

attrName (str) –

SetCoordinateSystem(coordSysName) None

Sets the”ri:coordinateSystem”attribute to the given string value, creating the attribute if needed.

That identifies this prim as providing a coordinate system, which can be retrieved via UsdGeomXformable::GetTransformAttr(). Also adds the owning prim to the ri:modelCoordinateSystems relationship targets on its parent leaf model prim, if it exists. If this prim is not under a leaf model, no relationship targets will be authored.

Parameters

coordSysName (str) –

SetScopedCoordinateSystem(coordSysName) None

Sets the”ri:scopedCoordinateSystem”attribute to the given string value, creating the attribute if needed.

That identifies this prim as providing a coordinate system, which can be retrieved via UsdGeomXformable::GetTransformAttr(). Such coordinate systems are local to the RI attribute stack state, but does get updated properly for instances when defined inside an object master. Also adds the owning prim to the ri:modelScopedCoordinateSystems relationship targets on its parent leaf model prim, if it exists. If this prim is not under a leaf model, no relationship targets will be authored.

Parameters

coordSysName (str) –

class pxr.UsdRi.TextureAPI

Deprecated

This API schema will be removed in a future release.

RiTextureAPI is an API schema that provides an interface to add Renderman-specific attributes to adjust textures.

Methods:

Apply

classmethod Apply(prim) -> TextureAPI

CanApply

classmethod CanApply(prim, whyNot) -> bool

CreateRiTextureGammaAttr(defaultValue, ...)

See GetRiTextureGammaAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

CreateRiTextureSaturationAttr(defaultValue, ...)

See GetRiTextureSaturationAttr() , and also Create vs Get Property Methods for when to use Get vs Create.

Get

classmethod Get(stage, path) -> TextureAPI

GetRiTextureGammaAttr()

Gamma-correct the texture.

GetRiTextureSaturationAttr()

Adjust the texture's saturation.

GetSchemaAttributeNames

classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

static Apply()

classmethod Apply(prim) -> TextureAPI

Applies this single-apply API schema to the given prim .

This information is stored by adding”RiTextureAPI”to the token-valued, listOp metadata apiSchemas on the prim.

A valid UsdRiTextureAPI object is returned upon success. An invalid (or empty) UsdRiTextureAPI object is returned upon failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.

UsdPrim::GetAppliedSchemas()

UsdPrim::HasAPI()

UsdPrim::CanApplyAPI()

UsdPrim::ApplyAPI()

UsdPrim::RemoveAPI()

Parameters

prim (Prim) –

static CanApply()

classmethod CanApply(prim, whyNot) -> bool

Returns true if this single-apply API schema can be applied to the given prim .

If this schema can not be a applied to the prim, this returns false and, if provided, populates whyNot with the reason it can not be applied.

Note that if CanApply returns false, that does not necessarily imply that calling Apply will fail. Callers are expected to call CanApply before calling Apply if they want to ensure that it is valid to apply a schema.

UsdPrim::GetAppliedSchemas()

UsdPrim::HasAPI()

UsdPrim::CanApplyAPI()

UsdPrim::ApplyAPI()

UsdPrim::RemoveAPI()

Parameters
  • prim (Prim) –

  • whyNot (str) –

CreateRiTextureGammaAttr(defaultValue, writeSparsely) Attribute

See GetRiTextureGammaAttr() , 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 .

Parameters
  • defaultValue (VtValue) –

  • writeSparsely (bool) –

CreateRiTextureSaturationAttr(defaultValue, writeSparsely) Attribute

See GetRiTextureSaturationAttr() , 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 .

Parameters
  • defaultValue (VtValue) –

  • writeSparsely (bool) –

static Get()

classmethod Get(stage, path) -> TextureAPI

Return a UsdRiTextureAPI holding the prim adhering to this schema at path on stage .

If no prim exists at path on stage , or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:

UsdRiTextureAPI(stage->GetPrimAtPath(path));
Parameters
GetRiTextureGammaAttr() Attribute

Gamma-correct the texture.

Declaration

float ri:texture:gamma

C++ Type

float

Usd Type

SdfValueTypeNames->Float

GetRiTextureSaturationAttr() Attribute

Adjust the texture’s saturation.

Declaration

float ri:texture:saturation

C++ Type

float

Usd Type

SdfValueTypeNames->Float

static GetSchemaAttributeNames()

classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]

Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes.

Does not include attributes that may be authored by custom/extended methods of the schemas involved.

Parameters

includeInherited (bool) –

class pxr.UsdRi.Tokens

Attributes:

bspline

catmullRom

constant

interpolation

linear

outputsRiDisplacement

outputsRiSurface

outputsRiVolume

positions

renderContext

riTextureGamma

riTextureSaturation

spline

values

bspline = 'bspline'
catmullRom = 'catmull-rom'
constant = 'constant'
interpolation = 'interpolation'
linear = 'linear'
outputsRiDisplacement = 'outputs:ri:displacement'
outputsRiSurface = 'outputs:ri:surface'
outputsRiVolume = 'outputs:ri:volume'
positions = 'positions'
renderContext = 'ri'
riTextureGamma = 'ri:texture:gamma'
riTextureSaturation = 'ri:texture:saturation'
spline = 'spline'
values = 'values'