HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
materialBindingsSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 ////////////////////////////////////////////////////////////////////////
8 
9 /* ************************************************************************** */
10 /* ** ** */
11 /* ** This file is generated by a script. ** */
12 /* ** ** */
13 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14 /* ** Edit hdSchemaDefs.py instead to make changes. ** */
15 /* ** ** */
16 /* ************************************************************************** */
17 
18 #ifndef PXR_USD_IMAGING_USD_IMAGING_MATERIAL_BINDINGS_SCHEMA_H
19 #define PXR_USD_IMAGING_USD_IMAGING_MATERIAL_BINDINGS_SCHEMA_H
20 
21 /// \file
22 
24 
25 #include "pxr/imaging/hd/schema.h"
26 
27 // --(BEGIN CUSTOM CODE: Includes)--
29 // --(END CUSTOM CODE: Includes)--
30 
32 
33 // --(BEGIN CUSTOM CODE: Declares)--
36 // --(END CUSTOM CODE: Declares)--
37 
38 #define USD_IMAGING_MATERIAL_BINDINGS_SCHEMA_TOKENS \
39  (usdMaterialBindings) \
40  ((allPurpose, "")) \
41 
42 TF_DECLARE_PUBLIC_TOKENS(UsdImagingMaterialBindingsSchemaTokens, USDIMAGING_API,
44 
45 //-----------------------------------------------------------------------------
46 
47 // The UsdImagingMaterialBindingsSchema specifies a container for all the
48 // material bindings declared on a prim. The material binding purpose serves
49 // as the key, with the value being a vector of
50 // UsdImagingMaterialBindingSchema. While one entry (element) would suffice
51 // for a prim's material bindings opinion, we use a vector for aggregating
52 // ancestor material bindings to model the inheritance semantics of
53 // UsdShadeMaterialBindingAPI.
54 //
55 
57 {
58 public:
59  /// \name Schema retrieval
60  /// @{
61 
62  UsdImagingMaterialBindingsSchema(HdContainerDataSourceHandle container)
63  : HdSchema(container) {}
64 
65  /// Retrieves a container data source with the schema's default name token
66  /// "usdMaterialBindings" from the parent container and constructs a
67  /// UsdImagingMaterialBindingsSchema instance.
68  /// Because the requested container data source may not exist, the result
69  /// should be checked with IsDefined() or a bool comparison before use.
72  const HdContainerDataSourceHandle &fromParentContainer);
73 
74  /// @}
75 
76 // --(BEGIN CUSTOM CODE: Schema Methods)--
77 
78  /// Returns the purposes for which bindings may be available.
79  /// \note This API is preferable to schema.GetContainer()->GetNames().
81  TfTokenVector GetPurposes() const;
82 
83  /// Returns the bindings for 'allPurpose'.
86 
87  /// Returns the bindings for the given purpose.
90  GetMaterialBindings(const TfToken &purpose) const;
91 
92 // --(END CUSTOM CODE: Schema Methods)--
93 
94  /// \name Member accessor
95  /// @{
96 
97  /// @}
98 
99  /// \name Schema location
100  /// @{
101 
102  /// Returns a token where the container representing this schema is found in
103  /// a container by default.
105  static const TfToken &GetSchemaToken();
106 
107  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
108  /// where the container representing this schema is found by default.
110  static const HdDataSourceLocator &GetDefaultLocator();
111 
112  /// @}
113 
114  /// \name Schema construction
115  /// @{
116 
117  /// @}
118 };
119 
121 
122 #endif
UsdImagingMaterialBindingsSchema(HdContainerDataSourceHandle container)
#define USDIMAGING_API
Definition: api.h:23
static USDIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
static USDIMAGING_API UsdImagingMaterialBindingsSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
static USDIMAGING_API const TfToken & GetSchemaToken()
USDIMAGING_API UsdImagingMaterialBindingVectorSchema GetMaterialBindings() const
Returns the bindings for 'allPurpose'.
TF_DECLARE_PUBLIC_TOKENS(HdMaterialBindingsSchemaTokens, HD_API, HD_MATERIAL_BINDINGS_SCHEMA_TOKENS)
Definition: token.h:70
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
#define USD_IMAGING_MATERIAL_BINDINGS_SCHEMA_TOKENS
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDIMAGING_API TfTokenVector GetPurposes() const