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

The base class for all schema types in Usd. More...

+ Inheritance diagram for UsdSchemaBase:

Public Member Functions

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...
 
UsdSchemaType GetSchemaType () const
 
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
 Return true if this schema object is compatible with its held prim, false otherwise. More...
 
Held prim access.
UsdPrim GetPrim () const
 Return this schema object's held prim. More...
 
SdfPath GetPath () const
 Shorthand for GetPrim()->GetPath(). More...
 
PrimDefinition access.
USD_API SdfPrimSpecHandle GetSchemaClassPrimDefinition () const
 Return the prim definition associated with this schema instance if one exists, otherwise return null. More...
 

Static Public Member Functions

static const TfTokenVectorGetSchemaAttributeNames (bool includeInherited=true)
 

Static Public Attributes

static const UsdSchemaType schemaType = UsdSchemaType::AbstractBase
 Compile time constant representing what kind of schema this class is. More...
 

Protected Member Functions

virtual UsdSchemaType _GetSchemaType () const
 Returns the type of schema this class is. More...
 
const TfType_GetType () const
 
USD_API UsdAttribute _CreateAttr (TfToken const &attrName, SdfValueTypeName const &typeName, bool custom, SdfVariability variability, VtValue const &defaultValue, bool writeSparsely) const
 
virtual USD_API bool _IsCompatible () const
 Subclasses may override _IsCompatible to do specific compatibility checking with the given prim, such as type compatibility or value compatibility. More...
 

Detailed Description

The base class for all schema types in Usd.

Schema objects hold a UsdPrim internally and provide a layer of specific named API atop the underlying scene graph.

Schema objects are polymorphic but they are intended to be created as automatic local variables, so they may be passed and returned by-value. This leaves them subject to slicing. This means that if one passes a SpecificSchema instance to a function that takes a UsdSchemaBase by-value, all the polymorphic behavior specific to SpecificSchema is lost.

To avoid slicing, it is encouraged that functions taking schema object arguments take them by const & if const access is sufficient, otherwise by non-const pointer.

Definition at line 56 of file schemaBase.h.

Constructor & Destructor Documentation

USD_API UsdSchemaBase ( const UsdPrim prim = UsdPrim())
explicit

Construct and store prim as the held prim.

USD_API UsdSchemaBase ( const UsdSchemaBase otherSchema)
explicit

Construct and store for the same prim held by otherSchema.

virtual USD_API ~UsdSchemaBase ( )
virtual

Destructor.

Member Function Documentation

virtual UsdSchemaType _GetSchemaType ( ) const
inlineprotectedvirtual

Returns the type of schema this class is.

See Also
UsdSchemaBase::schemaType

Reimplemented in UsdGeomPointInstancer, UsdGeomBasisCurves, UsdGeomXformable, UsdCollectionAPI, UsdLuxListAPI, UsdShadeMaterialBindingAPI, UsdGeomModelAPI, UsdShadeMaterial, UsdGeomNurbsPatch, UsdGeomCamera, UsdShadeShader, UsdGeomMesh, UsdGeomSubset, UsdLuxDomeLight, UsdUIBackdrop, UsdClipsAPI, UsdAPISchemaBase, UsdShadeNodeGraph, UsdGeomNurbsCurves, UsdLuxLightFilter, UsdRenderProduct, UsdVolVolume, UsdRenderVar, UsdGeomCone, UsdGeomCylinder, UsdGeomPoints, UsdRiPxrRampLightFilter, UsdSkelBlendShape, UsdGeomCapsule, UsdRenderSettings, UsdSkelRoot, UsdSkelSkeleton, UsdVolField3DAsset, UsdVolOpenVDBAsset, UsdRiPxrBarnLightFilter, UsdRiPxrCookieLightFilter, UsdRiSplineAPI, UsdRiStatementsAPI, UsdSkelAnimation, UsdLuxRectLight, UsdGeomCube, UsdGeomSphere, UsdLuxCylinderLight, UsdRiPxrRodLightFilter, UsdGeomScope, UsdRiMaterialAPI, UsdRiRisObject, UsdRiRisOslPattern, UsdLuxDiskLight, UsdLuxDistantLight, UsdLuxGeometryLight, UsdLuxLightPortal, UsdRiRisBxdf, UsdRiRisPattern, UsdSkelBindingAPI, UsdGeomBoundable, UsdGeomPrimvarsAPI, UsdLuxSphereLight, UsdRiRisIntegrator, UsdKatanaBlindDataObject, UsdGeomXform, UsdRiPxrIntMultLightFilter, UsdSkelPackedJointAnimation, UsdGeomMotionAPI, UsdUINodeGraphNodeAPI, UsdUISceneGraphPrimAPI, UsdShadeConnectableAPI, UsdShadeCoordSysAPI, UsdRiLightFilterAPI, UsdLuxLight, UsdGeomImageable, UsdLuxShadowAPI, UsdRiLightAPI, UsdRiTextureAPI, UsdLuxShapingAPI, UsdRenderSettingsAPI, UsdRiLightPortalAPI, UsdKatanaLookAPI, UsdModelAPI, UsdGeomGprim, UsdRenderSettingsBase, UsdGeomCurves, UsdGeomPointBased, UsdVolFieldAsset, and UsdVolFieldBase.

