UsdPrim#
Fully qualified name: usdrt::UsdPrim
- 
class UsdPrim#
- A UsdPrim is the principal container of other types of scene description. It provides API for accessing and creating all of the contained kinds of scene description. - Public Functions - 
bool HasAttribute(const TfToken &name) const#
- Check if this prim has an attribute named - namein Fabric. Does not check for attribute existence in the underlying USD stage.- Parameters:
- name – The attribute name. 
- Returns:
- Return true if the attribute exists on this prim, and false otherwise. 
 
 - 
UsdAttribute GetAttribute(const TfToken &name) const#
- Get the attribute named - nameif it exists in fabric. Does not check for attribute existence in the underlying USD stage.- Parameters:
- name – The attribute name. 
- Returns:
- Return the attribute on this prim with name - name, or an invalid attribute object if not found.
 
 - 
std::vector<UsdAttribute> GetAttributes() const#
- Get all attributes on this prim. - Note - Current implementation only returns attributes that exist in Fabric - Returns:
- Return a vector of attributes that are on the prim. 
 
 - 
std::vector<UsdAttribute> GetAuthoredAttributes() const#
- Get all authored attributes on this prim. - Returns:
- Return a vector of attributes that are authored on the prim. 
 
 - UsdAttribute CreateAttribute(
- const TfToken &name,
- const SdfValueTypeName &typeName,
- bool custom = true,
- Create a new attribute on this prim in fabric. - TODO: SdfVariability parameter - Parameters:
- name – The attribute name. 
- typeName – The type of the attribute. 
- custom – Indicate if the attribute is custom. Default is true. This currently does nothing as it is not represented in fabric. 
 
- Returns:
- Return the new attribute. 
 
 
 - 
bool HasRelationship(const TfToken &name) const#
- Check if this prim has a relationship named - name. Fabric is the ground truth for existence, so there is no USD fallback.- Parameters:
- name – The relationship name. 
- Returns:
- Return true if the relationship exists on this prim, and false otherwise. 
 
 - 
UsdRelationship GetRelationship(const TfToken &name) const#
- Get the relationship named - nameif it exists.- Note - Fabric does not yet support lists of targets for relationships. - Parameters:
- name – The relationship name. 
- Returns:
- Return the relationship on this prim with name - name, or an invalid relationship object if not found.
 
 - 
std::vector<UsdRelationship> GetRelationships() const#
- Get all relationships on this prim. - Note - Fabric does not yet support lists of targets for relationships. - Returns:
- Return a vector of relationship that are on the prim. 
 
 - 
std::vector<UsdRelationship> GetAuthoredRelationships() const#
- Get all authored relationships on this prim. - Note - Fabric does not yet support lists of targets for relationships. - Returns:
- Return a vector of relationships that are authored on the prim. 
 
 - UsdRelationship CreateRelationship(
- const TfToken &relName,
- bool custom = true,
- Create a new relationship on this prim in fabric. - Parameters:
- relName – The relationship name. 
- custom – Indicate if the relationship is custom. Default is true. This currently does nothing as it is not represented in fabric. 
 
- Returns:
- Return the new relationship. 
 
 
 - 
bool RemoveProperty(const TfToken &name) const#
- Remove property from this prim in fabric. - Parameters:
- name – Name of the property to remove. 
- Returns:
- Return true if the property was removed, and false otherwise. 
 
 - 
TfTokenVector GetPropertyNames() const#
- Get all of this prim’s properties (attributes and relationships). Includes build in properties. - Returns:
- Return a TfTokenVector of property names. 
 
 - 
TfTokenVector GetAuthoredPropertyNames() const#
- Get all of this prim’s properties (attributes and relationships). Includes build in properties. - Note: Fabric doesn’t differientiate between authored properties, so this API is here for completeness but is the exact same as GetPropertyNames. - Returns:
- Return a TfTokenVector of property names. 
 
 - 
bool HasProperty(const TfToken &name) const#
- Check if the prim has property - name.- Parameters:
- name – Property name 
- Returns:
- True if this prim has property - name.
 
 - 
bool IsValid() const#
- Check if this is a valid prim. A prim is valid if it exists in fabric. This includes minimally populated prims. - Returns:
- Return true if this prim is valid, and false otherwise. 
 
 - 
UsdStageRefPtr GetStage() const#
- Get the fabric stage holding this UsdPrim. - Returns:
- Return a pointer to the fabric stage that contains this prim. 
 
 - 
UsdPrim GetPrim() const#
- UsdObject method required for UsdPrim to be a complete type. - Returns:
- Return this prim. 
 
 - 
const SdfPath GetPrimPath() const#
- Get the path to this prim. - Returns:
- Returns the path to this prim. 
 
 - UsdPrim GetChild(
- const TfToken &name,
- bool prefetchFromUsd = true,
- Get child prim - namefrom this prim’s children by optionally prefetching it from USD.- Parameters:
- name – The name of the child to look for. 
- prefetchFromUsd – Is prefetching from USD necessary. 
 
- Returns:
- Return the child prim, or an invalid prim if not found. 
 
 
 - 
std::vector<UsdPrim> GetChildren(bool prefetchFromUsd = true) const#
- Get child prims of this prim by optionally prefetching them from USD. If fabric population / hierarchy is active, get child prims using the fabric Connectivity API. Otherwise, fall back to - GetChildrenin USD and load the prims into fabric.- Parameters:
- prefetchFromUsd – Is prefetching from USD necessary. 
- Returns:
- Return a vector containing all child prims of this prim. 
 
 - 
TfTokenVector GetChildrenNames(bool prefetchFromUsd = true) const#
- Get list of child prim names when iterating over GetChildren, by optionally prefetching them from USD. - Parameters:
- prefetchFromUsd – Is prefetching from USD necessary. 
- Returns:
- TfTokenVector of child names. 
 
 - std::vector<UsdPrim> GetAllChildren(
- bool prefetchFromUsd = true,
- Get all child prims of this prim by optionally prefetching them from USD. If fabric population / hierarchy is active, get child prims using the fabric Connectivity API. Otherwise, fall back to - GetChildrenUSD and load the prims into fabric.- Note - This differs from USD functionality. Same as GetChildren. - Parameters:
- prefetchFromUsd – Is prefetching from USD necessary. 
- Returns:
- Return a vector containing all child prims of this prim. 
 
 
 - 
TfTokenVector GetAllChildrenNames(bool prefetchFromUsd = true) const#
- Get list of child prim names when iterating over GetAllChildren, by optionally prefetching them from USD. - Parameters:
- prefetchFromUsd – Is prefetching from USD necessary. 
- Returns:
- TfTokenVector of child names. 
 
 - 
UsdPrim GetParent(bool prefetchFromUsd = true) const#
- Get this prim’s parent prim by optionally prefetching it from USD. - Parameters:
- prefetchFromUsd – Is prefetching from USD necessary. 
- Returns:
- Return this prim’s parent prim by optionally prefetching it from USD. 
 
 - 
UsdPrim GetNextSibling(bool prefetchFromUsd = true) const#
- Get this prim’s next sibling in the scene hierarchy by optionally prefetching it from USD. If population is active, get next sibling using Connectivity. Otherwise fall back to USD. - Parameters:
- prefetchFromUsd – Is prefetching from USD necessary. 
- Returns:
- Return this prim’s next sibling if it has one. Otherwise return an invalid prim. 
 
 - 
TfToken GetTypeName() const#
- Get the type name for this prim. This looks for the attribute of type SdfValueTypeNames->PrimTypeTag in fabric. - Returns:
- Return the prim type name. 
 
 - 
bool SetTypeName(const TfToken &typeName) const#
- Set this prim’s type name. This clears any existing type name and sets the attribute SdfValueTypeNames->PrimTypeTag in fabric to - typeName.- Parameters:
- typeName – Prim’s new type name to set. 
- Returns:
- Return true if this prim’s type name has been updated. False otherwise. 
 
 - 
bool ClearTypeName() const#
- Clear this prim’s typename. This removes the attribute of type SdfValueTypeNames->PrimTypeTag from fabric. - Returns:
- Return true if this prim’s type name has been cleared. False otherwise. 
 
 - 
bool HasAuthoredTypeName() const#
- Check if this prim has an authored typename. True if an attribute of type SdfValueTypeNames->PrimTypeTag has a value authored. - Returns:
- Return true if this prim’s typename tag is authored, false otherwise. 
 
 - 
template<typename SchemaType>
 inline bool IsA() const#
- Query if this prim’s type is or is a child type of - SchemaType. An error will be issued if- SchemaTypeis an unknown schema.- Template Parameters:
- SchemaType – The schema type name or alias type. 
- Returns:
- Return true if this prim is or is a child type of - SchemaType.
 
 - 
bool IsA(const TfToken &schemaType) const#
- Query if this prim’s type is or is a child type of - SchemaType. An error will be issued if the- schemaTypeis an unknown schema.- Parameters:
- schemaType – The schema c++ type. 
- Returns:
- Return true if this prim is or is a child type of - SchemaType.
 
 - 
bool AddAppliedSchema(const TfToken &appliedSchemaName) const#
- Apply schema of type - appliedSchemaName. This authors an attribute of type SdfValueTypeNames->AppliedSchemaTypeTag with value- appliedSchemaName. This method assumes:- input validation (if desired) has already been done by other API methods (UsdPrim::ApplyAPI). 
- the - appliedSchemaNameis the schema alias. For example:- MotionAPIinstead of- UsdGeomMotionAPI. This is required for Fabric.
- for multiple-apply schemas, - appliedSchemaNamecontains both the namespace and instance name. For example: ‘CollectionAPI:myStuff’.
 - ApplyAPIis the preferred method for applying valid API schemas. Using- ApplyAPIinstead will convert schema names to alias and join namespace/instance names.- See also - Parameters:
- appliedSchemaName – The full name or alias of the schema to apply. 
- Returns:
- Return true if the schema has been applied, false otherwise. 
 
 - 
bool RemoveAppliedSchema(const TfToken &appliedSchemaName) const#
- Remove schema of type - appliedSchemaName. This removes the attribute of type SdfValueTypeNames->AppliedSchemaTypeTag with value- appliedSchemaName. This method assumes:- input validation has already been done by other API methods (UsdPrim::RemoveAPI). 
- the - appliedSchemaNameis the schema alias. For example:- MotionAPIinstead of- UsdGeomMotionAPI. This is required for Fabric.
- for multiple-apply schemas, - appliedSchemaNamecontains both the namespace and instance name. For example: ‘CollectionAPI:myStuff’.
 - RemoveAPIis the preferred method for applying valid API schemas. Using- RemoveAPIinstead will convert schema names to alias and join namespace/instance names.- See also - Parameters:
- appliedSchemaName – The full name or alias of the schema to remove. 
- Returns:
- Return true if the schema has been removed, false otherwise. 
 
 - bool HasAPI( ) const#
- Check is this prim has a schema - schemaIdentifierapplied. Looks for an authored attribute of type SdfValueTypeNames->AppliedSchemaTypeTag and value- schemaIdentifier. For MultipleApplyAPI schemas, the query value is- schemaIdentifieras the namespace, joined with- instanceName.- Parameters:
- schemaIdentifier – The full name or alias of the schema to check. 
- instanceName – If non-empy, used to determine if a particular instance of a multiple-apply api schema has been applied to the prim if - SchemaTypeis a multiple-apply api schema. Default empty.
 
- Returns:
- Return true if the schema is applied to this prim, false otherwise. 
 
 
 - 
template<typename SchemaType>
 inline bool HasAPI( 
) const#
- Check is this prim has a schema of type - SchemaTypeapplied. Looks for an authored attribute of type SdfValueTypeNames->AppliedSchemaTypeTag and value- SchemaType.- An error will be issued if - SchemaTypedoes not a known applied API schema, or if, for a miltiple-apply API schema,- instanceNameis empty.- Template Parameters:
- SchemaType – The schema type to check. 
- Parameters:
- instanceName – If non-empy, used to determine if a particular instance of a multiple-apply api schema has been applied to the prim if - SchemaTypeis a multiple-apply api schema. Default empty.
- Returns:
- Return true if the schema is applied to this prim, false otherwise. 
 
 
 - bool ApplyAPI( ) const#
- Apply schema of type - schemaIdentifierto the prim.- For - schemaIdentifierto be valid schema to apply, it must be a single-apply or multiple-apply api schema, and for multiple-apply,- instanceNamemust not be empty.- See also - Parameters:
- schemaIdentifier – The full name or alias of the schema to apply. 
- instanceName – If non-empy, used to determine if a particular instance of a multiple-apply api schema has been applied to the prim if - SchemaTypeis a multiple-apply api schema. Default empty.
 
- Returns:
- Return true if the schema has been applied, false otherwise. 
 
 
 - 
template<typename SchemaType>
 inline bool ApplyAPI() const#
- Apply schema of type - SchemaTypeto the prim.- An error is raised for invalid - SchemaType. For- SchemaTypeto be valid schema to apply using this template, it must be a single-apply API schema.- See also - Template Parameters:
- SchemaType – The schema type to apply. 
- Returns:
- Return true if the schema has been applied, false otherwise. 
 
 - 
template<typename SchemaType>
 inline bool ApplyAPI(
- const TfToken &instanceName,
- Apply schema of type - SchemaTypeto the prim.- An error is raised for invalid - SchemaType. For- SchemaTypeto be valid schema to apply using this template, it must be a multiple-apply api schema and instanceName must not be empty.- See also - Template Parameters:
- SchemaType – The schema type to apply. 
- Parameters:
- instanceName – If non-empy, used to determine if a particular instance of a multiple-apply api schema has been applied to the prim if - SchemaTypeis a multiple-apply api schema.
- Returns:
- Return true if the schema has been applied, false otherwise. 
 
 
 - bool RemoveAPI( ) const#
- Remove schema of type - schemaIdentifier.- Parameters:
- schemaIdentifier – The full name or alias of the schema to remove. 
- instanceName – If non-empy, used to remove a particular instance of a multiple-apply api schema from the prim if - SchemaTypeis a multiple-apply api schema. Default empty.
 
- Returns:
- Return true if the schema has been removed, false otherwise. 
 
 
 - 
template<typename SchemaType>
 inline bool RemoveAPI() const#
- Remove single-apply API schema of type - SchemaType.- An error is raised for invalid - SchemaType. For- SchemaTypeto be valid schema to remove using this template, it must be a single apply-api schema.- See also - Template Parameters:
- SchemaType – The schema type to remove. 
- Returns:
- Return true if the schema has been removed, false otherwise. 
 
 - 
template<typename SchemaType>
 inline bool RemoveAPI(
- const TfToken &instanceName,
- Remove multiple-apply API schema of type - SchemaType.- An error is raised for invalid - SchemaType. For- SchemaTypeto be valid schema to remove using this template, it must be a multiple-apply api schema and instanceName must not be empty.- See also - Template Parameters:
- SchemaType – The schema type to remove. 
- Parameters:
- instanceName – Used to remove a particular instance of a multiple-apply api schema from the prim. Must not be empty. 
- Returns:
- Return true if the schema has been removed, false otherwise. 
 
 
 - 
TfTokenVector GetAppliedSchemas() const#
- Get all applied schemas. Look for all attributes of type SdfValueTypeNames->AppliedSchemaTypeTag. - Returns:
- Return a vector of applied schema alias names. 
 
 - 
explicit operator bool() const#
- Check if this prim is valid. See UsdPrim::IsValid. - Returns:
- Return true if this prim is valid, and false otherwise. 
 
 
- 
bool HasAttribute(const TfToken &name) const#