HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hdMtlx.h File Reference
#include "pxr/pxr.h"
#include "pxr/base/tf/token.h"
#include "pxr/imaging/hdMtlx/api.h"
#include <memory>
#include <set>
#include <unordered_map>
#include <MaterialXCore/Library.h>
+ Include dependency graph for hdMtlx.h:

Go to the source code of this file.

Typedefs

using DocumentPtr = std::shared_ptr< class Document >
 
using StringMap = std::unordered_map< std::string, std::string >
 

Functions

HDMTLX_API const
MaterialX::FileSearchPath & 
HdMtlxSearchPaths ()
 
HDMTLX_API std::string HdMtlxConvertToString (VtValue const &hdParameterValue)
 Converts the HdParameterValue to a string MaterialX can understand. More...
 
HDMTLX_API MaterialX::DocumentPtr HdMtlxCreateMtlxDocumentFromHdNetwork (HdMaterialNetwork2 const &hdNetwork, HdMaterialNode2 const &hdMaterialXNode, SdfPath const &hdMaterialXNodePath, SdfPath const &materialPath, MaterialX::DocumentPtr const &libraries, std::set< SdfPath > *hdTextureNodes=nullptr, MaterialX::StringMap *mxHdTextureMap=nullptr, std::set< SdfPath > *hdPrimvarNodes=nullptr)
 
HDMTLX_API MaterialX::DocumentPtr HdMtlxCreateMtlxDocumentFromHdMaterialNetworkInterface (HdMaterialNetworkInterface *netInterface, TfToken const &terminalNodeName, TfTokenVector const &terminalNodeConnectionNames, MaterialX::DocumentPtr const &libraries, std::set< SdfPath > *hdTextureNodes=nullptr, MaterialX::StringMap *mxHdTextureMap=nullptr, std::set< SdfPath > *hdPrimvarNodes=nullptr)
 Implementation that uses the material network interface. More...
 

Typedef Documentation

using DocumentPtr = std::shared_ptr<class Document>

Definition at line 38 of file hdMtlx.h.

using StringMap = std::unordered_map<std::string, std::string>

Definition at line 39 of file hdMtlx.h.

Function Documentation

HDMTLX_API std::string HdMtlxConvertToString ( VtValue const hdParameterValue)

Converts the HdParameterValue to a string MaterialX can understand.

HDMTLX_API MaterialX::DocumentPtr HdMtlxCreateMtlxDocumentFromHdMaterialNetworkInterface ( HdMaterialNetworkInterface netInterface,
TfToken const terminalNodeName,
TfTokenVector const terminalNodeConnectionNames,
MaterialX::DocumentPtr const libraries,
std::set< SdfPath > *  hdTextureNodes = nullptr,
MaterialX::StringMap mxHdTextureMap = nullptr,
std::set< SdfPath > *  hdPrimvarNodes = nullptr 
)

Implementation that uses the material network interface.

HDMTLX_API MaterialX::DocumentPtr HdMtlxCreateMtlxDocumentFromHdNetwork ( HdMaterialNetwork2 const hdNetwork,
HdMaterialNode2 const hdMaterialXNode,
SdfPath const hdMaterialXNodePath,
SdfPath const materialPath,
MaterialX::DocumentPtr const libraries,
std::set< SdfPath > *  hdTextureNodes = nullptr,
MaterialX::StringMap mxHdTextureMap = nullptr,
std::set< SdfPath > *  hdPrimvarNodes = nullptr 
)

Creates and returns a MaterialX Document from the given HdMaterialNetwork2 Collecting the hdTextureNodes as the HdMaterialNetwork2 is traversed as well as the Texture name mapping between MaterialX and Hydra

HDMTLX_API const MaterialX::FileSearchPath& HdMtlxSearchPaths ( )

Return the MaterialX search paths. In order, this includes:

  • Paths set in the environment variable 'PXR_MTLX_PLUGIN_SEARCH_PATHS'
  • Paths set in the environment variable 'PXR_MTLX_STDLIB_SEARCH_PATHS'
  • Path to the MaterialX standard library discovered at build time.