UsdShadeCoordSysAPI Class Reference

UsdShadeCoordSysAPI provides a way to designate, name, and discover coordinate systems. More...

+ Inheritance diagram for UsdShadeCoordSysAPI:

Classes

struct  Binding
 A coordinate system binding. More...
 

Public Member Functions

 UsdShadeCoordSysAPI (const UsdPrim &prim=UsdPrim())
 Construct a UsdShadeCoordSysAPI on UsdPrim prim . More...
 
 UsdShadeCoordSysAPI (const UsdSchemaBase &schemaObj)
 Construct a UsdShadeCoordSysAPI on the prim held by schemaObj . More...
 
virtual USDSHADE_API ~UsdShadeCoordSysAPI ()
 Destructor. More...
 
USDSHADE_API bool HasLocalBindings () const
 Returns true if the prim has local coordinate system binding opinions. More...
 
USDSHADE_API std::vector< BindingGetLocalBindings () const
 Get the list of coordinate system bindings local to this prim. More...
 
USDSHADE_API std::vector< BindingFindBindingsWithInheritance () const
 Find the list of coordinate system bindings that apply to this prim, including inherited bindings. More...
 
USDSHADE_API bool Bind (const TfToken &name, const SdfPath &path) const
 Bind the name to the given path. More...
 
USDSHADE_API bool ClearBinding (const TfToken &name, bool removeSpec) const
 Clear the indicated coordinate system binding on this prim from the current edit target. More...
 
USDSHADE_API bool BlockBinding (const TfToken &name) const
 Block the indicated coordinate system binding on this prim by blocking targets on the underlying relationship. More...
 
- Public Member Functions inherited from UsdAPISchemaBase
 UsdAPISchemaBase (const UsdPrim &prim=UsdPrim())
 Construct a UsdAPISchemaBase on UsdPrim prim . More...
 
 UsdAPISchemaBase (const UsdSchemaBase &schemaObj)
 Construct a UsdAPISchemaBase on the prim held by schemaObj . More...
 
virtual USD_API ~UsdAPISchemaBase ()=0
 Destructor. More...
 
- Public Member Functions inherited from UsdSchemaBase
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...
 
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 UsdPrimDefinitionGetSchemaClassPrimDefinition () const
 Return the prim definition associated with this schema instance if one exists, otherwise return null. More...
 

Static Public Member Functions

static USDSHADE_API const TfTokenVectorGetSchemaAttributeNames (bool includeInherited=true)
 Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. More...
 
static USDSHADE_API UsdShadeCoordSysAPI Get (const UsdStagePtr &stage, const SdfPath &path)
 Return a UsdShadeCoordSysAPI holding the prim adhering to this schema at path on stage. More...
 
static USDSHADE_API TfToken GetCoordSysRelationshipName (const std::string &coordSysName)
 Returns the fully namespaced coordinate system relationship name, given the coordinate system name. More...
 
static USDSHADE_API bool CanContainPropertyName (const TfToken &name)
 Test whether a given name contains the "coordSys:" prefix. More...
 
- Static Public Member Functions inherited from UsdAPISchemaBase
static USD_API const TfTokenVectorGetSchemaAttributeNames (bool includeInherited=true)
 Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. More...
 
- Static Public Member Functions inherited from UsdSchemaBase
static const TfTokenVectorGetSchemaAttributeNames (bool includeInherited=true)
 

Static Public Attributes

static const UsdSchemaKind schemaKind = UsdSchemaKind::NonAppliedAPI
 Compile time constant representing what kind of schema this class is. More...
 
- Static Public Attributes inherited from UsdAPISchemaBase
static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractBase
 Compile time constant representing what kind of schema this class is. More...
 
- Static Public Attributes inherited from UsdSchemaBase
static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractBase
 Compile time constant representing what kind of schema this class is. More...
 

Protected Member Functions

USDSHADE_API UsdSchemaKind _GetSchemaKind () const override
 Returns the kind of schema this class belongs to. More...
 
- Protected Member Functions inherited from UsdAPISchemaBase
 UsdAPISchemaBase (const UsdPrim &prim, const TfToken &instanceName)
 Construct a multiple-apply UsdAPISchemaBase on UsdPrim prim with the specified instanceName. More...
 
 UsdAPISchemaBase (const UsdSchemaBase &schemaObj, const TfToken &instanceName)
 Construct a multiple-apply UsdAPISchemaBase on the prim held by schemaObj with the given instanceName. More...
 
const TfToken_GetInstanceName () const
 Returns the instance name of the API schema object belonging to a multiple-apply API schema. More...
 
USD_API bool _IsCompatible () const override
 Check whether this APISchema object is valid for the currently held. More...
 
- 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
 

Detailed Description

UsdShadeCoordSysAPI provides a way to designate, name, and discover coordinate systems.

Coordinate systems are implicitly established by UsdGeomXformable prims, using their local space. That coordinate system may be bound (i.e., named) from another prim. The binding is encoded as a single-target relationship in the "coordSys:" namespace. Coordinate system bindings apply to descendants of the prim where the binding is expressed, but names may be re-bound by descendant prims.

