UsdHydra module
Summary: The UsdHydra module.
Classes:
This API extends and configures the core UsdProcGenerativeProcedural schema defined within usdProc for use with hydra generative procedurals as defined within hdGp. |
|
- class pxr.UsdHydra.GenerativeProceduralAPI
This API extends and configures the core UsdProcGenerativeProcedural schema defined within usdProc for use with hydra generative procedurals as defined within hdGp.
For any described attribute Fallback Value or Allowed Values below that are text/tokens, the actual token is published and defined in UsdHydraTokens. So to set an attribute to the value”rightHanded”, use UsdHydraTokens->rightHanded as the value.
Methods:
classmethod Apply(prim) -> GenerativeProceduralAPI
classmethod CanApply(prim, whyNot) -> bool
CreateProceduralSystemAttr
(defaultValue, ...)See GetProceduralSystemAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateProceduralTypeAttr
(defaultValue, ...)See GetProceduralTypeAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
classmethod Get(stage, path) -> GenerativeProceduralAPI
This value should correspond to a configured instance of HdGpGenerativeProceduralResolvingSceneIndex which will evaluate the procedural.
The registered name of a HdGpGenerativeProceduralPlugin to be executed.
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
- static Apply()
classmethod Apply(prim) -> GenerativeProceduralAPI
Applies this single-apply API schema to the given
prim
.This information is stored by adding”HydraGenerativeProceduralAPI”to the token-valued, listOp metadata apiSchemas on the prim.
A valid UsdHydraGenerativeProceduralAPI object is returned upon success. An invalid (or empty) UsdHydraGenerativeProceduralAPI 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) –
- CreateProceduralSystemAttr(defaultValue, writeSparsely) Attribute
See GetProceduralSystemAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateProceduralTypeAttr(defaultValue, writeSparsely) Attribute
See GetProceduralTypeAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- static Get()
classmethod Get(stage, path) -> GenerativeProceduralAPI
Return a UsdHydraGenerativeProceduralAPI holding the prim adhering to this schema at
path
onstage
.If no prim exists at
path
onstage
, or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:UsdHydraGenerativeProceduralAPI(stage->GetPrimAtPath(path));
- GetProceduralSystemAttr() Attribute
This value should correspond to a configured instance of HdGpGenerativeProceduralResolvingSceneIndex which will evaluate the procedural.
The default value of”hydraGenerativeProcedural”matches the equivalent default of HdGpGenerativeProceduralResolvingSceneIndex. Multiple instances of the scene index can be used to determine where within a scene index chain a given procedural will be evaluated.
Declaration
token proceduralSystem ="hydraGenerativeProcedural"
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
- GetProceduralTypeAttr() Attribute
The registered name of a HdGpGenerativeProceduralPlugin to be executed.
Declaration
token primvars:hdGp:proceduralType
C++ Type
TfToken
Usd Type
SdfValueTypeNames->Token
- static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
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.UsdHydra.Tokens
Attributes:
- HwPrimvar_1 = 'HwPrimvar_1'
- HwPtexTexture_1 = 'HwPtexTexture_1'
- HwUvTexture_1 = 'HwUvTexture_1'
- black = 'black'
- clamp = 'clamp'
- displayLookBxdf = 'displayLook:bxdf'
- faceIndex = 'faceIndex'
- faceOffset = 'faceOffset'
- frame = 'frame'
- hydraGenerativeProcedural = 'hydraGenerativeProcedural'
- infoFilename = 'inputs:file'
- infoVarname = 'inputs:varname'
- linear = 'linear'
- linearMipmapLinear = 'linearMipmapLinear'
- linearMipmapNearest = 'linearMipmapNearest'
- magFilter = 'magFilter'
- minFilter = 'minFilter'
- mirror = 'mirror'
- nearest = 'nearest'
- nearestMipmapLinear = 'nearestMipmapLinear'
- nearestMipmapNearest = 'nearestMipmapNearest'
- primvarsHdGpProceduralType = 'primvars:hdGp:proceduralType'
- proceduralSystem = 'proceduralSystem'
- repeat = 'repeat'
- textureMemory = 'textureMemory'
- useMetadata = 'useMetadata'
- uv = 'uv'
- wrapS = 'wrapS'
- wrapT = 'wrapT'