HDK
|
#include <modelAPI.h>
Public Member Functions | |
UsdModelAPI (const UsdPrim &prim=UsdPrim()) | |
UsdModelAPI (const UsdSchemaBase &schemaObj) | |
virtual USD_API | ~UsdModelAPI () |
Destructor. More... | |
Model Asset Info API | |
USD_API bool | GetAssetIdentifier (SdfAssetPath *identifier) const |
USD_API void | SetAssetIdentifier (const SdfAssetPath &identifier) const |
USD_API bool | GetAssetName (std::string *assetName) const |
USD_API void | SetAssetName (const std::string &assetName) const |
USD_API bool | GetAssetVersion (std::string *version) const |
USD_API void | SetAssetVersion (const std::string &version) const |
USD_API bool | GetPayloadAssetDependencies (VtArray< SdfAssetPath > *assetDeps) const |
USD_API void | SetPayloadAssetDependencies (const VtArray< SdfAssetPath > &assetDeps) const |
USD_API bool | GetAssetInfo (VtDictionary *info) const |
USD_API void | SetAssetInfo (const VtDictionary &info) 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 UsdPrimDefinition * | GetSchemaClassPrimDefinition () const |
Static Public Member Functions | |
static USD_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
static USD_API UsdModelAPI | Get (const UsdStagePtr &stage, const SdfPath &path) |
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 TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Static Public Attributes | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::NonAppliedAPI |
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 | |
USD_API UsdSchemaKind | _GetSchemaKind () const override |
template<typename T > | |
bool | _GetAssetInfoByKey (const TfToken &key, T *val) const |
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 |
Kind and Model-ness | |
enum | KindValidation { KindValidationNone, KindValidationModelHierarchy } |
USD_API bool | GetKind (TfToken *kind) const |
USD_API bool | SetKind (const TfToken &kind) const |
USD_API bool | IsKind (const TfToken &baseKind, KindValidation validation=KindValidationModelHierarchy) const |
USD_API bool | IsModel () const |
USD_API bool | IsGroup () const |
Additional Inherited Members | |
Static Protected Member Functions inherited from UsdAPISchemaBase | |
static USD_API TfTokenVector | _GetMultipleApplyInstanceNames (const UsdPrim &prim, const TfType &schemaType) |
UsdModelAPI is an API schema that provides an interface to a prim's model qualities, if it does, in fact, represent the root prim of a model.
The first and foremost model quality is its kind, i.e. the metadata that establishes it as a model (See KindRegistry). UsdModelAPI provides various methods for setting and querying the prim's kind, as well as queries (also available on UsdPrim) for asking what category of model the prim is. See Kind and Model-ness.
UsdModelAPI also provides access to a prim's assetInfo data. While any prim can host assetInfo, it is common that published (referenced) assets are packaged as models, therefore it is convenient to provide access to the one from the other.
establish an _IsCompatible() override that returns IsModel()
GetModelInstanceName()
Definition at line 72 of file modelAPI.h.
Option for validating queries to a prim's kind metadata.
Enumerator | |
---|---|
KindValidationNone | |
KindValidationModelHierarchy |
Definition at line 161 of file modelAPI.h.
Construct a UsdModelAPI on UsdPrim prim
. Equivalent to UsdModelAPI::Get(prim.GetStage(), prim.GetPath()) for a valid prim
, but will not immediately throw an error for an invalid prim
Definition at line 84 of file modelAPI.h.
|
inlineexplicit |
Construct a UsdModelAPI on the prim held by schemaObj
. Should be preferred over UsdModelAPI(schemaObj.GetPrim()), as it preserves SchemaBase state.
Definition at line 92 of file modelAPI.h.
|
virtual |
Destructor.
|
inlineprotected |
Definition at line 314 of file modelAPI.h.
|
overrideprotectedvirtual |
Returns the kind of schema this class belongs to.
Reimplemented from UsdAPISchemaBase.
|
static |
Return a UsdModelAPI 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:
USD_API bool UsdModelAPI::GetAssetIdentifier | ( | SdfAssetPath * | identifier | ) | const |
Returns the model's asset identifier as authored in the composed assetInfo dictionary.
The asset identifier can be used to resolve the model's root layer via the asset resolver plugin.
USD_API bool UsdModelAPI::GetAssetInfo | ( | VtDictionary * | info | ) | const |
Returns the model's composed assetInfo dictionary.
The asset info dictionary is used to annotate models with various data related to asset management. For example, asset name, identifier, version etc.
The elements of this dictionary are composed element-wise, and are nestable.
USD_API bool UsdModelAPI::GetAssetName | ( | std::string * | assetName | ) | const |
Returns the model's asset name from the composed assetInfo dictionary.
The asset name is the name of the asset, as would be used in a database query.
USD_API bool UsdModelAPI::GetAssetVersion | ( | std::string * | version | ) | const |
Returns the model's resolved asset version.
If you publish assets with an embedded version, then you may receive that version string. You may, however, cause your authoring tools to record the resolved version at the time at which a reference to the asset was added to an aggregate, at the referencing site. In such a pipeline, this API will always return that stronger opinion, even if the asset is republished with a newer version, and even though that newer version may be the one that is resolved when the UsdStage is opened.
Retrieve the authored kind
for this prim.
USD_API bool UsdModelAPI::GetPayloadAssetDependencies | ( | VtArray< SdfAssetPath > * | assetDeps | ) | const |
Returns the list of asset dependencies referenced inside the payload of the model.
This typically contains identifiers of external assets that are referenced inside the model's payload. When the model is created, this list is compiled and set at the root of the model. This enables efficient dependency analysis without the need to include the model's payload.
|
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.
USD_API bool UsdModelAPI::IsGroup | ( | ) | const |
Return true if this prim represents a model group, based on its kind metadata.
USD_API bool UsdModelAPI::IsKind | ( | const TfToken & | baseKind, |
KindValidation | validation = KindValidationModelHierarchy |
||
) | const |
Return true if the prim's kind metadata is or inherits from baseKind
as defined by the Kind Registry.
If validation
is KindValidationModelHierarchy (the default), then this also ensures that if baseKind is a model, the prim conforms to the rules of model hierarchy, as defined by IsModel. If set to KindValidationNone, no additional validation is done.
IsModel and IsGroup are preferrable to IsKind("model") as they are optimized for fast traversal.
USD_API bool UsdModelAPI::IsModel | ( | ) | const |
Return true if this prim represents a model, based on its kind metadata.
USD_API void UsdModelAPI::SetAssetIdentifier | ( | const SdfAssetPath & | identifier | ) | const |
Sets the model's asset identifier to the given asset path, identifier
.
USD_API void UsdModelAPI::SetAssetInfo | ( | const VtDictionary & | info | ) | const |
Sets the model's assetInfo dictionary to info
in the current edit target.
USD_API void UsdModelAPI::SetAssetName | ( | const std::string & | assetName | ) | const |
Sets the model's asset name to assetName
.
USD_API void UsdModelAPI::SetAssetVersion | ( | const std::string & | version | ) | const |
Sets the model's asset version string.
Author a kind
for this prim, at the current UsdEditTarget.
kind
was successully authored, otherwise false.USD_API void UsdModelAPI::SetPayloadAssetDependencies | ( | const VtArray< SdfAssetPath > & | assetDeps | ) | const |
Sets the list of external asset dependencies referenced inside the payload of a model.
|
friend |
Definition at line 131 of file modelAPI.h.
|
static |
Compile time constant representing what kind of schema this class is.
Definition at line 78 of file modelAPI.h.