This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
connectableAPI.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef USDSHADE_GENERATED_CONNECTABLEAPI_H
8#define USDSHADE_GENERATED_CONNECTABLEAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdShade/api.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
17
18#include "pxr/usd/usd/typed.h"
19#include "pxr/usd/usdShade/input.h"
20#include "pxr/usd/usdShade/output.h"
22#include "pxr/usd/usdShade/types.h"
23
24#include "pxr/base/vt/value.h"
25
26#include "pxr/base/gf/vec3d.h"
27#include "pxr/base/gf/vec3f.h"
29
30#include "pxr/base/tf/token.h"
31#include "pxr/base/tf/type.h"
32
33PXR_NAMESPACE_OPEN_SCOPE
34
35class SdfAssetPath;
36
37// -------------------------------------------------------------------------- //
38// CONNECTABLEAPI //
39// -------------------------------------------------------------------------- //
40
65{
66public:
70 static const UsdSchemaKind schemaKind = UsdSchemaKind::NonAppliedAPI;
71
76 explicit UsdShadeConnectableAPI(const UsdPrim& prim=UsdPrim())
77 : UsdAPISchemaBase(prim)
78 {
79 }
80
84 explicit UsdShadeConnectableAPI(const UsdSchemaBase& schemaObj)
85 : UsdAPISchemaBase(schemaObj)
86 {
87 }
88
90 USDSHADE_API
92
96 USDSHADE_API
97 static const TfTokenVector &
98 GetSchemaAttributeNames(bool includeInherited=true);
99
109 USDSHADE_API
111 Get(const UsdStagePtr &stage, const SdfPath &path);
112
113
114protected:
118 USDSHADE_API
120
121private:
122 // needs to invoke _GetStaticTfType.
123 friend class UsdSchemaRegistry;
124 USDSHADE_API
125 static const TfType &_GetStaticTfType();
126
127 static bool _IsTypedSchema();
128
129 // override SchemaBase virtuals.
130 USDSHADE_API
131 const TfType &_GetTfType() const override;
132
133public:
134 // ===================================================================== //
135 // Feel free to add custom code below this line, it will be preserved by
136 // the code generator.
137 //
138 // Just remember to:
139 // - Close the class declaration with };
140 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
141 // - Close the include guard with #endif
142 // ===================================================================== //
143 // --(BEGIN CUSTOM CODE)--
144
145protected:
150 USDSHADE_API
151 bool _IsCompatible() const override;
152
153public:
158 USDSHADE_API
159 bool IsContainer() const;
160
166 USDSHADE_API
168
176
186 USDSHADE_API
187 static bool CanConnect(const UsdShadeInput &input,
188 const UsdAttribute &source);
189
191 USDSHADE_API
192 static bool CanConnect(const UsdShadeInput &input,
193 const UsdShadeInput &sourceInput) {
194 return CanConnect(input, sourceInput.GetAttr());
195 }
196
198 USDSHADE_API
199 static bool CanConnect(const UsdShadeInput &input,
200 const UsdShadeOutput &sourceOutput) {
201 return CanConnect(input, sourceOutput.GetAttr());
202 }
203
214 USDSHADE_API
215 static bool CanConnect(const UsdShadeOutput &output,
216 const UsdAttribute &source=UsdAttribute());
217
219 USDSHADE_API
220 static bool CanConnect(const UsdShadeOutput &output,
221 const UsdShadeInput &sourceInput) {
222 return CanConnect(output, sourceInput.GetAttr());
223 }
224
226 USDSHADE_API
227 static bool CanConnect(const UsdShadeOutput &output,
228 const UsdShadeOutput &sourceOutput) {
229 return CanConnect(output, sourceOutput.GetAttr());
230 }
231
232 using ConnectionModification = UsdShadeConnectionModification;
233
255 USDSHADE_API
256 static bool ConnectToSource(
257 UsdAttribute const &shadingAttr,
258 UsdShadeConnectionSourceInfo const &source,
259 ConnectionModification const mod = ConnectionModification::Replace);
260
262 USDSHADE_API
263 static bool ConnectToSource(
264 UsdShadeInput const &input,
265 UsdShadeConnectionSourceInfo const &source,
266 ConnectionModification const mod = ConnectionModification::Replace)
267 {
268 return ConnectToSource(input.GetAttr(), source, mod);
269 }
270
272 USDSHADE_API
273 static bool ConnectToSource(
274 UsdShadeOutput const &output,
275 UsdShadeConnectionSourceInfo const &source,
276 ConnectionModification const mod = ConnectionModification::Replace)
277 {
278 return ConnectToSource(output.GetAttr(), source, mod);
279 }
280
284 USDSHADE_API
285 static bool ConnectToSource(
286 UsdAttribute const &shadingAttr,
287 UsdShadeConnectableAPI const &source,
288 TfToken const &sourceName,
289 UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output,
291
294 USDSHADE_API
295 static bool ConnectToSource(
296 UsdShadeInput const &input,
297 UsdShadeConnectableAPI const &source,
298 TfToken const &sourceName,
299 UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output,
301 {
302 return ConnectToSource(input.GetAttr(), source, sourceName, sourceType,
303 typeName);
304 }
305
308 USDSHADE_API
309 static bool ConnectToSource(
310 UsdShadeOutput const &output,
311 UsdShadeConnectableAPI const &source,
312 TfToken const &sourceName,
313 UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output,
315 {
316 return ConnectToSource(output.GetAttr(), source, sourceName, sourceType,
317 typeName);
318 }
319
329 USDSHADE_API
330 static bool ConnectToSource(UsdAttribute const &shadingAttr,
331 SdfPath const &sourcePath);
332
334 USDSHADE_API
335 static bool ConnectToSource(UsdShadeInput const &input,
336 SdfPath const &sourcePath) {
337 return ConnectToSource(input.GetAttr(), sourcePath);
338 }
339
341 USDSHADE_API
342 static bool ConnectToSource(UsdShadeOutput const &output,
343 SdfPath const &sourcePath) {
344 return ConnectToSource(output.GetAttr(), sourcePath);
345 }
346
351 USDSHADE_API
352 static bool ConnectToSource(UsdAttribute const &shadingAttr,
353 UsdShadeInput const &sourceInput);
354
356 USDSHADE_API
357 static bool ConnectToSource(UsdShadeInput const &input,
358 UsdShadeInput const &sourceInput) {
359 return ConnectToSource(input.GetAttr(), sourceInput);
360 }
361
363 USDSHADE_API
364 static bool ConnectToSource(UsdShadeOutput const &output,
365 UsdShadeInput const &sourceInput) {
366 return ConnectToSource(output.GetAttr(), sourceInput);
367 }
368
373 USDSHADE_API
374 static bool ConnectToSource(UsdAttribute const &shadingAttr,
375 UsdShadeOutput const &sourceOutput);
376
378 USDSHADE_API
379 static bool ConnectToSource(UsdShadeInput const &input,
380 UsdShadeOutput const &sourceOutput) {
381 return ConnectToSource(input.GetAttr(), sourceOutput);
382 }
383
385 USDSHADE_API
386 static bool ConnectToSource(UsdShadeOutput const &output,
387 UsdShadeOutput const &sourceOutput) {
388 return ConnectToSource(output.GetAttr(), sourceOutput);
389 }
390
407 USDSHADE_API
409 UsdAttribute const &shadingAttr,
410 std::vector<UsdShadeConnectionSourceInfo> const &sourceInfos);
411
412
440 USDSHADE_API
441 static bool GetConnectedSource(UsdAttribute const &shadingAttr,
443 TfToken *sourceName,
444 UsdShadeAttributeType *sourceType);
445
448 USDSHADE_API
449 static bool GetConnectedSource(UsdShadeInput const &input,
451 TfToken *sourceName,
452 UsdShadeAttributeType *sourceType) {
453 return GetConnectedSource(input.GetAttr(), source, sourceName,
454 sourceType);
455 }
456
459 USDSHADE_API
460 static bool GetConnectedSource(UsdShadeOutput const &output,
462 TfToken *sourceName,
463 UsdShadeAttributeType *sourceType) {
464 return GetConnectedSource(output.GetAttr(), source, sourceName,
465 sourceType);
466 }
467
484 USDSHADE_API
486 UsdAttribute const &shadingAttr,
487 SdfPathVector *invalidSourcePaths = nullptr);
488
490 USDSHADE_API
492 UsdShadeInput const &input,
493 SdfPathVector *invalidSourcePaths = nullptr);
494
496 USDSHADE_API
498 UsdShadeOutput const &output,
499 SdfPathVector *invalidSourcePaths = nullptr);
500
506 USDSHADE_API
507 static bool GetRawConnectedSourcePaths(UsdAttribute const &shadingAttr,
508 SdfPathVector *sourcePaths);
509
512 USDSHADE_API
513 static bool GetRawConnectedSourcePaths(UsdShadeInput const &input,
514 SdfPathVector *sourcePaths) {
515 return GetRawConnectedSourcePaths(input.GetAttr(), sourcePaths);
516 }
517
520 USDSHADE_API
521 static bool GetRawConnectedSourcePaths(UsdShadeOutput const &output,
522 SdfPathVector *sourcePaths) {
523 return GetRawConnectedSourcePaths(output.GetAttr(), sourcePaths);
524 }
525
541 USDSHADE_API
542 static bool HasConnectedSource(const UsdAttribute &shadingAttr);
543
545 USDSHADE_API
546 static bool HasConnectedSource(const UsdShadeInput &input) {
547 return HasConnectedSource(input.GetAttr());
548 }
549
551 USDSHADE_API
552 static bool HasConnectedSource(const UsdShadeOutput &output) {
553 return HasConnectedSource(output.GetAttr());
554 }
555
560 USDSHADE_API
562 const UsdAttribute &shadingAttr);
563
565 USDSHADE_API
568 }
569
571 USDSHADE_API
573 {
575 }
576
590 USDSHADE_API
591 static bool DisconnectSource(
592 UsdAttribute const &shadingAttr,
593 UsdAttribute const &sourceAttr = UsdAttribute());
594
596 USDSHADE_API
597 static bool DisconnectSource(
598 UsdShadeInput const &input,
599 UsdAttribute const &sourceAttr = UsdAttribute()) {
600 return DisconnectSource(input.GetAttr(), sourceAttr);
601 }
602
604 USDSHADE_API
605 static bool DisconnectSource(
606 UsdShadeOutput const &output,
607 UsdAttribute const &sourceAttr = UsdAttribute()) {
608 return DisconnectSource(output.GetAttr(), sourceAttr);
609 }
610
617 USDSHADE_API
618 static bool ClearSources(UsdAttribute const &shadingAttr);
619
621 USDSHADE_API
622 static bool ClearSources(UsdShadeInput const &input) {
623 return ClearSources(input.GetAttr());
624 }
625
627 USDSHADE_API
628 static bool ClearSources(UsdShadeOutput const &output) {
629 return ClearSources(output.GetAttr());
630 }
631
634 USDSHADE_API
635 static bool ClearSource(UsdAttribute const &shadingAttr) {
636 return ClearSources(shadingAttr);
637 }
638
641 USDSHADE_API
642 static bool ClearSource(UsdShadeInput const &input) {
643 return ClearSources(input.GetAttr());
644 }
645
648 USDSHADE_API
649 static bool ClearSource(UsdShadeOutput const &output) {
650 return ClearSources(output.GetAttr());
651 }
652
657 USDSHADE_API
658 static bool HasConnectableAPI(const TfType& schemaType);
659
662 template <typename T>
663 static bool HasConnectableAPI()
664 {
665 static_assert(std::is_base_of<UsdSchemaBase, T>::value,
666 "Provided type must derive UsdSchemaBase.");
667 return HasConnectableAPI(TfType::Find<T>());
668 };
669
671
672
675
682 USDSHADE_API
684 const SdfValueTypeName& typeName) const;
685
690 USDSHADE_API
691 UsdShadeOutput GetOutput(const TfToken &name) const;
692
698 USDSHADE_API
699 std::vector<UsdShadeOutput> GetOutputs(
700 bool onlyAuthored=true) const;
701
703
706
711 USDSHADE_API
713 const SdfValueTypeName& typeName) const;
714
719 USDSHADE_API
720 UsdShadeInput GetInput(const TfToken &name) const;
721
727 USDSHADE_API
728 std::vector<UsdShadeInput> GetInputs(
729 bool onlyAuthored=true) const;
730
732
733};
734
749 UsdShadeAttributeType sourceType = UsdShadeAttributeType::Invalid;
753
756 UsdShadeConnectableAPI const &source_,
757 TfToken const &sourceName_,
758 UsdShadeAttributeType sourceType_,
760 : source(source_)
761 , sourceName(sourceName_)
762 , sourceType(sourceType_)
763 , typeName(typeName_)
764 {}
765 explicit UsdShadeConnectionSourceInfo(UsdShadeInput const &input)
766 : source(input.GetPrim())
767 , sourceName(input.GetBaseName())
768 , sourceType(UsdShadeAttributeType::Input)
769 , typeName(input.GetAttr().GetTypeName())
770 {}
771 explicit UsdShadeConnectionSourceInfo(UsdShadeOutput const &output)
772 : source(output.GetPrim())
773 , sourceName(output.GetBaseName())
774 , sourceType(UsdShadeAttributeType::Output)
775 , typeName(output.GetAttr().GetTypeName())
776 {}
781 USDSHADE_API
783 UsdStagePtr const& stage,
784 SdfPath const& sourcePath);
785
787 bool IsValid() const {
788 // typeName can be invalid, so we don't check it. Order of checks is in
789 // order of cost (cheap to expensive).
790 // Note, for the source we only check that the prim is valid. We do not
791 // verify that the prim is compatibel with UsdShadeConnectableAPI. This
792 // makes it possible to target pure overs
793 return (sourceType != UsdShadeAttributeType::Invalid) &&
794 !sourceName.IsEmpty() &&
795 (bool)source.GetPrim();
796 }
797 explicit operator bool() const {
798 return IsValid();
799 }
800 bool operator==(UsdShadeConnectionSourceInfo const& other) const {
801 // We don't compare the typeName, since it is optional
802 return sourceName == other.sourceName &&
803 sourceType == other.sourceType &&
804 source.GetPrim() == other.source.GetPrim();
805 }
806 bool operator!=(const UsdShadeConnectionSourceInfo &other) const {
807 return !(*this == other);
808 }
809};
810
811PXR_NAMESPACE_CLOSE_SCOPE
812
813#endif
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Represents a value type name, i.e.
Definition: valueTypeName.h:71
This is a small-vector class with local storage optimization, the local storage can be specified via ...
Definition: smallVector.h:157
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
bool IsEmpty() const
Returns true iff this token contains the empty string "".
Definition: token.h:288
TfType represents a dynamic runtime type.
Definition: type.h:48
The base class for all API schemas.
Definition: apiSchemaBase.h:99
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:160
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
The base class for all schema types in Usd.
Definition: schemaBase.h:39
UsdPrim GetPrim() const
Return this schema object's held prim.
Definition: schemaBase.h:103
Singleton registry that provides access to schema type information and the prim definitions for regis...
UsdShadeConnectableAPI is an API schema that provides a common interface for creating outputs and mak...
virtual USDSHADE_API ~UsdShadeConnectableAPI()
Destructor.
static USDSHADE_API UsdShadeSourceInfoVector GetConnectedSources(UsdShadeInput const &input, SdfPathVector *invalidSourcePaths=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool ClearSource(UsdAttribute const &shadingAttr)
static USDSHADE_API bool ClearSources(UsdAttribute const &shadingAttr)
Clears sources for this shading attribute in the current UsdEditTarget.
static USDSHADE_API bool SetConnectedSources(UsdAttribute const &shadingAttr, std::vector< UsdShadeConnectionSourceInfo > const &sourceInfos)
Authors a list of connections for a given shading attribute shadingAttr.
static USDSHADE_API bool GetConnectedSource(UsdShadeInput const &input, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
static USDSHADE_API bool CanConnect(const UsdShadeInput &input, const UsdAttribute &source)
Determines whether the given input can be connected to the given source attribute,...
static USDSHADE_API bool DisconnectSource(UsdShadeInput const &input, UsdAttribute const &sourceAttr=UsdAttribute())
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool ConnectToSource(UsdAttribute const &shadingAttr, UsdShadeInput const &sourceInput)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool ConnectToSource(UsdShadeInput const &input, UsdShadeConnectionSourceInfo const &source, ConnectionModification const mod=ConnectionModification::Replace)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool ConnectToSource(UsdAttribute const &shadingAttr, UsdShadeConnectableAPI const &source, TfToken const &sourceName, UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output, SdfValueTypeName typeName=SdfValueTypeName())
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
USDSHADE_API UsdShadeOutput CreateOutput(const TfToken &name, const SdfValueTypeName &typeName) const
Create an output, which represents and externally computed, typed value.
static USDSHADE_API bool HasConnectedSource(const UsdShadeOutput &output)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool GetConnectedSource(UsdAttribute const &shadingAttr, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
static USDSHADE_API UsdShadeConnectableAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdShadeConnectableAPI holding the prim adhering to this schema at path on stage.
USDSHADE_API bool _IsCompatible() const override
Returns true if the given prim is compatible with this API schema, i.e.
static USDSHADE_API bool ClearSources(UsdShadeOutput const &output)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdAttribute const &shadingAttr, SdfPathVector *sourcePaths)
static USDSHADE_API bool CanConnect(const UsdShadeOutput &output, const UsdShadeOutput &sourceOutput)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdShadeInput &input)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdShadeOutput const &output, SdfPathVector *sourcePaths)
USDSHADE_API UsdShadeInput GetInput(const TfToken &name) const
Return the requested input if it exists.
UsdShadeConnectableAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdShadeConnectableAPI on UsdPrim prim .
static USDSHADE_API bool DisconnectSource(UsdShadeOutput const &output, UsdAttribute const &sourceAttr=UsdAttribute())
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, UsdShadeConnectableAPI const &source, TfToken const &sourceName, UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output, SdfValueTypeName typeName=SdfValueTypeName())
static USDSHADE_API bool CanConnect(const UsdShadeInput &input, const UsdShadeOutput &sourceOutput)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool DisconnectSource(UsdAttribute const &shadingAttr, UsdAttribute const &sourceAttr=UsdAttribute())
Disconnect source for this shading attribute.
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, UsdShadeInput const &sourceInput)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool HasConnectedSource(const UsdShadeInput &input)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool CanConnect(const UsdShadeOutput &output, const UsdAttribute &source=UsdAttribute())
Determines whether the given output can be connected to the given source attribute,...
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, SdfPath const &sourcePath)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USDSHADE_API UsdShadeInput CreateInput(const TfToken &name, const SdfValueTypeName &typeName) const
Create an input which can both have a value and be connected.
static USDSHADE_API bool ClearSource(UsdShadeOutput const &output)
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdAttribute &shadingAttr)
Returns true if the connection to the given shading attribute's source, as returned by UsdShadeConnec...
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdShadeInput const &input, SdfPathVector *sourcePaths)
static USDSHADE_API bool ConnectToSource(UsdShadeInput const &input, UsdShadeConnectableAPI const &source, TfToken const &sourceName, UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output, SdfValueTypeName typeName=SdfValueTypeName())
USDSHADE_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDSHADE_API bool GetConnectedSource(UsdShadeOutput const &output, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdShadeOutput &output)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API UsdShadeSourceInfoVector GetConnectedSources(UsdAttribute const &shadingAttr, SdfPathVector *invalidSourcePaths=nullptr)
Finds the valid sources of connections for the given shading attribute.
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 cl...
USDSHADE_API bool RequiresEncapsulation() const
Returns true if container encapsulation rules should be respected when evaluating connectibility beha...
static USDSHADE_API UsdShadeSourceInfoVector GetConnectedSources(UsdShadeOutput const &output, SdfPathVector *invalidSourcePaths=nullptr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool ConnectToSource(UsdAttribute const &shadingAttr, UsdShadeConnectionSourceInfo const &source, ConnectionModification const mod=ConnectionModification::Replace)
Authors a connection for a given shading attribute shadingAttr.
static USDSHADE_API bool ConnectToSource(UsdAttribute const &shadingAttr, SdfPath const &sourcePath)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool ConnectToSource(UsdShadeInput const &input, UsdShadeInput const &sourceInput)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool HasConnectedSource(const UsdAttribute &shadingAttr)
Returns true if and only if the shading attribute is currently connected to at least one valid (defin...
UsdShadeConnectableAPI(const UsdSchemaBase &schemaObj)
Construct a UsdShadeConnectableAPI on the prim held by schemaObj .
static USDSHADE_API bool ConnectToSource(UsdAttribute const &shadingAttr, UsdShadeOutput const &sourceOutput)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, UsdShadeConnectionSourceInfo const &source, ConnectionModification const mod=ConnectionModification::Replace)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool ConnectToSource(UsdShadeInput const &input, UsdShadeOutput const &sourceOutput)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USDSHADE_API UsdShadeOutput GetOutput(const TfToken &name) const
Return the requested output if it exists.
static USDSHADE_API bool CanConnect(const UsdShadeOutput &output, const UsdShadeInput &sourceInput)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool ClearSource(UsdShadeInput const &input)
USDSHADE_API std::vector< UsdShadeInput > GetInputs(bool onlyAuthored=true) const
Returns all inputs on the connectable prim (i.e.
static USDSHADE_API bool ConnectToSource(UsdShadeInput const &input, SdfPath const &sourcePath)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USDSHADE_API std::vector< UsdShadeOutput > GetOutputs(bool onlyAuthored=true) const
Returns all outputs on the connectable prim (i.e.
static USDSHADE_API bool HasConnectableAPI(const TfType &schemaType)
Return true if the schemaType has a valid connectableAPIBehavior registered, false otherwise.
static USDSHADE_API bool ClearSources(UsdShadeInput const &input)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USDSHADE_API bool IsContainer() const
Returns true if the prim is a container.
static bool HasConnectableAPI()
Return true if the schema type T has a connectableAPIBehavior registered, false otherwise.
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, UsdShadeOutput const &sourceOutput)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static USDSHADE_API bool CanConnect(const UsdShadeInput &input, const UsdShadeInput &sourceInput)
This is an overloaded member function, provided for convenience. It differs from the above function o...
This class encapsulates a shader or node-graph input, which is a connectable attribute representing a...
Definition: input.h:32
const UsdAttribute & GetAttr() const
Explicit UsdAttribute extractor.
Definition: input.h:212
This class encapsulates a shader or node-graph output, which is a connectable attribute representing ...
Definition: output.h:31
const UsdAttribute & GetAttr() const
Explicit UsdAttribute extractor.
Definition: output.h:196
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
A compact struct to represent a bundle of information about an upstream source attribute.
SdfValueTypeName typeName
typeName, if specified, is the typename of the attribute to create on the source if it doesn't exist ...
UsdShadeAttributeType sourceType
sourceType is used to indicate the type of the shading attribute that is the target of the connection...
TfToken sourceName
sourceName is the name of the shading attribute that is the target of the connection.
USDSHADE_API UsdShadeConnectionSourceInfo(UsdStagePtr const &stage, SdfPath const &sourcePath)
Construct the information for this struct from a property path.
bool IsValid() const
Return true if this source info is valid for setting up a connection.
UsdShadeConnectableAPI source
source is the connectable prim that produces or contains a value for the given shading attribute.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440