usdrt::UsdAPISchemaBase
Defined in usdrt/scenegraph/usd/usd/apiSchemaBase.h
Functions
usdrt::DestructionSchemaDestructibleBaseAPI::GetPath: Return the SdfPath to this schema object's held prim.
usdrt::DestructionSchemaDestructibleBaseAPI::GetPrim: Return this schema object's held prim.
usdrt::UsdAPISchemaBase::UsdAPISchemaBase: Construct a UsdAPISchemaBase on UsdPrim
prim
. Equivalent to UsdAPISchemaBase::Get(prim.GetStage(), prim.GetPath()) for a validprim
, but will not immediately throw an error for an invalidprim
.usdrt::UsdAPISchemaBase::UsdAPISchemaBase: Construct a multiple-apply UsdAPISchemaBase on the prim held by
schemaObj
with the giveninstanceName
.usdrt::UsdAPISchemaBase::UsdAPISchemaBase: Construct a multiple-apply UsdAPISchemaBase on UsdPrim
prim
with the specifiedinstanceName
.usdrt::UsdAPISchemaBase::UsdAPISchemaBase: Construct a UsdAPISchemaBase on the prim held by
schemaObj
. Should be preferred over UsdAPISchemaBase (schemaObj.GetPrim()), as it preserves SchemaBase state.usdrt::DestructionSchemaDestructibleBaseAPI::_GetInstanceName: Returns the instance name of the API schema object belonging to a multiple-apply API schema.
usdrt::UsdAPISchemaBase::operator bool: Boolean operator.
usdrt::UsdAPISchemaBase::~UsdAPISchemaBase: Destructor.
Variables
usdrt::UsdAPISchemaBase::schemaType: Compile time constant representing what kind of schema this class is.
-
class UsdAPISchemaBase : public usdrt::UsdSchemaBase
The base class for all API schemas.
An API schema provides an interface to a prim’s qualities, but does not specify a typeName for the underlying prim. The prim’s qualities include its inheritance structure, attributes, relationships etc. Since it cannot provide a typeName, an API schema is considered to be non-concrete.
To auto-generate an API schema using usdGenSchema, simply leave the typeName empty and make it inherit from “/APISchemaBase” or from another API schema. See UsdModelAPI, UsdClipsAPI and UsdCollectionAPI for examples.
API schemas are classified into applied and non-applied API schemas. The author of an API schema has to decide on the type of API schema at the time of its creation by setting customData[‘apiSchemaType’] in the schema definition (i.e. in the associated primSpec inside the schema.usda file). UsdAPISchemaBase implements methods that are used to record the application of an API schema on a USD prim.
If an API schema only provides an interface to set certain core bits of metadata (like UsdModelAPI, which sets model kind and UsdClipsAPI, which sets clips-related metadata) OR if the API schema can apply to any type of prim or only to a known fixed set of prim types OR if there is no use of recording the application of the API schema, in such cases, it would be better to make it a non-applied API schema. Examples of non-applied API schemas include UsdModelAPI, UsdClipsAPI, UsdShadeConnectableAPI and UsdGeomPrimvarsAPI.
If there is a need to discover (or record) whether a prim contains or subscribes to a given API schema, it would be advantageous to make the API schema be “applied”. In general, API schemas that add one or more properties to a prim should be tagged as applied API schemas. A public Apply() method is generated for applied API schemas by usdGenSchema. An applied API schema must be applied to a prim via a call to the generated Apply() method, for the schema object to evaluate to true when converted to a bool using the explicit bool conversion operator. Examples of applied API schemas include UsdCollectionAPI, UsdGeomModelAPI and UsdGeomMotionAPI
Subclassed by usdrt::DestructionSchemaDestructibleBaseAPI, usdrt::DestructionSchemaDestructibleBondAPI, usdrt::DestructionSchemaDestructibleChunkAPI, usdrt::DestructionSchemaDestructibleInstAPI, usdrt::ForceFieldSchemaPhysxForceFieldAPI, usdrt::ForceFieldSchemaPhysxForceFieldConicalAPI, usdrt::ForceFieldSchemaPhysxForceFieldDragAPI, usdrt::ForceFieldSchemaPhysxForceFieldLinearAPI, usdrt::ForceFieldSchemaPhysxForceFieldNoiseAPI, usdrt::ForceFieldSchemaPhysxForceFieldPlanarAPI, usdrt::ForceFieldSchemaPhysxForceFieldRingAPI, usdrt::ForceFieldSchemaPhysxForceFieldSphericalAPI, usdrt::ForceFieldSchemaPhysxForceFieldSpinAPI, usdrt::ForceFieldSchemaPhysxForceFieldWindAPI, usdrt::PhysxSchemaJointStateAPI, usdrt::PhysxSchemaPhysxArticulationAPI, usdrt::PhysxSchemaPhysxArticulationForceSensorAPI, usdrt::PhysxSchemaPhysxAutoAttachmentAPI, usdrt::PhysxSchemaPhysxAutoParticleClothAPI, usdrt::PhysxSchemaPhysxCameraAPI, usdrt::PhysxSchemaPhysxCameraDroneAPI, usdrt::PhysxSchemaPhysxCameraFollowAPI, usdrt::PhysxSchemaPhysxCameraFollowLookAPI, usdrt::PhysxSchemaPhysxCameraFollowVelocityAPI, usdrt::PhysxSchemaPhysxCharacterControllerAPI, usdrt::PhysxSchemaPhysxCollisionAPI, usdrt::PhysxSchemaPhysxContactReportAPI, usdrt::PhysxSchemaPhysxConvexDecompositionCollisionAPI, usdrt::PhysxSchemaPhysxConvexHullCollisionAPI, usdrt::PhysxSchemaPhysxCookedDataAPI, usdrt::PhysxSchemaPhysxDeformableAPI, usdrt::PhysxSchemaPhysxDeformableBodyAPI, usdrt::PhysxSchemaPhysxDeformableBodyMaterialAPI, usdrt::PhysxSchemaPhysxDeformableSurfaceAPI, usdrt::PhysxSchemaPhysxDeformableSurfaceMaterialAPI, usdrt::PhysxSchemaPhysxDiffuseParticlesAPI, usdrt::PhysxSchemaPhysxForceAPI, usdrt::PhysxSchemaPhysxHairAPI, usdrt::PhysxSchemaPhysxHairMaterialAPI, usdrt::PhysxSchemaPhysxJointAPI, usdrt::PhysxSchemaPhysxLimitAPI, usdrt::PhysxSchemaPhysxMaterialAPI, usdrt::PhysxSchemaPhysxPBDMaterialAPI, usdrt::PhysxSchemaPhysxParticleAPI, usdrt::PhysxSchemaPhysxParticleAnisotropyAPI, usdrt::PhysxSchemaPhysxParticleClothAPI, usdrt::PhysxSchemaPhysxParticleIsosurfaceAPI, usdrt::PhysxSchemaPhysxParticleSamplingAPI, usdrt::PhysxSchemaPhysxParticleSetAPI, usdrt::PhysxSchemaPhysxParticleSmoothingAPI, usdrt::PhysxSchemaPhysxPhysicsDistanceJointAPI, usdrt::PhysxSchemaPhysxRigidBodyAPI, usdrt::PhysxSchemaPhysxSDFMeshCollisionAPI, usdrt::PhysxSchemaPhysxSceneAPI, usdrt::PhysxSchemaPhysxSphereFillCollisionAPI, usdrt::PhysxSchemaPhysxTendonAttachmentAPI, usdrt::PhysxSchemaPhysxTendonAttachmentLeafAPI, usdrt::PhysxSchemaPhysxTendonAttachmentRootAPI, usdrt::PhysxSchemaPhysxTendonAxisAPI, usdrt::PhysxSchemaPhysxTendonAxisRootAPI, usdrt::PhysxSchemaPhysxTriangleMeshCollisionAPI, usdrt::PhysxSchemaPhysxTriangleMeshSimplificationCollisionAPI, usdrt::PhysxSchemaPhysxTriggerAPI, usdrt::PhysxSchemaPhysxTriggerStateAPI, usdrt::PhysxSchemaPhysxVehicleAPI, usdrt::PhysxSchemaPhysxVehicleAckermannSteeringAPI, usdrt::PhysxSchemaPhysxVehicleAutoGearBoxAPI, usdrt::PhysxSchemaPhysxVehicleBrakesAPI, usdrt::PhysxSchemaPhysxVehicleClutchAPI, usdrt::PhysxSchemaPhysxVehicleContextAPI, usdrt::PhysxSchemaPhysxVehicleControllerAPI, usdrt::PhysxSchemaPhysxVehicleDriveBasicAPI, usdrt::PhysxSchemaPhysxVehicleDriveStandardAPI, usdrt::PhysxSchemaPhysxVehicleEngineAPI, usdrt::PhysxSchemaPhysxVehicleGearsAPI, usdrt::PhysxSchemaPhysxVehicleMultiWheelDifferentialAPI, usdrt::PhysxSchemaPhysxVehicleSteeringAPI, usdrt::PhysxSchemaPhysxVehicleSuspensionAPI, usdrt::PhysxSchemaPhysxVehicleSuspensionComplianceAPI, usdrt::PhysxSchemaPhysxVehicleTankControllerAPI, usdrt::PhysxSchemaPhysxVehicleTankDifferentialAPI, usdrt::PhysxSchemaPhysxVehicleTireAPI, usdrt::PhysxSchemaPhysxVehicleWheelAPI, usdrt::PhysxSchemaPhysxVehicleWheelAttachmentAPI, usdrt::PhysxSchemaPhysxVehicleWheelControllerAPI, usdrt::UsdClipsAPI, usdrt::UsdCollectionAPI, usdrt::UsdGeomModelAPI, usdrt::UsdGeomMotionAPI, usdrt::UsdGeomPrimvarsAPI, usdrt::UsdGeomVisibilityAPI, usdrt::UsdGeomXformCommonAPI, usdrt::UsdLuxLightAPI, usdrt::UsdLuxLightListAPI, usdrt::UsdLuxListAPI, usdrt::UsdLuxMeshLightAPI, usdrt::UsdLuxShadowAPI, usdrt::UsdLuxShapingAPI, usdrt::UsdLuxVolumeLightAPI, usdrt::UsdModelAPI, usdrt::UsdPhysicsArticulationRootAPI, usdrt::UsdPhysicsCollisionAPI, usdrt::UsdPhysicsDriveAPI, usdrt::UsdPhysicsFilteredPairsAPI, usdrt::UsdPhysicsLimitAPI, usdrt::UsdPhysicsMassAPI, usdrt::UsdPhysicsMaterialAPI, usdrt::UsdPhysicsMeshCollisionAPI, usdrt::UsdPhysicsRigidBodyAPI, usdrt::UsdRenderSettingsAPI, usdrt::UsdShadeConnectableAPI, usdrt::UsdShadeCoordSysAPI, usdrt::UsdShadeMaterialBindingAPI, usdrt::UsdShadeNodeDefAPI, usdrt::UsdSkelBindingAPI, usdrt::UsdUINodeGraphNodeAPI, usdrt::UsdUISceneGraphPrimAPI
Single vs. Multiple Apply API Schemas
Applied API schemas can further be classified into single-apply and multiple-apply API schemas. As the name suggests, a single-apply API schema can only be applied once to a prim. A multiple-apply API schema can be applied multiple times with different ‘instanceName’ values. An example of a multiple-apply API schema is UsdCollectionAPI, where the API schema is applied to a prim once for every collection owned by the prim.
Note
An applied API schema can only inherit from another applied API schema or directly from APISchemaBase. Similarly, a non-applied API schema can only inherit from a non-applied API Schema or directly from APISchemaBase. ‘usdGenSchema’ attempts to issue a warning if it detects an incompatibility.
Note
A multiple-apply API schema may not inherit from a single-apply API schema and vice versa.
Note
When the bool-conversion operator is invoked on an applied API schema, it evaluates to true only if the application of the API schema has been recorded on the prim via a call to the auto-generated Apply() method.
-
inline operator bool() const
Boolean operator.
- Returns
Return true if the contained prim is an instance of this schema using
IsA
, and false otherwise.
Public Functions
-
inline explicit UsdAPISchemaBase(const UsdPrim &prim = UsdPrim())
Construct a UsdAPISchemaBase on UsdPrim
prim
. Equivalent to UsdAPISchemaBase::Get(prim.GetStage(), prim.GetPath()) for a validprim
, but will not immediately throw an error for an invalidprim
.
-
inline explicit UsdAPISchemaBase(const UsdSchemaBase &schemaObj)
Construct a UsdAPISchemaBase on the prim held by
schemaObj
. Should be preferred over UsdAPISchemaBase(schemaObj.GetPrim()), as it preserves SchemaBase state.
-
inline virtual ~UsdAPISchemaBase()
Destructor.
Public Static Attributes
-
static const UsdSchemaType schemaType = UsdSchemaType::AbstractBase
Compile time constant representing what kind of schema this class is.
See also
UsdSchemaType
Protected Functions
-
inline explicit UsdAPISchemaBase(const UsdPrim &prim, const TfToken &instanceName)
Construct a multiple-apply UsdAPISchemaBase on UsdPrim
prim
with the specifiedinstanceName
.
-
inline explicit UsdAPISchemaBase(const UsdSchemaBase &schemaObj, const TfToken &instanceName)
Construct a multiple-apply UsdAPISchemaBase on the prim held by
schemaObj
with the giveninstanceName
.
-
inline operator bool() const