connectableAPI.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef USDSHADE_GENERATED_CONNECTABLEAPI_H
25 #define USDSHADE_GENERATED_CONNECTABLEAPI_H
26 
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usdShade/api.h"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
34 
35 #include "pxr/usd/usd/typed.h"
36 #include "pxr/usd/usdShade/input.h"
37 #include "pxr/usd/usdShade/output.h"
39 #include "pxr/usd/usdShade/types.h"
40 
41 #include "pxr/base/vt/value.h"
42 
43 #include "pxr/base/gf/vec3d.h"
44 #include "pxr/base/gf/vec3f.h"
45 #include "pxr/base/gf/matrix4d.h"
46 
47 #include "pxr/base/tf/token.h"
48 #include "pxr/base/tf/type.h"
49 
50 PXR_NAMESPACE_OPEN_SCOPE
51 
52 class SdfAssetPath;
53 
54 // -------------------------------------------------------------------------- //
55 // CONNECTABLEAPI //
56 // -------------------------------------------------------------------------- //
57 
82 {
83 public:
88 
93  explicit UsdShadeConnectableAPI(const UsdPrim& prim=UsdPrim())
94  : UsdAPISchemaBase(prim)
95  {
96  }
97 
101  explicit UsdShadeConnectableAPI(const UsdSchemaBase& schemaObj)
102  : UsdAPISchemaBase(schemaObj)
103  {
104  }
105 
107  USDSHADE_API
108  virtual ~UsdShadeConnectableAPI();
109 
113  USDSHADE_API
114  static const TfTokenVector &
115  GetSchemaAttributeNames(bool includeInherited=true);
116 
126  USDSHADE_API
128  Get(const UsdStagePtr &stage, const SdfPath &path);
129 
130 
131 protected:
135  USDSHADE_API
136  UsdSchemaKind _GetSchemaKind() const override;
137 
138 private:
139  // needs to invoke _GetStaticTfType.
140  friend class UsdSchemaRegistry;
141  USDSHADE_API
142  static const TfType &_GetStaticTfType();
143 
144  static bool _IsTypedSchema();
145 
146  // override SchemaBase virtuals.
147  USDSHADE_API
148  const TfType &_GetTfType() const override;
149 
150 public:
151  // ===================================================================== //
152  // Feel free to add custom code below this line, it will be preserved by
153  // the code generator.
154  //
155  // Just remember to:
156  // - Close the class declaration with };
157  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
158  // - Close the include guard with #endif
159  // ===================================================================== //
160  // --(BEGIN CUSTOM CODE)--
161 
162 protected:
167  USDSHADE_API
168  bool _IsCompatible() const override;
169 
170 public:
175  USDSHADE_API
176  bool IsContainer() const;
177 
183  USDSHADE_API
184  bool RequiresEncapsulation() const;
185 
193 
203  USDSHADE_API
204  static bool CanConnect(const UsdShadeInput &input,
205  const UsdAttribute &source);
206 
208  USDSHADE_API
209  static bool CanConnect(const UsdShadeInput &input,
210  const UsdShadeInput &sourceInput) {
211  return CanConnect(input, sourceInput.GetAttr());
212  }
213 
215  USDSHADE_API
216  static bool CanConnect(const UsdShadeInput &input,
217  const UsdShadeOutput &sourceOutput) {
218  return CanConnect(input, sourceOutput.GetAttr());
219  }
220 
231  USDSHADE_API
232  static bool CanConnect(const UsdShadeOutput &output,
233  const UsdAttribute &source=UsdAttribute());
234 
236  USDSHADE_API
237  static bool CanConnect(const UsdShadeOutput &output,
238  const UsdShadeInput &sourceInput) {
239  return CanConnect(output, sourceInput.GetAttr());
240  }
241 
243  USDSHADE_API
244  static bool CanConnect(const UsdShadeOutput &output,
245  const UsdShadeOutput &sourceOutput) {
246  return CanConnect(output, sourceOutput.GetAttr());
247  }
248 
249  using ConnectionModification = UsdShadeConnectionModification;
250 
272  USDSHADE_API
273  static bool ConnectToSource(
274  UsdAttribute const &shadingAttr,
275  UsdShadeConnectionSourceInfo const &source,
276  ConnectionModification const mod = ConnectionModification::Replace);
277 
279  USDSHADE_API
280  static bool ConnectToSource(
281  UsdShadeInput const &input,
282  UsdShadeConnectionSourceInfo const &source,
283  ConnectionModification const mod = ConnectionModification::Replace)
284  {
285  return ConnectToSource(input.GetAttr(), source, mod);
286  }
287 
289  USDSHADE_API
290  static bool ConnectToSource(
291  UsdShadeOutput const &output,
292  UsdShadeConnectionSourceInfo const &source,
293  ConnectionModification const mod = ConnectionModification::Replace)
294  {
295  return ConnectToSource(output.GetAttr(), source, mod);
296  }
297 
301  USDSHADE_API
302  static bool ConnectToSource(
303  UsdAttribute const &shadingAttr,
304  UsdShadeConnectableAPI const &source,
305  TfToken const &sourceName,
306  UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output,
308 
311  USDSHADE_API
312  static bool ConnectToSource(
313  UsdShadeInput const &input,
314  UsdShadeConnectableAPI const &source,
315  TfToken const &sourceName,
316  UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output,
318  {
319  return ConnectToSource(input.GetAttr(), source, sourceName, sourceType,
320  typeName);
321  }
322 
325  USDSHADE_API
326  static bool ConnectToSource(
327  UsdShadeOutput const &output,
328  UsdShadeConnectableAPI const &source,
329  TfToken const &sourceName,
330  UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output,
332  {
333  return ConnectToSource(output.GetAttr(), source, sourceName, sourceType,
334  typeName);
335  }
336 
346  USDSHADE_API
347  static bool ConnectToSource(UsdAttribute const &shadingAttr,
348  SdfPath const &sourcePath);
349 
351  USDSHADE_API
352  static bool ConnectToSource(UsdShadeInput const &input,
353  SdfPath const &sourcePath) {
354  return ConnectToSource(input.GetAttr(), sourcePath);
355  }
356 
358  USDSHADE_API
359  static bool ConnectToSource(UsdShadeOutput const &output,
360  SdfPath const &sourcePath) {
361  return ConnectToSource(output.GetAttr(), sourcePath);
362  }
363 
368  USDSHADE_API
369  static bool ConnectToSource(UsdAttribute const &shadingAttr,
370  UsdShadeInput const &sourceInput);
371 
373  USDSHADE_API
374  static bool ConnectToSource(UsdShadeInput const &input,
375  UsdShadeInput const &sourceInput) {
376  return ConnectToSource(input.GetAttr(), sourceInput);
377  }
378 
380  USDSHADE_API
381  static bool ConnectToSource(UsdShadeOutput const &output,
382  UsdShadeInput const &sourceInput) {
383  return ConnectToSource(output.GetAttr(), sourceInput);
384  }
385 
390  USDSHADE_API
391  static bool ConnectToSource(UsdAttribute const &shadingAttr,
392  UsdShadeOutput const &sourceOutput);
393 
395  USDSHADE_API
396  static bool ConnectToSource(UsdShadeInput const &input,
397  UsdShadeOutput const &sourceOutput) {
398  return ConnectToSource(input.GetAttr(), sourceOutput);
399  }
400 
402  USDSHADE_API
403  static bool ConnectToSource(UsdShadeOutput const &output,
404  UsdShadeOutput const &sourceOutput) {
405  return ConnectToSource(output.GetAttr(), sourceOutput);
406  }
407 
424  USDSHADE_API
425  static bool SetConnectedSources(
426  UsdAttribute const &shadingAttr,
427  std::vector<UsdShadeConnectionSourceInfo> const &sourceInfos);
428 
429 
457  USDSHADE_API
458  static bool GetConnectedSource(UsdAttribute const &shadingAttr,
459  UsdShadeConnectableAPI *source,
460  TfToken *sourceName,
461  UsdShadeAttributeType *sourceType);
462 
465  USDSHADE_API
466  static bool GetConnectedSource(UsdShadeInput const &input,
467  UsdShadeConnectableAPI *source,
468  TfToken *sourceName,
469  UsdShadeAttributeType *sourceType) {
470  return GetConnectedSource(input.GetAttr(), source, sourceName,
471  sourceType);
472  }
473 
476  USDSHADE_API
477  static bool GetConnectedSource(UsdShadeOutput const &output,
478  UsdShadeConnectableAPI *source,
479  TfToken *sourceName,
480  UsdShadeAttributeType *sourceType) {
481  return GetConnectedSource(output.GetAttr(), source, sourceName,
482  sourceType);
483  }
484 
501  USDSHADE_API
503  UsdAttribute const &shadingAttr,
504  SdfPathVector *invalidSourcePaths = nullptr);
505 
507  USDSHADE_API
509  UsdShadeInput const &input,
510  SdfPathVector *invalidSourcePaths = nullptr);
511 
513  USDSHADE_API
515  UsdShadeOutput const &output,
516  SdfPathVector *invalidSourcePaths = nullptr);
517 
523  USDSHADE_API
524  static bool GetRawConnectedSourcePaths(UsdAttribute const &shadingAttr,
525  SdfPathVector *sourcePaths);
526 
529  USDSHADE_API
530  static bool GetRawConnectedSourcePaths(UsdShadeInput const &input,
531  SdfPathVector *sourcePaths) {
532  return GetRawConnectedSourcePaths(input.GetAttr(), sourcePaths);
533  }
534 
537  USDSHADE_API
538  static bool GetRawConnectedSourcePaths(UsdShadeOutput const &output,
539  SdfPathVector *sourcePaths) {
540  return GetRawConnectedSourcePaths(output.GetAttr(), sourcePaths);
541  }
542 
558  USDSHADE_API
559  static bool HasConnectedSource(const UsdAttribute &shadingAttr);
560 
562  USDSHADE_API
563  static bool HasConnectedSource(const UsdShadeInput &input) {
564  return HasConnectedSource(input.GetAttr());
565  }
566 
568  USDSHADE_API
569  static bool HasConnectedSource(const UsdShadeOutput &output) {
570  return HasConnectedSource(output.GetAttr());
571  }
572 
577  USDSHADE_API
579  const UsdAttribute &shadingAttr);
580 
582  USDSHADE_API
585  }
586 
588  USDSHADE_API
590  {
592  }
593 
607  USDSHADE_API
608  static bool DisconnectSource(
609  UsdAttribute const &shadingAttr,
610  UsdAttribute const &sourceAttr = UsdAttribute());
611 
613  USDSHADE_API
614  static bool DisconnectSource(
615  UsdShadeInput const &input,
616  UsdAttribute const &sourceAttr = UsdAttribute()) {
617  return DisconnectSource(input.GetAttr(), sourceAttr);
618  }
619 
621  USDSHADE_API
622  static bool DisconnectSource(
623  UsdShadeOutput const &output,
624  UsdAttribute const &sourceAttr = UsdAttribute()) {
625  return DisconnectSource(output.GetAttr(), sourceAttr);
626  }
627 
634  USDSHADE_API
635  static bool ClearSources(UsdAttribute const &shadingAttr);
636 
638  USDSHADE_API
639  static bool ClearSources(UsdShadeInput const &input) {
640  return ClearSources(input.GetAttr());
641  }
642 
644  USDSHADE_API
645  static bool ClearSources(UsdShadeOutput const &output) {
646  return ClearSources(output.GetAttr());
647  }
648 
651  USDSHADE_API
652  static bool ClearSource(UsdAttribute const &shadingAttr) {
653  return ClearSources(shadingAttr);
654  }
655 
658  USDSHADE_API
659  static bool ClearSource(UsdShadeInput const &input) {
660  return ClearSources(input.GetAttr());
661  }
662 
665  USDSHADE_API
666  static bool ClearSource(UsdShadeOutput const &output) {
667  return ClearSources(output.GetAttr());
668  }
669 
674  USDSHADE_API
675  static bool HasConnectableAPI(const TfType& schemaType);
676 
679  template <typename T>
680  static bool HasConnectableAPI()
681  {
682  static_assert(std::is_base_of<UsdSchemaBase, T>::value,
683  "Provided type must derive UsdSchemaBase.");
684  return HasConnectableAPI(TfType::Find<T>());
685  };
686 
688 
689 
692 
699  USDSHADE_API
700  UsdShadeOutput CreateOutput(const TfToken& name,
701  const SdfValueTypeName& typeName) const;
702 
707  USDSHADE_API
708  UsdShadeOutput GetOutput(const TfToken &name) const;
709 
715  USDSHADE_API
716  std::vector<UsdShadeOutput> GetOutputs(
717  bool onlyAuthored=true) const;
718 
720 
723 
728  USDSHADE_API
729  UsdShadeInput CreateInput(const TfToken& name,
730  const SdfValueTypeName& typeName) const;
731 
736  USDSHADE_API
737  UsdShadeInput GetInput(const TfToken &name) const;
738 
744  USDSHADE_API
745  std::vector<UsdShadeInput> GetInputs(
746  bool onlyAuthored=true) const;
747 
749 
750 };
751 
766  UsdShadeAttributeType sourceType = UsdShadeAttributeType::Invalid;
770 
771  UsdShadeConnectionSourceInfo() = default;
773  UsdShadeConnectableAPI const &source_,
774  TfToken const &sourceName_,
775  UsdShadeAttributeType sourceType_,
776  SdfValueTypeName typeName_ = SdfValueTypeName())
777  : source(source_)
778  , sourceName(sourceName_)
779  , sourceType(sourceType_)
780  , typeName(typeName_)
781  {}
782  explicit UsdShadeConnectionSourceInfo(UsdShadeInput const &input)
783  : source(input.GetPrim())
784  , sourceName(input.GetBaseName())
785  , sourceType(UsdShadeAttributeType::Input)
786  , typeName(input.GetAttr().GetTypeName())
787  {}
788  explicit UsdShadeConnectionSourceInfo(UsdShadeOutput const &output)
789  : source(output.GetPrim())
790  , sourceName(output.GetBaseName())
791  , sourceType(UsdShadeAttributeType::Output)
792  , typeName(output.GetAttr().GetTypeName())
793  {}
798  USDSHADE_API
800  UsdStagePtr const& stage,
801  SdfPath const& sourcePath);
802 
804  bool IsValid() const {
805  // typeName can be invalid, so we don't check it. Order of checks is in
806  // order of cost (cheap to expensive).
807  // Note, for the source we only check that the prim is valid. We do not
808  // verify that the prim is compatibel with UsdShadeConnectableAPI. This
809  // makes it possible to target pure overs
810  return (sourceType != UsdShadeAttributeType::Invalid) &&
811  !sourceName.IsEmpty() &&
812  (bool)source.GetPrim();
813  }
814  explicit operator bool() const {
815  return IsValid();
816  }
817  bool operator==(UsdShadeConnectionSourceInfo const& other) const {
818  // We don't compare the typeName, since it is optional
819  return sourceName == other.sourceName &&
820  sourceType == other.sourceType &&
821  source.GetPrim() == other.source.GetPrim();
822  }
823  bool operator!=(const UsdShadeConnectionSourceInfo &other) const {
824  return !(*this == other);
825  }
826 };
827 
828 PXR_NAMESPACE_CLOSE_SCOPE
829 
830 #endif
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, 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.
bool IsEmpty() const
Returns true iff this token contains the empty string "".
Definition: token.h:302
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdShadeOutput const &output, SdfPathVector *sourcePaths)
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdAttribute const &shadingAttr, SdfPathVector *sourcePaths)
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, UsdShadeConnectionSourceInfo const &source, ConnectionModification const mod=ConnectionModification::Replace)
UsdAttribute GetAttr() const
Explicit UsdAttribute extractor.
Definition: output.h:213
SdfValueTypeName typeName
typeName, if specified, is the typename of the attribute to create on the source if it doesn't exist ...
UsdShadeConnectableAPI(const UsdSchemaBase &schemaObj)
Construct a UsdShadeConnectableAPI on the prim held by schemaObj .
static USDSHADE_API bool ConnectToSource(UsdShadeInput const &input, UsdShadeInput const &sourceInput)
This is a small-vector class with local storage optimization, the local storage can be specified via ...
Definition: smallVector.h:177
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(UsdShadeInput const &input, UsdShadeOutput const &sourceOutput)
static USDSHADE_API bool ClearSources(UsdShadeInput const &input)
static USDSHADE_API bool ClearSource(UsdShadeOutput const &output)
USDSHADE_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDSHADE_API bool CanConnect(const UsdShadeInput &input, const UsdShadeInput &sourceInput)
UsdPrim GetPrim() const
Return this schema object's held prim.
Definition: schemaBase.h:120
Represents a value type name, i.e.
Definition: valueTypeName.h:87
static USDSHADE_API bool DisconnectSource(UsdShadeOutput const &output, UsdAttribute const &sourceAttr=UsdAttribute())
The base class for all API schemas.
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, UsdShadeInput const &sourceInput)
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:176
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 ConnectToSource(UsdShadeInput const &input, UsdShadeConnectionSourceInfo const &source, ConnectionModification const mod=ConnectionModification::Replace)
This class encapsulates a shader or node-graph input, which is a connectable attribute representing a...
Definition: input.h:48
USDSHADE_API bool RequiresEncapsulation() const
Returns true if container encapsulation rules should be respected when evaluating connectibility beha...
Non-applied API schema.
USDSHADE_API std::vector< UsdShadeOutput > GetOutputs(bool onlyAuthored=true) const
Returns all outputs on the connectable prim (i.e.
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:127
static USDSHADE_API UsdShadeSourceInfoVector GetConnectedSources(UsdAttribute const &shadingAttr, SdfPathVector *invalidSourcePaths=nullptr)
Finds the valid sources of connections for the given shading attribute.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
static USDSHADE_API bool CanConnect(const UsdShadeInput &input, const UsdShadeOutput &sourceOutput)
static USDSHADE_API bool GetConnectedSource(UsdShadeOutput const &output, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
TfToken sourceName
sourceName is the name of the shading attribute that is the target of the connection.
static bool HasConnectableAPI()
Return true if the schema type T has a connectableAPIBehavior registered, false otherwise.
static USDSHADE_API bool ClearSources(UsdShadeOutput const &output)
USDSHADE_API std::vector< UsdShadeInput > GetInputs(bool onlyAuthored=true) const
Returns all inputs on the connectable prim (i.e.
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...
static USDSHADE_API bool ConnectToSource(UsdShadeInput const &input, SdfPath const &sourcePath)
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, SdfPath const &sourcePath)
USDSHADE_API UsdShadeOutput GetOutput(const TfToken &name) const
Return the requested output if it exists.
static USDSHADE_API bool ConnectToSource(UsdShadeInput const &input, UsdShadeConnectableAPI const &source, TfToken const &sourceName, UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output, SdfValueTypeName typeName=SdfValueTypeName())
static USDSHADE_API bool ClearSources(UsdAttribute const &shadingAttr)
Clears sources for this shading attribute in the current UsdEditTarget.
UsdShadeAttributeType sourceType
sourceType is used to indicate the type of the shading attribute that is the target of the connection...
UsdShadeConnectableAPI is an API schema that provides a common interface for creating outputs and mak...
const UsdAttribute & GetAttr() const
Explicit UsdAttribute extractor.
Definition: input.h:229
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:132
virtual USDSHADE_API ~UsdShadeConnectableAPI()
Destructor.
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdAttribute &shadingAttr)
Returns true if the connection to the given shading attribute's source, as returned by UsdShadeConnec...
USDSHADE_API bool _IsCompatible() const override
Returns true if the given prim is compatible with this API schema, i.e.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
static USDSHADE_API bool HasConnectedSource(const UsdShadeInput &input)
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, UsdShadeOutput const &sourceOutput)
static USDSHADE_API bool ClearSource(UsdAttribute const &shadingAttr)
static USDSHADE_API bool GetConnectedSource(UsdAttribute const &shadingAttr, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
static USDSHADE_API bool GetConnectedSource(UsdShadeInput const &input, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
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...
USDSHADE_API UsdShadeInput GetInput(const TfToken &name) const
Return the requested input if it exists.
Contains an asset path and an optional resolved path.
Definition: assetPath.h:47
static USDSHADE_API bool CanConnect(const UsdShadeOutput &output, const UsdShadeOutput &sourceOutput)
UsdShadeConnectableAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdShadeConnectableAPI on UsdPrim prim .
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 HasConnectedSource(const UsdShadeOutput &output)
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdShadeOutput &output)
static USDSHADE_API bool DisconnectSource(UsdAttribute const &shadingAttr, UsdAttribute const &sourceAttr=UsdAttribute())
Disconnect source for this shading attribute.
TfType represents a dynamic runtime type.
Definition: type.h:64
Singleton registry that provides access to schema type information and the prim definitions for regis...
bool IsValid() const
Return true if this source info is valid for setting up a connection.
USDSHADE_API UsdShadeOutput CreateOutput(const TfToken &name, const SdfValueTypeName &typeName) const
Create an output, which represents and externally computed, typed value.
A compact struct to represent a bundle of information about an upstream source attribute.
static USDSHADE_API bool CanConnect(const UsdShadeOutput &output, const UsdShadeInput &sourceInput)
This class encapsulates a shader or node-graph output, which is a connectable attribute representing ...
Definition: output.h:47
static USDSHADE_API bool DisconnectSource(UsdShadeInput const &input, UsdAttribute const &sourceAttr=UsdAttribute())
UsdShadeConnectableAPI source
source is the connectable prim that produces or contains a value for the given shading attribute.
The base class for all schema types in Usd.
Definition: schemaBase.h:56
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 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 IsContainer() const
Returns true if the prim is a container.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdShadeInput &input)
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdShadeInput const &input, SdfPathVector *sourcePaths)
static USDSHADE_API bool ClearSource(UsdShadeInput const &input)