Named coordinate systems are useful in shading workflows. An example is projection paint, which projects a texture from a certain view (the paint coordinate system). Using the paint coordinate frame avoids the need to assign a UV set to the object, and can be a concise way to project paint across a collection of objects with a single shared paint coordinate system.

This is a non-applied API schema.

Definition at line 79 of file coordSysAPI.h.


Class Documentation

◆ UsdShadeCoordSysAPI::Binding

struct UsdShadeCoordSysAPI::Binding

A coordinate system binding.

Binds a name to a coordSysPrim for the bindingPrim (and its descendants, unless overriden).

Definition at line 163 of file coordSysAPI.h.

Class Members
SdfPath bindingRelPath
SdfPath coordSysPrimPath
TfToken name

Constructor & Destructor Documentation

◆ UsdShadeCoordSysAPI() [1/2]

UsdShadeCoordSysAPI ( const UsdPrim prim = UsdPrim())
inlineexplicit

Construct a UsdShadeCoordSysAPI on UsdPrim prim .

Equivalent to UsdShadeCoordSysAPI::Get(prim.GetStage(), prim.GetPath()) for a valid prim, but will not immediately throw an error for an invalid prim

Definition at line 91 of file coordSysAPI.h.

◆ UsdShadeCoordSysAPI() [2/2]

UsdShadeCoordSysAPI ( const UsdSchemaBase schemaObj)
inlineexplicit

Construct a UsdShadeCoordSysAPI on the prim held by schemaObj .

Should be preferred over UsdShadeCoordSysAPI(schemaObj.GetPrim()), as it preserves SchemaBase state.

Definition at line 99 of file coordSysAPI.h.

◆ ~UsdShadeCoordSysAPI()

virtual USDSHADE_API ~UsdShadeCoordSysAPI ( )
virtual

Destructor.

Member Function Documentation

◆ _GetSchemaKind()

USDSHADE_API UsdSchemaKind _GetSchemaKind ( ) const
overrideprotectedvirtual

Returns the kind of schema this class belongs to.

See also
UsdSchemaKind

Reimplemented from UsdAPISchemaBase.

◆ Bind()

USDSHADE_API bool Bind ( const TfToken name,
const SdfPath path 
) const

Bind the name to the given path.

The prim at the given path is expected to be UsdGeomXformable, in order for the binding to be succesfully resolved.

◆ BlockBinding()

USDSHADE_API bool BlockBinding ( const TfToken name) const

Block the indicated coordinate system binding on this prim by blocking targets on the underlying relationship.

◆ CanContainPropertyName()

static USDSHADE_API bool CanContainPropertyName ( const TfToken name)
static

Test whether a given name contains the "coordSys:" prefix.

◆ ClearBinding()

USDSHADE_API bool ClearBinding ( const TfToken name,
bool  removeSpec 
) const

Clear the indicated coordinate system binding on this prim from the current edit target.

Only remove the spec if removeSpec is true (leave the spec to preserve meta-data we may have intentionally authored on the relationship)

◆ FindBindingsWithInheritance()

USDSHADE_API std::vector<Binding> FindBindingsWithInheritance ( ) const

Find the list of coordinate system bindings that apply to this prim, including inherited bindings.

This computation examines this prim and ancestors for the strongest binding for each name. A binding expressed by a child prim supercedes bindings on ancestors.

Note that this API does not validate the prims at the target paths; they may be of incorrect type, or missing entirely.

Binding relationships with no resolved targets are skipped.

◆ Get()

static USDSHADE_API UsdShadeCoordSysAPI Get ( const UsdStagePtr &  stage,
const SdfPath path 
)
static

Return a UsdShadeCoordSysAPI 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:

UsdShadeCoordSysAPI(stage->GetPrimAtPath(path));

◆ GetCoordSysRelationshipName()

static USDSHADE_API TfToken GetCoordSysRelationshipName ( const std::string &  coordSysName)
static

Returns the fully namespaced coordinate system relationship name, given the coordinate system name.

◆ GetLocalBindings()

USDSHADE_API std::vector<Binding> GetLocalBindings ( ) const

Get the list of coordinate system bindings local to this prim.

This does not process inherited bindings. It does not validate that a prim exists at the indicated path. If the binding relationship has multiple targets, only the first is used.

◆ GetSchemaAttributeNames()

static USDSHADE_API const TfTokenVector& GetSchemaAttributeNames ( bool  includeInherited = true)
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.

◆ HasLocalBindings()

USDSHADE_API bool HasLocalBindings ( ) const

Returns true if the prim has local coordinate system binding opinions.

Note that the resulting binding list may still be empty.

Member Data Documentation

◆ schemaKind

const UsdSchemaKind schemaKind = UsdSchemaKind::NonAppliedAPI
static

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

See also
UsdSchemaKind

Definition at line 85 of file coordSysAPI.h.


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