HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
27 /// \file usdShade/connectableAPI.h
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 
37 
38 
39 #include "pxr/base/vt/value.h"
40 
41 #include "pxr/base/gf/vec3d.h"
42 #include "pxr/base/gf/vec3f.h"
43 #include "pxr/base/gf/matrix4d.h"
44 
45 #include "pxr/base/tf/token.h"
46 #include "pxr/base/tf/type.h"
47 
49 
50 class SdfAssetPath;
51 
52 // -------------------------------------------------------------------------- //
53 // CONNECTABLEAPI //
54 // -------------------------------------------------------------------------- //
55 
56 /// \class UsdShadeConnectableAPI
57 ///
58 /// UsdShadeConnectableAPI is an API schema that provides a common
59 /// interface for creating outputs and making connections between shading
60 /// parameters and outputs. The interface is common to all UsdShade schemas
61 /// that support Inputs and Outputs, which currently includes UsdShadeShader,
62 /// UsdShadeNodeGraph, and UsdShadeMaterial .
63 ///
64 /// One can construct a UsdShadeConnectableAPI directly from a UsdPrim, or
65 /// from objects of any of the schema classes listed above. If it seems
66 /// onerous to need to construct a secondary schema object to interact with
67 /// Inputs and Outputs, keep in mind that any function whose purpose is either
68 /// to walk material/shader networks via their connections, or to create such
69 /// networks, can typically be written entirely in terms of
70 /// UsdShadeConnectableAPI objects, without needing to care what the underlying
71 /// prim type is.
72 ///
73 /// Additionally, the most common UsdShadeConnectableAPI behaviors
74 /// (creating Inputs and Outputs, and making connections) are wrapped as
75 /// convenience methods on the prim schema classes (creation) and
76 /// UsdShadeInput and UsdShadeOutput.
77 ///
78 ///
80 {
81 public:
82  /// Compile time constant representing what kind of schema this class is.
83  ///
84  /// \sa UsdSchemaType
86 
87  /// Construct a UsdShadeConnectableAPI on UsdPrim \p prim .
88  /// Equivalent to UsdShadeConnectableAPI::Get(prim.GetStage(), prim.GetPath())
89  /// for a \em valid \p prim, but will not immediately throw an error for
90  /// an invalid \p prim
91  explicit UsdShadeConnectableAPI(const UsdPrim& prim=UsdPrim())
92  : UsdAPISchemaBase(prim)
93  {
94  }
95 
96  /// Construct a UsdShadeConnectableAPI on the prim held by \p schemaObj .
97  /// Should be preferred over UsdShadeConnectableAPI(schemaObj.GetPrim()),
98  /// as it preserves SchemaBase state.
99  explicit UsdShadeConnectableAPI(const UsdSchemaBase& schemaObj)
100  : UsdAPISchemaBase(schemaObj)
101  {
102  }
103 
104  /// Destructor.
106  virtual ~UsdShadeConnectableAPI();
107 
108  /// Return a vector of names of all pre-declared attributes for this schema
109  /// class and all its ancestor classes. Does not include attributes that
110  /// may be authored by custom/extended methods of the schemas involved.
112  static const TfTokenVector &
113  GetSchemaAttributeNames(bool includeInherited=true);
114 
115  /// Return a UsdShadeConnectableAPI holding the prim adhering to this
116  /// schema at \p path on \p stage. If no prim exists at \p path on
117  /// \p stage, or if the prim at that path does not adhere to this schema,
118  /// return an invalid schema object. This is shorthand for the following:
119  ///
120  /// \code
121  /// UsdShadeConnectableAPI(stage->GetPrimAtPath(path));
122  /// \endcode
123  ///
126  Get(const UsdStagePtr &stage, const SdfPath &path);
127 
128 
129 protected:
130  /// Returns the type of schema this class belongs to.
131  ///
132  /// \sa UsdSchemaType
134  UsdSchemaType _GetSchemaType() const override;
135 
136 private:
137  // needs to invoke _GetStaticTfType.
138  friend class UsdSchemaRegistry;
140  static const TfType &_GetStaticTfType();
141 
142  static bool _IsTypedSchema();
143 
144  // override SchemaBase virtuals.
146  const TfType &_GetTfType() const override;
147 
148 public:
149  // ===================================================================== //
150  // Feel free to add custom code below this line, it will be preserved by
151  // the code generator.
152  //
153  // Just remember to:
154  // - Close the class declaration with };
155  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
156  // - Close the include guard with #endif
157  // ===================================================================== //
158  // --(BEGIN CUSTOM CODE)--
159 
160 protected:
161  /// Returns true if the given prim is compatible with this API schema,
162  /// i.e. if it is a valid shader or a node-graph.
164  bool _IsCompatible() const override;
165 
166 public:
167 
168  /// Constructor that takes a UsdShadeShader.
169  /// Allow implicit (auto) conversion of UsdShadeShader to
170  /// UsdShadeConnectableAPI, so that a shader can be passed into any function
171  /// that accepts a ConnectableAPI.
174  { }
175 
176  /// Constructor that takes a UsdShadeNodeGraph.
177  /// Allow implicit (auto) conversion of UsdShadeNodeGraph to
178  /// UsdShadeConnectableAPI, so that a nodegraph can be passed into any function
179  /// that accepts a ConnectableAPI.
181  UsdShadeConnectableAPI(nodeGraph.GetPrim())
182  { }
183 
184  /// Returns true if the prim is a shader.
186  bool IsShader() const;
187 
188  /// Returns true if the prim is a node-graph.
190  bool IsNodeGraph() const;
191 
192  /// \name Connections
193  ///
194  /// Inputs and outputs on shaders and node-graphs are connectable.
195  /// This section provides API for authoring and managing these connections
196  /// in a shading network.
197  ///
198  /// @{
199 
200  /// Determines whether the given input can be connected to the given
201  /// source attribute, which can be an input or an output.
202  ///
203  /// The result depends on the "connectability" of the input and the source
204  /// attributes.
205  ///
206  /// \sa UsdShadeInput::SetConnectability
207  /// \sa UsdShadeInput::GetConnectability
209  static bool CanConnect(const UsdShadeInput &input,
210  const UsdAttribute &source);
211 
212  /// \overload
214  static bool CanConnect(const UsdShadeInput &input,
215  const UsdShadeInput &sourceInput) {
216  return CanConnect(input, sourceInput.GetAttr());
217  }
218 
219  /// \overload
221  static bool CanConnect(const UsdShadeInput &input,
222  const UsdShadeOutput &sourceOutput) {
223  return CanConnect(input, sourceOutput.GetAttr());
224  }
225 
226  /// Determines whether the given output can be connected to the given
227  /// source attribute, which can be an input or an output.
228  ///
229  /// An output is considered to be connectable only if it belongs to a
230  /// node-graph. Shader outputs are not connectable.
231  ///
232  /// \p source is an optional argument. If a valid UsdAttribute is supplied
233  /// for it, this method will return true only if the source attribute is
234  /// owned by a descendant of the node-graph owning the output.
235  ///
237  static bool CanConnect(const UsdShadeOutput &output,
238  const UsdAttribute &source=UsdAttribute());
239 
240  /// \overload
242  static bool CanConnect(const UsdShadeOutput &output,
243  const UsdShadeInput &sourceInput) {
244  return CanConnect(output, sourceInput.GetAttr());
245  }
246 
247  /// \overload
249  static bool CanConnect(const UsdShadeOutput &output,
250  const UsdShadeOutput &sourceOutput) {
251  return CanConnect(output, sourceOutput.GetAttr());
252  }
253 
254  /// Authors a connection for a given shading attribute \p shadingAttr.
255  ///
256  /// \p shadingAttr can represent a parameter, an input or an output.
257  /// \p sourceName is the name of the shading attribute that is the target
258  /// of the connection. This excludes any namespace prefix that determines
259  /// the type of the source (eg, output).
260  /// \p sourceType is used to indicate the type of the shading attribute
261  /// that is the target of the connection. The source type is used to
262  /// determine the namespace prefix that must be attached to \p sourceName
263  /// to determine the source full attribute name.
264  /// \p typeName if specified, is the typename of the attribute to create
265  /// on the source if it doesn't exist. It is also used to validate whether
266  /// the types of the source and consumer of the connection are compatible.
267  /// \p source is the connectable prim that produces or contains a value
268  /// for the given shading attribute.
269  ///
270  /// \return
271  /// \c true if a connection was created successfully.
272  /// \c false if \p shadingAttr or \p source is invalid.
273  ///
274  /// \note This method does not verify the connectability of the shading
275  /// attribute to the source. Clients must invoke CanConnect() themselves
276  /// to ensure compatibility.
277  /// \note The source shading attribute is created if it doesn't exist
278  /// already.
279  ///
281  static bool ConnectToSource(
282  UsdAttribute const &shadingAttr,
284  TfToken const &sourceName,
287 
288  /// \overload
290  static bool ConnectToSource(
291  UsdShadeInput const &input,
292  UsdShadeConnectableAPI const &source,
293  TfToken const &sourceName,
296  {
297  return ConnectToSource(input.GetAttr(), source, sourceName, sourceType,
298  typeName);
299  }
300 
301  /// \overload
303  static bool ConnectToSource(
304  UsdShadeOutput const &output,
305  UsdShadeConnectableAPI const &source,
306  TfToken const &sourceName,
309  {
310  return ConnectToSource(output.GetAttr(), source, sourceName, sourceType,
311  typeName);
312  }
313 
314  /// \overload
315  ///
316  /// Connect the given shading attribute to the source at path, \p sourcePath.
317  ///
318  /// \p sourcePath should be the fully namespaced property path.
319  ///
320  /// This overload is provided for convenience, for use in contexts where
321  /// the prim types are unknown or unavailable.
322  ///
324  static bool ConnectToSource(UsdAttribute const &shadingAttr,
325  SdfPath const &sourcePath);
326 
327  /// \overload
329  static bool ConnectToSource(UsdShadeInput const &input,
330  SdfPath const &sourcePath) {
331  return ConnectToSource(input.GetAttr(), sourcePath);
332  }
333 
334  /// \overload
336  static bool ConnectToSource(UsdShadeOutput const &output,
337  SdfPath const &sourcePath) {
338  return ConnectToSource(output.GetAttr(), sourcePath);
339  }
340 
341  /// \overload
342  ///
343  /// Connect the given shading attribute to the given source input.
344  ///
346  static bool ConnectToSource(UsdAttribute const &shadingAttr,
347  UsdShadeInput const &sourceInput);
348 
349  /// \overload
351  static bool ConnectToSource(UsdShadeInput const &input,
352  UsdShadeInput const &sourceInput) {
353  return ConnectToSource(input.GetAttr(), sourceInput);
354  }
355 
356  /// \overload
358  static bool ConnectToSource(UsdShadeOutput const &output,
359  UsdShadeInput const &sourceInput) {
360  return ConnectToSource(output.GetAttr(), sourceInput);
361  }
362 
363  /// \overload
364  ///
365  /// Connect the given shading attribute to the given source output.
366  ///
368  static bool ConnectToSource(UsdAttribute const &shadingAttr,
369  UsdShadeOutput const &sourceOutput);
370 
371  /// \overload
373  static bool ConnectToSource(UsdShadeInput const &input,
374  UsdShadeOutput const &sourceOutput) {
375  return ConnectToSource(input.GetAttr(), sourceOutput);
376  }
377 
378  /// \overload
380  static bool ConnectToSource(UsdShadeOutput const &output,
381  UsdShadeOutput const &sourceOutput) {
382  return ConnectToSource(output.GetAttr(), sourceOutput);
383  }
384 
385 
386  /// Finds the source of a connection for the given shading attribute.
387  ///
388  /// \p shadingAttr is the shading attribute whose connection we want to
389  /// interrogate.
390  /// \p source is an output parameter which will be set to the source
391  /// connectable prim.
392  /// \p sourceName will be set to the name of the source shading attribute,
393  /// which may be an input or an output, as specified by \p sourceType
394  /// \p sourceType will have the type of the source shading attribute, i.e.
395  /// whether it is an \c Input or \c Output
396  ///
397  /// \return
398  /// \c true if the shading attribute is connected to a valid, defined source
399  /// attribute.
400  /// \c false if the shading attribute is not connected to a single, defined
401  /// source attribute.
402  ///
403  /// \note The python wrapping for this method returns a
404  /// (source, sourceName, sourceType) tuple if the parameter is connected,
405  /// else \c None
406  ///
408  static bool GetConnectedSource(UsdAttribute const &shadingAttr,
409  UsdShadeConnectableAPI *source,
410  TfToken *sourceName,
411  UsdShadeAttributeType *sourceType);
412 
413  /// \overload
415  static bool GetConnectedSource(UsdShadeInput const &input,
416  UsdShadeConnectableAPI *source,
417  TfToken *sourceName,
418  UsdShadeAttributeType *sourceType) {
419  return GetConnectedSource(input.GetAttr(), source, sourceName,
420  sourceType);
421  }
422 
423  /// \overload
425  static bool GetConnectedSource(UsdShadeOutput const &output,
426  UsdShadeConnectableAPI *source,
427  TfToken *sourceName,
428  UsdShadeAttributeType *sourceType) {
429  return GetConnectedSource(output.GetAttr(), source, sourceName,
430  sourceType);
431  }
432 
433  /// Returns the "raw" (authored) connected source paths for the given
434  /// shading attribute.
435  ///
437  static bool GetRawConnectedSourcePaths(UsdAttribute const &shadingAttr,
438  SdfPathVector *sourcePaths);
439 
440  /// \overload
442  static bool GetRawConnectedSourcePaths(UsdShadeInput const &input,
443  SdfPathVector *sourcePaths) {
444  return GetRawConnectedSourcePaths(input.GetAttr(), sourcePaths);
445  }
446 
447  /// \overload
449  static bool GetRawConnectedSourcePaths(UsdShadeOutput const &output,
450  SdfPathVector *sourcePaths) {
451  return GetRawConnectedSourcePaths(output.GetAttr(), sourcePaths);
452  }
453 
454  /// Returns true if and only if the shading attribute is currently connected
455  /// to a valid (defined) source.
456  ///
457  /// If you will be calling GetConnectedSource() afterwards anyways,
458  /// it will be \em much faster to instead guard like so:
459  /// \code
460  /// if (UsdShadeConnectableAPI::GetConnectedSource(attribute, &source,
461  /// &sourceName, &sourceType)){
462  /// // process connected attribute
463  /// } else {
464  /// // process unconnected attribute
465  /// }
466  /// \endcode
468  static bool HasConnectedSource(const UsdAttribute &shadingAttr);
469 
470  /// \overload
472  static bool HasConnectedSource(const UsdShadeInput &input) {
473  return HasConnectedSource(input.GetAttr());
474  }
475 
476  /// \overload
478  static bool HasConnectedSource(const UsdShadeOutput &output) {
479  return HasConnectedSource(output.GetAttr());
480  }
481 
482  /// Returns true if the connection to the given shading attribute's source,
483  /// as returned by UsdShadeConnectableAPI::GetConnectedSource(), is authored
484  /// across a specializes arc, which is used to denote a base material.
485  ///
488  const UsdAttribute &shadingAttr);
489 
490  /// \overload
494  }
495 
496  /// \overload
499  {
501  }
502 
503  /// Disconnect source for this shading attribute.
504  ///
505  /// This may author more scene description than you might expect - we define
506  /// the behavior of disconnect to be that, even if a shading attribute
507  /// becomes connected in a weaker layer than the current UsdEditTarget, the
508  /// attribute will \em still be disconnected in the composition, therefore
509  /// we must "block" it (see for e.g. UsdRelationship::BlockTargets()) in
510  /// the current UsdEditTarget.
511  ///
512  /// \sa ConnectToSource().
514  static bool DisconnectSource(UsdAttribute const &shadingAttr);
515 
516  /// \overload
518  static bool DisconnectSource(UsdShadeInput const &input) {
519  return DisconnectSource(input.GetAttr());
520  }
521 
522  /// \overload
524  static bool DisconnectSource(UsdShadeOutput const &output) {
525  return DisconnectSource(output.GetAttr());
526  }
527 
528  /// Clears source for this shading attribute in the current UsdEditTarget.
529  ///
530  /// Most of the time, what you probably want is DisconnectSource()
531  /// rather than this function.
532  ///
533  /// \sa DisconnectSource()
535  static bool ClearSource(UsdAttribute const &shadingAttr);
536 
537  /// \overload
539  static bool ClearSource(UsdShadeInput const &input) {
540  return ClearSource(input.GetAttr());
541  }
542 
543  /// \overload
545  static bool ClearSource(UsdShadeOutput const &output) {
546  return ClearSource(output.GetAttr());
547  }
548 
549  /// @}
550 
551 
552  /// \name Outputs
553  /// @{
554 
555  /// Create an output, which represents and externally computed, typed value.
556  /// Outputs on node-graphs can be connected.
557  ///
558  /// The attribute representing an output is created in the "outputs:"
559  /// namespace.
560  ///
563  const SdfValueTypeName& typeName) const;
564 
565  /// Return the requested output if it exists.
566  ///
567  /// \p name is the unnamespaced base name.
568  ///
570  UsdShadeOutput GetOutput(const TfToken &name) const;
571 
572  /// Returns all outputs on the connectable prim (i.e. shader or node-graph).
573  /// Outputs are represented by attributes in the "outputs:" namespace.
574  ///
576  std::vector<UsdShadeOutput> GetOutputs() const;
577 
578  /// @}
579 
580  /// \name Inputs
581  /// @{
582 
583  /// Create an input which can both have a value and be connected.
584  /// The attribute representing the input is created in the "inputs:"
585  /// namespace.
586  ///
589  const SdfValueTypeName& typeName) const;
590 
591  /// Return the requested input if it exists.
592  ///
593  /// \p name is the unnamespaced base name.
594  ///
596  UsdShadeInput GetInput(const TfToken &name) const;
597 
598  /// Returns all inputs on the connectable prim (i.e. shader or node-graph).
599  /// Inputs are represented by attributes in the "inputs:" namespace.
600  ///
602  std::vector<UsdShadeInput> GetInputs() const;
603 
604  /// @}
605 
606 };
607 
609 
610 #endif
USDSHADE_API UsdSchemaType _GetSchemaType() const override
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, SdfPath const &sourcePath)
#define USDSHADE_API
Definition: api.h:40
GLenum GLenum GLenum input
Definition: glew.h:13879
static USDSHADE_API bool GetConnectedSource(UsdShadeOutput const &output, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
static USDSHADE_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
GLuint const GLchar * name
Definition: glew.h:1814
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdShadeInput const &input, SdfPathVector *sourcePaths)
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdShadeOutput &output)
static USDSHADE_API bool DisconnectSource(UsdAttribute const &shadingAttr)
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 ConnectToSource(UsdShadeInput const &input, UsdShadeInput const &sourceInput)
static USDSHADE_API bool ClearSource(UsdShadeInput const &input)
USDSHADE_API UsdShadeInput GetInput(const TfToken &name) const
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 ConnectToSource(UsdShadeInput const &input, UsdShadeOutput const &sourceOutput)
GLsizei GLsizei GLchar * source
Definition: glew.h:1832
static USDSHADE_API bool CanConnect(const UsdShadeOutput &output, const UsdShadeInput &sourceInput)
GLuint shader
Definition: glew.h:1813
static USDSHADE_API bool CanConnect(const UsdShadeInput &input, const UsdShadeInput &sourceInput)
UsdShadeConnectableAPI(const UsdShadeNodeGraph &nodeGraph)
static USDSHADE_API UsdShadeConnectableAPI Get(const UsdStagePtr &stage, const SdfPath &path)
USDSHADE_API bool IsShader() const
Returns true if the prim is a shader.
USDSHADE_API UsdShadeOutput GetOutput(const TfToken &name) const
USDSHADE_API std::vector< UsdShadeOutput > GetOutputs() const
Definition: token.h:87
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdAttribute const &shadingAttr, SdfPathVector *sourcePaths)
UsdShadeConnectableAPI(const UsdSchemaBase &schemaObj)
static USDSHADE_API bool HasConnectedSource(const UsdShadeInput &input)
Non-applied API schema.
static USDSHADE_API bool HasConnectedSource(const UsdAttribute &shadingAttr)
static USDSHADE_API bool ConnectToSource(UsdShadeInput const &input, SdfPath const &sourcePath)
static USDSHADE_API bool DisconnectSource(UsdShadeInput const &input)
UsdSchemaType
Definition: common.h:127
Definition: prim.h:132
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:446
Definition: path.h:288
UsdAttribute GetAttr() const
Explicit UsdAttribute extractor.
Definition: output.h:211
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
Definition: path.h:209
UsdShadeConnectableAPI(const UsdShadeShader &shader)
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, UsdShadeOutput const &sourceOutput)
GLsizei const GLchar *const * path
Definition: glew.h:6461
UsdShadeAttributeType
Definition: utils.h:42
virtual USDSHADE_API ~UsdShadeConnectableAPI()
Destructor.
static USDSHADE_API bool GetRawConnectedSourcePaths(UsdShadeOutput const &output, SdfPathVector *sourcePaths)
USDSHADE_API bool _IsCompatible() const override
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1346
static USDSHADE_API bool DisconnectSource(UsdShadeOutput const &output)
static USDSHADE_API bool ClearSource(UsdAttribute const &shadingAttr)
static USDSHADE_API bool ClearSource(UsdShadeOutput const &output)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
static USDSHADE_API bool GetConnectedSource(UsdAttribute const &shadingAttr, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)
USDSHADE_API UsdShadeInput CreateInput(const TfToken &name, const SdfValueTypeName &typeName) const
Definition: type.h:64
static USDSHADE_API bool CanConnect(const UsdShadeInput &input, const UsdAttribute &source)
const UsdAttribute & GetAttr() const
Explicit UsdAttribute extractor.
Definition: input.h:227
static USDSHADE_API bool CanConnect(const UsdShadeInput &input, const UsdShadeOutput &sourceOutput)
UsdShadeConnectableAPI(const UsdPrim &prim=UsdPrim())
USDSHADE_API std::vector< UsdShadeInput > GetInputs() const
static USDSHADE_API bool ConnectToSource(UsdAttribute const &shadingAttr, UsdShadeConnectableAPI const &source, TfToken const &sourceName, UsdShadeAttributeType const sourceType=UsdShadeAttributeType::Output, SdfValueTypeName typeName=SdfValueTypeName())
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdAttribute &shadingAttr)
static USDSHADE_API bool IsSourceConnectionFromBaseMaterial(const UsdShadeInput &input)
static USDSHADE_API bool HasConnectedSource(const UsdShadeOutput &output)
static USDSHADE_API bool ConnectToSource(UsdShadeOutput const &output, UsdShadeInput const &sourceInput)
UsdPrim GetPrim() const
Return this schema object's held prim.
Definition: schemaBase.h:119
static USDSHADE_API bool CanConnect(const UsdShadeOutput &output, const UsdShadeOutput &sourceOutput)
USDSHADE_API bool IsNodeGraph() const
Returns true if the prim is a node-graph.
USDSHADE_API UsdShadeOutput CreateOutput(const TfToken &name, const SdfValueTypeName &typeName) const
static const UsdSchemaType schemaType
static USDSHADE_API bool GetConnectedSource(UsdShadeInput const &input, UsdShadeConnectableAPI *source, TfToken *sourceName, UsdShadeAttributeType *sourceType)