HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UsdGeomVisibilityAPI Class Reference

#include <visibilityAPI.h>

+ Inheritance diagram for UsdGeomVisibilityAPI:

Public Member Functions

 UsdGeomVisibilityAPI (const UsdPrim &prim=UsdPrim())
 
 UsdGeomVisibilityAPI (const UsdSchemaBase &schemaObj)
 
virtual USDGEOM_API ~UsdGeomVisibilityAPI ()
 Destructor. More...
 
USDGEOM_API UsdAttribute GetGuideVisibilityAttr () const
 
USDGEOM_API UsdAttribute CreateGuideVisibilityAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
 
USDGEOM_API UsdAttribute GetProxyVisibilityAttr () const
 
USDGEOM_API UsdAttribute CreateProxyVisibilityAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
 
USDGEOM_API UsdAttribute GetRenderVisibilityAttr () const
 
USDGEOM_API UsdAttribute CreateRenderVisibilityAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
 
USDGEOM_API UsdAttribute GetPurposeVisibilityAttr (const TfToken &purpose) const
 
- Public Member Functions inherited from UsdAPISchemaBase
 UsdAPISchemaBase (const UsdPrim &prim=UsdPrim())
 
 UsdAPISchemaBase (const UsdSchemaBase &schemaObj)
 
virtual USD_API ~UsdAPISchemaBase ()=0
 Destructor. More...
 
- Public Member Functions inherited from UsdSchemaBase
bool IsConcrete () const
 
bool IsTyped () const
 
bool IsAPISchema () const
 Returns whether this is an API schema or not. More...
 
bool IsAppliedAPISchema () const
 
bool IsMultipleApplyAPISchema () const
 
UsdSchemaKind GetSchemaKind () const
 Returns the kind of schema this class is. More...
 
USD_API UsdSchemaBase (const UsdPrim &prim=UsdPrim())
 Construct and store prim as the held prim. More...
 
USD_API UsdSchemaBase (const UsdSchemaBase &otherSchema)
 Construct and store for the same prim held by otherSchema. More...
 
virtual USD_API ~UsdSchemaBase ()
 Destructor. More...
 
USD_API operator bool () const
 
UsdPrim GetPrim () const
 Return this schema object's held prim. More...
 
SdfPath GetPath () const
 Shorthand for GetPrim()->GetPath(). More...
 
USD_API const UsdPrimDefinitionGetSchemaClassPrimDefinition () const
 

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 TfTokenVectorGetSchemaAttributeNames (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)
 

Detailed Description

UsdGeomVisibilityAPI introduces properties that can be used to author visibility opinions.

Note
Currently, this schema only introduces the attributes that are used to control purpose visibility. Later, this schema will define all visibility-related properties and UsdGeomImageable will no longer define those properties.

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.

Constructor & Destructor Documentation

UsdGeomVisibilityAPI::UsdGeomVisibilityAPI ( const UsdPrim prim = UsdPrim())
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 105 of file visibilityAPI.h.

UsdGeomVisibilityAPI::UsdGeomVisibilityAPI ( const UsdSchemaBase schemaObj)
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 USDGEOM_API UsdGeomVisibilityAPI::~UsdGeomVisibilityAPI ( )
virtual

Destructor.

Member Function Documentation

USDGEOM_API UsdSchemaKind UsdGeomVisibilityAPI::_GetSchemaKind ( ) const
overrideprotectedvirtual

Returns the kind of schema this class belongs to.

See Also
UsdSchemaKind

Reimplemented from UsdAPISchemaBase.

static USDGEOM_API UsdGeomVisibilityAPI UsdGeomVisibilityAPI::Apply ( const UsdPrim prim)
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.

Returns
A valid UsdGeomVisibilityAPI object is returned upon success. An invalid (or empty) UsdGeomVisibilityAPI object is returned upon failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
See Also
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
static USDGEOM_API bool UsdGeomVisibilityAPI::CanApply ( const UsdPrim prim,
std::string whyNot = nullptr 
)
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.

See Also
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
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 USDGEOM_API UsdGeomVisibilityAPI UsdGeomVisibilityAPI::Get ( const UsdStagePtr &  stage,
const SdfPath path 
)
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:

UsdGeomVisibilityAPI(stage->GetPrimAtPath(path));
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 USDGEOM_API const TfTokenVector& UsdGeomVisibilityAPI::GetSchemaAttributeNames ( bool  includeInherited = true)
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.

Friends And Related Function Documentation

friend class UsdSchemaRegistry
friend

Definition at line 191 of file visibilityAPI.h.

Member Data Documentation

const UsdSchemaKind UsdGeomVisibilityAPI::schemaKind = UsdSchemaKind::SingleApplyAPI
static

Compile time constant representing what kind of schema this class is.

See Also
UsdSchemaKind

Definition at line 99 of file visibilityAPI.h.


The documentation for this class was generated from the following file: