HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bakeMaterialX.h
Go to the documentation of this file.
1 //
2 // Copyright 2022 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 
8 #ifndef PXR_USD_IMAGING_BIN_USD_BAKE_MTLX_BAKE_MATERIALX_H
9 #define PXR_USD_IMAGING_BIN_USD_BAKE_MTLX_BAKE_MATERIALX_H
10 
11 #include "pxr/pxr.h"
12 #include "pxr/usdImaging/bin/usdBakeMtlx/api.h"
13 
16 
17 #include <MaterialXCore/Library.h>
18 
20 #include <string>
21 
23  using FilePathVec = std::vector<class FilePath>;
24  class FileSearchPath;
26 
28 
30 
31 /// Read the MaterialX XML file at \p pathname convert and add to
32 /// the given USD \p stage.
34 UsdStageRefPtr UsdBakeMtlxReadDocToStage(std::string const &pathname,
35  UsdStageRefPtr stage);
36 
37 /// Convert the given MaterialX Material from a UsdShadeaMaterial into a
38 /// MaterialX Document and Bake it using MaterialX::TextureBaker, storing
39 /// the resulting mtlx Document at \p bakedMtlxFilename. Any resulting
40 /// textures from the baking process will live in the same directory.
42 std::string UsdBakeMtlxBakeMaterial(
43  UsdShadeMaterial const& mtlxMaterial,
44  std::string const& bakedMtlxDir,
45  int textureWidth,
46  int textureHeight,
47  bool bakeHdr,
48  bool bakeAverage);
49 
50 
52 
53 #endif // PXR_USD_IMAGING_BIN_USD_BAKE_MTLX_BAKE_MATERIALX_H
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
MATERIALX_NAMESPACE_END PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_AND_REF_PTRS(UsdStage)
#define USDBAKEMTLX_API
Definition: api.h:23
USDBAKEMTLX_API std::string UsdBakeMtlxBakeMaterial(UsdShadeMaterial const &mtlxMaterial, std::string const &bakedMtlxDir, int textureWidth, int textureHeight, bool bakeHdr, bool bakeAverage)
vector< FilePath > FilePathVec
Definition: File.h:19
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
USDBAKEMTLX_API UsdStageRefPtr UsdBakeMtlxReadDocToStage(std::string const &pathname, UsdStageRefPtr stage)