HDK
|
#include <visibilityAPI.h>
Static Public Member Functions | |
static USDGEOM_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
static USDGEOM_API UsdGeomVisibilityAPI | Get (const UsdStagePtr &stage, const SdfPath &path) |
static USDGEOM_API bool | CanApply (const UsdPrim &prim, std::string *whyNot=nullptr) |
static USDGEOM_API UsdGeomVisibilityAPI | Apply (const UsdPrim &prim) |
Static Public Member Functions inherited from UsdAPISchemaBase | |
static USD_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Static Public Member Functions inherited from UsdSchemaBase | |
static const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Static Public Attributes | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::SingleApplyAPI |
Static Public Attributes inherited from UsdAPISchemaBase | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Static Public Attributes inherited from UsdSchemaBase | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Protected Member Functions | |
USDGEOM_API UsdSchemaKind | _GetSchemaKind () const override |
Protected Member Functions inherited from UsdAPISchemaBase | |
UsdAPISchemaBase (const UsdPrim &prim, const TfToken &instanceName) | |
UsdAPISchemaBase (const UsdSchemaBase &schemaObj, const TfToken &instanceName) | |
const TfToken & | _GetInstanceName () const |
USD_API bool | _IsCompatible () const override |
Protected Member Functions inherited from UsdSchemaBase | |
virtual UsdSchemaKind | _GetSchemaType () const |
const TfType & | _GetType () const |
USD_API UsdAttribute | _CreateAttr (TfToken const &attrName, SdfValueTypeName const &typeName, bool custom, SdfVariability variability, VtValue const &defaultValue, bool writeSparsely) const |
Friends | |
class | UsdSchemaRegistry |
Additional Inherited Members | |
Static Protected Member Functions inherited from UsdAPISchemaBase | |
static USD_API TfTokenVector | _GetMultipleApplyInstanceNames (const UsdPrim &prim, const TfType &schemaType) |
UsdGeomVisibilityAPI introduces properties that can be used to author visibility opinions.
The purpose visibility attributes added by this schema, guideVisibility, proxyVisibility, and renderVisibility can each be used to control visibility for geometry of the corresponding purpose values, with the overall visibility attribute acting as an override. I.e., if visibility evaluates to "invisible", purpose visibility is invisible; otherwise, purpose visibility is determined by the corresponding purpose visibility attribute.
Note that the behavior of guideVisibility is subtly different from the proxyVisibility and renderVisibility attributes, in that "guide" purpose visibility always evaluates to either "invisible" or "visible", whereas the other attributes may yield computed values of "inherited" if there is no authored opinion on the attribute or inherited from an ancestor. This is motivated by the fact that, in Pixar"s user workflows, we have never found a need to have all guides visible in a scene by default, whereas we do find that flexibility useful for "proxy" and "render" geometry.
This schema can only be applied to UsdGeomImageable prims. The UseGeomImageable schema provides API for computing the purpose visibility values that result from the attributes introduced by this schema.
For any described attribute Fallback Value or Allowed Values below that are text/tokens, the actual token is published and defined in UsdGeomTokens. So to set an attribute to the value "rightHanded", use UsdGeomTokens->rightHanded as the value.
Definition at line 93 of file visibilityAPI.h.
Construct a UsdGeomVisibilityAPI on UsdPrim prim
. Equivalent to UsdGeomVisibilityAPI::Get(prim.GetStage(), prim.GetPath()) for a valid prim
, but will not immediately throw an error for an invalid prim
Definition at line 105 of file visibilityAPI.h.
|
inlineexplicit |
Construct a UsdGeomVisibilityAPI on the prim held by schemaObj
. Should be preferred over UsdGeomVisibilityAPI(schemaObj.GetPrim()), as it preserves SchemaBase state.
Definition at line 113 of file visibilityAPI.h.
|
virtual |
Destructor.
|
overrideprotectedvirtual |
Returns the kind of schema this class belongs to.
Reimplemented from UsdAPISchemaBase.
|
static |
Applies this single-apply API schema to the given prim
. This information is stored by adding "VisibilityAPI" to the token-valued, listOp metadata apiSchemas on the prim.
|
static |
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.
USDGEOM_API UsdAttribute UsdGeomVisibilityAPI::CreateGuideVisibilityAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetGuideVisibilityAttr(), and also Usd_Create_Or_Get_Property 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
.
USDGEOM_API UsdAttribute UsdGeomVisibilityAPI::CreateProxyVisibilityAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetProxyVisibilityAttr(), and also Usd_Create_Or_Get_Property 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
.
USDGEOM_API UsdAttribute UsdGeomVisibilityAPI::CreateRenderVisibilityAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetRenderVisibilityAttr(), and also Usd_Create_Or_Get_Property 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
.
|
static |
Return a UsdGeomVisibilityAPI 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:
USDGEOM_API UsdAttribute UsdGeomVisibilityAPI::GetGuideVisibilityAttr | ( | ) | const |
This attribute controls visibility for geometry with purpose "guide".
Unlike overall visibility, guideVisibility is uniform, and therefore cannot be animated.
Also unlike overall visibility, guideVisibility is tri-state, in that a descendant with an opinion of "visible" overrides an ancestor opinion of "invisible".
The guideVisibility attribute works in concert with the overall visibility attribute: The visibility of a prim with purpose "guide" is determined by the inherited values it receives for the visibility and guideVisibility attributes. If visibility evaluates to "invisible", the prim is invisible. If visibility evaluates to "inherited" and guideVisibility evaluates to "visible", then the prim is visible. Otherwise, it is invisible.
Declaration | uniform token guideVisibility = "invisible" |
C++ Type | TfToken |
Usd Type | SdfValueTypeNames->Token |
Variability | SdfVariabilityUniform |
Allowed Values | inherited, invisible, visible |
USDGEOM_API UsdAttribute UsdGeomVisibilityAPI::GetProxyVisibilityAttr | ( | ) | const |
This attribute controls visibility for geometry with purpose "proxy".
Unlike overall visibility, proxyVisibility is uniform, and therefore cannot be animated.
Also unlike overall visibility, proxyVisibility is tri-state, in that a descendant with an opinion of "visible" overrides an ancestor opinion of "invisible".
The proxyVisibility attribute works in concert with the overall visibility attribute: The visibility of a prim with purpose "proxy" is determined by the inherited values it receives for the visibility and proxyVisibility attributes. If visibility evaluates to "invisible", the prim is invisible. If visibility evaluates to "inherited" then: If proxyVisibility evaluates to "visible", then the prim is visible; if proxyVisibility evaluates to "invisible", then the prim is invisible; if proxyVisibility evaluates to "inherited", then the prim may either be visible or invisible, depending on a fallback value determined by the calling context.
Declaration | uniform token proxyVisibility = "inherited" |
C++ Type | TfToken |
Usd Type | SdfValueTypeNames->Token |
Variability | SdfVariabilityUniform |
Allowed Values | inherited, invisible, visible |
USDGEOM_API UsdAttribute UsdGeomVisibilityAPI::GetPurposeVisibilityAttr | ( | const TfToken & | purpose | ) | const |
Return the attribute that is used for expressing visibility opinions for the given purpose
.
The valid purpose tokens are "guide", "proxy", and "render" which return the attributes guideVisibility, proxyVisibility, and renderVisibility respectively.
Note that while "default" is a valid purpose token for UsdGeomImageable::GetPurposeVisibilityAttr, it is not a valid purpose for this function, as UsdGeomVisibilityAPI itself does not have a default visibility attribute. Calling this function with "default will result in a coding error.
USDGEOM_API UsdAttribute UsdGeomVisibilityAPI::GetRenderVisibilityAttr | ( | ) | const |
This attribute controls visibility for geometry with purpose "render".
Unlike overall visibility, renderVisibility is uniform, and therefore cannot be animated.
Also unlike overall visibility, renderVisibility is tri-state, in that a descendant with an opinion of "visible" overrides an ancestor opinion of "invisible".
The renderVisibility attribute works in concert with the overall visibility attribute: The visibility of a prim with purpose "render" is determined by the inherited values it receives for the visibility and renderVisibility attributes. If visibility evaluates to "invisible", the prim is invisible. If visibility evaluates to "inherited" then: If renderVisibility evaluates to "visible", then the prim is visible; if renderVisibility evaluates to "invisible", then the prim is invisible; if renderVisibility evaluates to "inherited", then the prim may either be visible or invisible, depending on a fallback value determined by the calling context.
Declaration | uniform token renderVisibility = "inherited" |
C++ Type | TfToken |
Usd Type | SdfValueTypeNames->Token |
Variability | SdfVariabilityUniform |
Allowed Values | inherited, invisible, visible |
|
static |
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.
|
friend |
Definition at line 191 of file visibilityAPI.h.
|
static |
Compile time constant representing what kind of schema this class is.
Definition at line 99 of file visibilityAPI.h.