usdrt::UsdSchemaBase

Defined in usdrt/scenegraph/usd/usd/impl/usd_decl.h

Functions

Variables

class UsdSchemaBase

Base class for all Usd Schemas. Schema objects hold a UsdPrim m_prim and an SdfPath m_primPath and provide an additional layer of specific API.

Create vs Get Property Methods

For a UsdAttribute named “points” defined in a schema class, you will find two access methods in the schema class in C++ and python:

  • GetPointsAttr()

  • CreatePointsAttr()

GetPointsAttr() returns a UsdAttribute and is used in read-only cases.

CreatePointsAttr() returns a UsdAttribute, and also creates it on the prim if it doesn’t exist. There is no change if the attribute already exists.

TODO IsMultipleApplyAPISchema etc

Subclassed by usdrt::UsdAPISchemaBase, usdrt::UsdTyped

Public Functions

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

Construct and store prim as the held prim.

Parameters

prim – The help prim in this schema.

explicit UsdSchemaBase(const UsdSchemaBase &otherSchema)

Construct and store for the same prim held by otherSchema.

Parameters

otherSchema – Other schema to copy.

virtual ~UsdSchemaBase()

Destructor.

explicit operator bool() const

Return true if the held prim is valid.

See also

See UsdPrim::IsValid.

UsdPrim GetPrim() const

Return this schema object’s held prim.

SdfPath GetPath() const

Return the SdfPath to this schema object’s held prim.

Public Static Attributes

static const UsdSchemaType schemaType = UsdSchemaType::AbstractBase

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

See also

See UsdSchemaType in usd/common.h