25#ifndef PXR_USD_USDMTLX_UTILS_H
26#define PXR_USD_USDMTLX_UTILS_H
29#include "pxr/usd/usdMtlx/api.h"
31#include "pxr/usd/sdf/valueTypeName.h"
33#include "pxr/base/vt/value.h"
34#include <MaterialXCore/Document.h>
38PXR_NAMESPACE_OPEN_SCOPE
40#define USD_MTLX_TOKENS \
41 ((DefaultOutputName, "out"))
50UsdMtlxStandardLibraryPaths();
56UsdMtlxCustomSearchPaths();
70UsdMtlxStandardFileExtensions();
79UsdMtlxReadDocument(
const std::string& resolvedPath);
86MaterialX::ConstDocumentPtr
87UsdMtlxGetDocument(
const std::string& resolvedUri);
92MaterialX::ConstDocumentPtr
93UsdMtlxGetDocumentFromString(
const std::string &mtlxXml);
103UsdMtlxGetVersion(
const MaterialX::ConstInterfaceElementPtr& mtlx,
104 bool* implicitDefault =
nullptr);
112UsdMtlxGetSourceURI(
const MaterialX::ConstElementPtr& element);
148UsdMtlxGetUsdType(
const std::string& mtlxTypeName);
157UsdMtlxGetUsdValue(
const MaterialX::ConstElementPtr& mtlx,
158 bool getDefaultValue =
false);
164UsdMtlxGetPackedUsdValues(
const std::string& values,
const std::string& type);
176std::vector<std::string>
177UsdMtlxSplitStringArray(
const std::string& s);
179PXR_NAMESPACE_CLOSE_SCOPE
Represents a value type name, i.e.
Token for efficient comparison, assignment, and hashing of known strings.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Result of UsdMtlxGetUsdType().
TfToken shaderPropertyType
The exact SdrShaderProperty type name.
int arraySize
If the value type is a fixed-size array/tuple, this will be greater then zero.
bool valueTypeNameIsExact
true iff the value type name is an exact match to the MaterialX type.
SdfValueTypeName valueTypeName
The value type name that most closely matches the MaterialX type.
Common typedefs that are used throughout the NDR library.