All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
TfTokenVector
GetSchemaAttributeNames (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
TfTokenVector
GetSchemaAttributeNames (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 prim. 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
 

Additional Inherited Members

- Static Protected Member Functions inherited from UsdAPISchemaBase
template<typename APISchemaType >
static APISchemaType _ApplyAPISchema (const UsdPrim &prim, const TfToken &apiSchemaName)
 Helper method to apply a single-apply API schema with the given schema name apiSchemaName' and C++ type 'APISchemaType'. More...
 
template<typename APISchemaType >
static APISchemaType _MultipleApplyAPISchema (const UsdPrim &prim, const TfToken &apiSchemaName, const TfToken &instanceName)
 Helper method to apply a multiple-apply API schema with the given schema name apiSchemaName', C++ type 'APISchemaType' and instance name instanceName. More...
 

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

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 ( 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 ( 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.

virtual USDSHADE_API ~UsdShadeCoordSysAPI ( )
virtual

Destructor.

Member Function Documentation

USDSHADE_API UsdSchemaKind _GetSchemaKind ( ) const
overrideprotectedvirtual

Returns the kind of schema this class belongs to.

See Also
UsdSchemaKind

Reimplemented from UsdAPISchemaBase.

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.

USDSHADE_API bool BlockBinding ( const TfToken name) const

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

static USDSHADE_API bool CanContainPropertyName ( const TfToken name)
static

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

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)

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.

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));
*
static USDSHADE_API TfToken GetCoordSysRelationshipName ( const std::string &  coordSysName)
static

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

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.

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.

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

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: