All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
materialXConfigAPI.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 USDMTLX_GENERATED_MATERIALXCONFIGAPI_H
8#define USDMTLX_GENERATED_MATERIALXCONFIGAPI_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdMtlx/api.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
19#include "pxr/base/vt/value.h"
20
21#include "pxr/base/gf/vec3d.h"
22#include "pxr/base/gf/vec3f.h"
24
25#include "pxr/base/tf/token.h"
26#include "pxr/base/tf/type.h"
27
28PXR_NAMESPACE_OPEN_SCOPE
29
30class SdfAssetPath;
31
32// -------------------------------------------------------------------------- //
33// MATERIALXCONFIGAPI //
34// -------------------------------------------------------------------------- //
35
48{
49public:
53 static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
54
60 : UsdAPISchemaBase(prim)
61 {
62 }
63
67 explicit UsdMtlxMaterialXConfigAPI(const UsdSchemaBase& schemaObj)
68 : UsdAPISchemaBase(schemaObj)
69 {
70 }
71
73 USDMTLX_API
75
79 USDMTLX_API
80 static const TfTokenVector &
81 GetSchemaAttributeNames(bool includeInherited=true);
82
92 USDMTLX_API
94 Get(const UsdStagePtr &stage, const SdfPath &path);
95
96
113 USDMTLX_API
114 static bool
115 CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
116
132 USDMTLX_API
134 Apply(const UsdPrim &prim);
135
136protected:
140 USDMTLX_API
142
143private:
144 // needs to invoke _GetStaticTfType.
145 friend class UsdSchemaRegistry;
146 USDMTLX_API
147 static const TfType &_GetStaticTfType();
148
149 static bool _IsTypedSchema();
150
151 // override SchemaBase virtuals.
152 USDMTLX_API
153 const TfType &_GetTfType() const override;
154
155public:
156 // --------------------------------------------------------------------- //
157 // CONFIGMTLXVERSION
158 // --------------------------------------------------------------------- //
167 USDMTLX_API
169
175 USDMTLX_API
176 UsdAttribute CreateConfigMtlxVersionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
177
178public:
179 // ===================================================================== //
180 // Feel free to add custom code below this line, it will be preserved by
181 // the code generator.
182 //
183 // Just remember to:
184 // - Close the class declaration with };
185 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
186 // - Close the include guard with #endif
187 // ===================================================================== //
188 // --(BEGIN CUSTOM CODE)--
189};
190
191PXR_NAMESPACE_CLOSE_SCOPE
192
193#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
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
MaterialXConfigAPI is an API schema that provides an interface for storing information about the Mate...
USDMTLX_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
UsdMtlxMaterialXConfigAPI(const UsdSchemaBase &schemaObj)
Construct a UsdMtlxMaterialXConfigAPI on the prim held by schemaObj .
static USDMTLX_API UsdMtlxMaterialXConfigAPI Apply(const UsdPrim &prim)
Applies this single-apply API schema to the given prim.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
static USDMTLX_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...
USDMTLX_API UsdAttribute GetConfigMtlxVersionAttr() const
MaterialX library version that the data has been authored against.
virtual USDMTLX_API ~UsdMtlxMaterialXConfigAPI()
Destructor.
USDMTLX_API UsdAttribute CreateConfigMtlxVersionAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetConfigMtlxVersionAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
static USDMTLX_API UsdMtlxMaterialXConfigAPI Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdMtlxMaterialXConfigAPI holding the prim adhering to this schema at path on stage.
UsdMtlxMaterialXConfigAPI(const UsdPrim &prim=UsdPrim())
Construct a UsdMtlxMaterialXConfigAPI on UsdPrim prim .
static USDMTLX_API bool CanApply(const UsdPrim &prim, std::string *whyNot=nullptr)
Returns true if this single-apply API schema can be applied to the given prim.
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
Singleton registry that provides access to schema type information and the prim definitions for regis...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
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