Definition at line 171 of file schemaBase.h.

virtual USD_API bool _IsCompatible ( ) const
protectedvirtual

Subclasses may override _IsCompatible to do specific compatibility checking with the given prim, such as type compatibility or value compatibility.

This check is performed when clients invoke the explicit bool operator.

Reimplemented in UsdAPISchemaBase, UsdShadeConnectableAPI, UsdGeomXformCommonAPI, and UsdTyped.

SdfPath GetPath ( ) const
inline

Shorthand for GetPrim()->GetPath().

Definition at line 122 of file schemaBase.h.

UsdPrim GetPrim ( ) const
inline

Return this schema object's held prim.

Definition at line 119 of file schemaBase.h.

USD_API SdfPrimSpecHandle GetSchemaClassPrimDefinition ( ) const

Return the prim definition associated with this schema instance if one exists, otherwise return null.

This does not use the held prim's type. To get the held prim instance's definition, use UsdPrim::GetPrimDefinition().

See Also
UsdPrim::GetPrimDefinition()
bool IsAPISchema ( ) const
inline

Returns whether this is an API schema or not.

Definition at line 79 of file schemaBase.h.

bool IsAppliedAPISchema ( ) const
inline

Returns whether this is an applied API schema or not.

If this returns true this class will have an Apply() method

Definition at line 87 of file schemaBase.h.

bool IsConcrete ( ) const
inline

Returns whether or not this class corresponds to a concrete instantiable prim type in scene description.

If this is true, GetStaticPrimDefinition() will return a valid prim definition with a non-empty typeName.

Definition at line 67 of file schemaBase.h.

bool IsMultipleApplyAPISchema ( ) const
inline

Returns whether this is an applied API schema or not.

If this returns true the constructor, Get and Apply methods of this class will take in the name of the API schema instance.

Definition at line 95 of file schemaBase.h.

bool IsTyped ( ) const
inline

Returns whether or not this class inherits from UsdTyped.

Types which inherit from UsdTyped can impart a typename on a UsdPrim.

Definition at line 73 of file schemaBase.h.

USD_API operator bool ( ) const
inlineexplicit

Return true if this schema object is compatible with its held prim, false otherwise.

For untyped schemas return true if the held prim is not expired, otherwise return false. For typed schemas return true if the held prim is not expired and its type is the schema's type or a subtype of the schema's type. Otherwise return false. This method invokes polymorphic behavior.

See Also
UsdSchemaBase::_IsCompatible()

Definition at line 163 of file schemaBase.h.

Member Data Documentation

const UsdSchemaType schemaType = UsdSchemaType::AbstractBase
static

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

See Also
UsdSchemaType in usd/common.h

Definition at line 61 of file schemaBase.h.


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