![]() |
|
UsdGeomVisibilityAPI introduces properties that can be used to author visibility opinions. More...
#include <visibilityAPI.h>
Public Member Functions | |
UsdGeomVisibilityAPI (const UsdPrim &prim=UsdPrim()) | |
Construct a UsdGeomVisibilityAPI on UsdPrim prim . | |
UsdGeomVisibilityAPI (const UsdSchemaBase &schemaObj) | |
Construct a UsdGeomVisibilityAPI on the prim held by schemaObj . | |
virtual USDGEOM_API | ~UsdGeomVisibilityAPI () |
Destructor. | |
USDGEOM_API UsdAttribute | GetGuideVisibilityAttr () const |
This attribute controls visibility for geometry with purpose "guide". | |
USDGEOM_API UsdAttribute | CreateGuideVisibilityAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetGuideVisibilityAttr(), and also Create vs Get Property Methods for when to use Get vs Create. | |
USDGEOM_API UsdAttribute | GetProxyVisibilityAttr () const |
This attribute controls visibility for geometry with purpose "proxy". | |
USDGEOM_API UsdAttribute | CreateProxyVisibilityAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetProxyVisibilityAttr(), and also Create vs Get Property Methods for when to use Get vs Create. | |
USDGEOM_API UsdAttribute | GetRenderVisibilityAttr () const |
This attribute controls visibility for geometry with purpose "render". | |
USDGEOM_API UsdAttribute | CreateRenderVisibilityAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetRenderVisibilityAttr(), and also Create vs Get Property Methods for when to use Get vs Create. | |
USDGEOM_API UsdAttribute | GetPurposeVisibilityAttr (const TfToken &purpose) const |
Return the attribute that is used for expressing visibility opinions for the given purpose . | |
![]() | |
UsdAPISchemaBase (const UsdPrim &prim=UsdPrim()) | |
Construct a UsdAPISchemaBase on UsdPrim prim . | |
UsdAPISchemaBase (const UsdSchemaBase &schemaObj) | |
Construct a UsdAPISchemaBase on the prim held by schemaObj . | |
virtual USD_API | ~UsdAPISchemaBase ()=0 |
Destructor. | |
![]() | |
bool | IsConcrete () const |
Returns whether or not this class corresponds to a concrete instantiable prim type in scene description. | |
bool | IsTyped () const |
Returns whether or not this class inherits from UsdTyped. | |
bool | IsAPISchema () const |
Returns whether this is an API schema or not. | |
bool | IsAppliedAPISchema () const |
Returns whether this is an applied API schema or not. | |
bool | IsMultipleApplyAPISchema () const |
Returns whether this is an applied API schema or not. | |
UsdSchemaKind | GetSchemaKind () const |
Returns the kind of schema this class is. | |
USD_API | UsdSchemaBase (const UsdPrim &prim=UsdPrim()) |
Construct and store prim as the held prim. | |
USD_API | UsdSchemaBase (const UsdSchemaBase &otherSchema) |
Construct and store for the same prim held by otherSchema . | |
virtual USD_API | ~UsdSchemaBase () |
Destructor. | |
UsdPrim | GetPrim () const |
Return this schema object's held prim. | |
SdfPath | GetPath () const |
Shorthand for GetPrim()->GetPath(). | |
USD_API const UsdPrimDefinition * | GetSchemaClassPrimDefinition () const |
Return the prim definition associated with this schema instance if one exists, otherwise return null. | |
USD_API | operator bool () const |
Return true if this schema object is compatible with its held prim, false otherwise. | |
Static Public Member Functions | |
static USDGEOM_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. | |
static USDGEOM_API UsdGeomVisibilityAPI | Get (const UsdStagePtr &stage, const SdfPath &path) |
Return a UsdGeomVisibilityAPI holding the prim adhering to this schema at path on stage . | |
static USDGEOM_API bool | CanApply (const UsdPrim &prim, std::string *whyNot=nullptr) |
Returns true if this single-apply API schema can be applied to the given prim . | |
static USDGEOM_API UsdGeomVisibilityAPI | Apply (const UsdPrim &prim) |
Applies this single-apply API schema to the given prim . | |
![]() | |
static USD_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. | |
![]() | |
static const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Static Public Attributes | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::SingleApplyAPI |
Compile time constant representing what kind of schema this class is. | |
![]() | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Compile time constant representing what kind of schema this class is. | |
![]() | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Compile time constant representing what kind of schema this class is. | |
Protected Member Functions | |
USDGEOM_API UsdSchemaKind | _GetSchemaKind () const override |
Returns the kind of schema this class belongs to. | |
![]() | |
USD_API UsdSchemaKind | _GetSchemaKind () const override |
Returns the kind of schema this class belongs to. | |
UsdAPISchemaBase (const UsdPrim &prim, const TfToken &instanceName) | |
Construct a multiple-apply UsdAPISchemaBase on UsdPrim prim with the specified instanceName . | |
UsdAPISchemaBase (const UsdSchemaBase &schemaObj, const TfToken &instanceName) | |
Construct a multiple-apply UsdAPISchemaBase on the prim held by schemaObj with the given instanceName . | |
const TfToken & | _GetInstanceName () const |
Returns the instance name of the API schema object belonging to a multiple-apply API schema. | |
USD_API bool | _IsCompatible () const override |
Check whether this APISchema object is valid for the currently held prim. | |
![]() | |
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 USD_API TfTokenVector | _GetMultipleApplyInstanceNames (const UsdPrim &prim, const TfType &schemaType) |
Returns a vector of names of API schema objects belonging to a multiple-apply API schema applied to a given prim. | |
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 \em Fallback \em Value or \em Allowed \em Values below that are text/tokens, the actual token is published and defined in \ref UsdGeomTokens. So to set an attribute to the value "rightHanded", use UsdGeomTokens->rightHanded as the value.
Definition at line 76 of file visibilityAPI.h.
|
inlineexplicit |
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 88 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 96 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 CreateGuideVisibilityAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetGuideVisibilityAttr(), 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
.
USDGEOM_API UsdAttribute CreateProxyVisibilityAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetProxyVisibilityAttr(), 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
.
USDGEOM_API UsdAttribute CreateRenderVisibilityAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetRenderVisibilityAttr(), 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
.
|
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 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 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 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 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 174 of file visibilityAPI.h.
|
static |
Compile time constant representing what kind of schema this class is.
Definition at line 82 of file visibilityAPI.h.