7#ifndef EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_PXR_IMAGING_HD_MTLX_HDMTLX_H
8#define EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_PXR_IMAGING_HD_MTLX_HDMTLX_H
15#if PXR_VERSION >= 2608
16#include <pxr/imaging/hdMtlx/hdMtlx.h>
20#include "pxr/imaging/hdMtlx/api.h"
24#include <unordered_map>
26#include <MaterialXCore/Library.h>
28MATERIALX_NAMESPACE_BEGIN
30 using DocumentPtr = std::shared_ptr<class Document>;
31 using NodeDefPtr = std::shared_ptr<class NodeDef>;
32MATERIALX_NAMESPACE_END
34PXR_NAMESPACE_OPEN_SCOPE
36#define HdMtlxSearchPaths HdMtlxPrmanSearchPaths
37#define HdMtlxStdLibraries HdMtlxPrmanStdLibraries
38#define HdMtlxCreateNameFromPath HdMtlxPrmanCreateNameFromPath
39#define HdMtlxCreateMtlxDocumentFromHdMaterialNetworkInterface HdMtlxPrmanCreateMtlxDocumentFromHdMaterialNetworkInterface
40#define HdMtlxGetNodeDef HdMtlxPrmanGetNodeDef
41#define HdMtlxGetNodeDefName HdMtlxPrmanGetNodeDefName
42#define HdMtlxGetMxTerminalName HdMtlxPrmanGetMxTerminalName
55const MaterialX::FileSearchPath&
56HdMtlxPrmanSearchPaths();
61const MaterialX::DocumentPtr&
62HdMtlxPrmanStdLibraries();
67HdMtlxPrmanConvertToString(
VtValue const& hdParameterValue);
70struct HdMtlxTexturePrimvarData {
71 HdMtlxTexturePrimvarData() =
default;
72 using TextureMap = std::map<std::string, std::set<std::string>>;
73 TextureMap mxHdTextureMap;
74 std::set<SdfPath> hdTextureNodes;
75 std::set<SdfPath> hdPrimvarNodes;
80HdMtlxPrmanCreateNameFromPath(
SdfPath const& path);
91 MaterialX::DocumentPtr
const& mxDoc=
nullptr);
97HdMtlxPrmanGetNodeDefName(std::string
const& prevMxNodeDefName);
103HdMtlxPrmanGetMxTerminalName(
105 TfToken const& hdTerminalNodeName);
111HdMtlxPrmanGetMxTerminalName(std::string
const& mxTerminalType);
117MaterialX::DocumentPtr
118HdMtlxPrmanCreateMtlxDocumentFromHdNetwork(
121 SdfPath const& hdMaterialXNodePath,
123 MaterialX::DocumentPtr
const& libraries,
124 HdMtlxTexturePrimvarData *mxHdData =
nullptr);
128MaterialX::DocumentPtr
129HdMtlxPrmanCreateMtlxDocumentFromHdMaterialNetworkInterface(
131 TfToken const& terminalNodeName,
133 MaterialX::DocumentPtr
const& libraries,
134 HdMtlxTexturePrimvarData *mxHdData =
nullptr);
136PXR_NAMESPACE_CLOSE_SCOPE
Abstract interface for querying and mutating a material network.
A path value used to locate objects in layers or scenegraphs.
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...
Container of nodes and top-level terminal connections.
Describes an instance of a node within a network A node contains a (shader) type identifier,...
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.