UsdGeomVisibilityAPI Class Reference

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

+ Inheritance diagram for UsdGeomVisibilityAPI:

Public Member Functions

 UsdGeomVisibilityAPI (const UsdPrim &prim=UsdPrim())
 Construct a UsdGeomVisibilityAPI on UsdPrim prim . More...
 
 UsdGeomVisibilityAPI (const UsdSchemaBase &schemaObj)
 Construct a UsdGeomVisibilityAPI on the prim held by schemaObj . More...
 
virtual USDGEOM_API ~UsdGeomVisibilityAPI ()
 Destructor. More...
 
USDGEOM_API UsdAttribute GetGuideVisibilityAttr () const
 This attribute controls visibility for geometry with purpose "guide". More...
 
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. More...
 
USDGEOM_API UsdAttribute GetProxyVisibilityAttr () const
 This attribute controls visibility for geometry with purpose "proxy". More...
 
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. More...
 
USDGEOM_API UsdAttribute GetRenderVisibilityAttr () const
 This attribute controls visibility for geometry with purpose "render". More...
 
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. More...
 
- Public Member Functions inherited from UsdAPISchemaBase
 UsdAPISchemaBase (const UsdPrim &prim=UsdPrim())
 Construct a UsdAPISchemaBase on UsdPrim prim . More...
 
 UsdAPISchemaBase (const UsdSchemaBase &schemaObj)
 Construct a UsdAPISchemaBase on the prim held by schemaObj . More...
 
virtual USD_API ~UsdAPISchemaBase ()=0
 Destructor. More...
 
- Public Member Functions inherited from UsdSchemaBase
bool IsConcrete () const
 Returns whether or not this class corresponds to a concrete instantiable prim type in scene description. More...
 
bool IsTyped () const
 Returns whether or not this class inherits from UsdTyped. More...
 
bool IsAPISchema () const
 Returns whether this is an API schema or not. More...
 
bool IsAppliedAPISchema () const
 Returns whether this is an applied API schema or not. More...
 
bool IsMultipleApplyAPISchema () const
 Returns whether this is an applied API schema or not. More...
 
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
 Return the prim definition associated with this schema instance if one exists, otherwise return null. More...
 

Static Public Member Functions

static USDGEOM_API const TfTokenVectorGetSchemaAttributeNames (bool includeInherited=true)
 Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. More...
 
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. More...
 
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. More...
 
static USDGEOM_API UsdGeomVisibilityAPI Apply (const UsdPrim &prim)
 Applies this single-apply API schema to the given prim. More...
 
- Static Public Member Functions inherited from UsdAPISchemaBase
static USD_API const TfTokenVectorGetSchemaAttributeNames (bool includeInherited=true)
 Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. More...
 
- Static Public Member Functions inherited from UsdSchemaBase
static const TfTokenVectorGetSchemaAttributeNames (bool includeInherited=true)
 

Static Public Attributes

static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI
 Compile time constant representing what kind of schema this class is. More...
 
- Static Public Attributes inherited from UsdAPISchemaBase
static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractBase
 Compile time constant representing what kind of schema this class is. More...
 
- Static Public Attributes inherited from UsdSchemaBase
static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractBase
 Compile time constant representing what kind of schema this class is. More...
 

Protected Member Functions

USDGEOM_API UsdSchemaKind _GetSchemaKind () const override
 Returns the kind of schema this class belongs to. More...
 
- Protected Member Functions inherited from UsdAPISchemaBase
 UsdAPISchemaBase (const UsdPrim &prim, const TfToken &instanceName)
 Construct a multiple-apply UsdAPISchemaBase on UsdPrim prim with the specified instanceName. More...
 
 UsdAPISchemaBase (const UsdSchemaBase &schemaObj, const TfToken &instanceName)
 Construct a multiple-apply UsdAPISchemaBase on the prim held by schemaObj with the given instanceName. More...
 
const TfToken_GetInstanceName () const
 Returns the instance name of the API schema object belonging to a multiple-apply API schema. More...
 
USD_API bool _IsCompatible () const override
 Check whether this APISchema object is valid for the currently held. More...
 
- 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
 

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() [1/2]

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() [2/2]

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.

◆ ~UsdGeomVisibilityAPI()

virtual USDGEOM_API ~UsdGeomVisibilityAPI ( )
virtual

Destructor.

Member Function Documentation

◆ _GetSchemaKind()

USDGEOM_API UsdSchemaKind _GetSchemaKind ( ) const
overrideprotectedvirtual

Returns the kind of schema this class belongs to.

See also
UsdSchemaKind

Reimplemented from UsdAPISchemaBase.

◆ Apply()

static USDGEOM_API 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()

◆ CanApply()

static USDGEOM_API bool 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()

◆ CreateGuideVisibilityAttr()

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.

◆ CreateProxyVisibilityAttr()

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.

◆ CreateRenderVisibilityAttr()

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.

◆ Get()

static USDGEOM_API 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));

◆ GetGuideVisibilityAttr()

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

◆ GetProxyVisibilityAttr()

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

◆ GetRenderVisibilityAttr()

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

◆ GetSchemaAttributeNames()

static USDGEOM_API const TfTokenVector& 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.

Member Data Documentation

◆ schemaKind

const UsdSchemaKind 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: