forked from blender/blender
MaterialX: fix review comments #19
@ -210,6 +210,7 @@ if(WITH_OPENVDB)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_MATERIALX)
|
if(WITH_MATERIALX)
|
||||||
|
add_definitions(-DWITH_MATERIALX)
|
||||||
list(APPEND LIB MaterialXCore)
|
list(APPEND LIB MaterialXCore)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -12,8 +12,10 @@
|
|||||||
#include <pxr/imaging/hd/tokens.h>
|
#include <pxr/imaging/hd/tokens.h>
|
||||||
#include <pxr/usdImaging/usdImaging/materialParamUtils.h>
|
#include <pxr/usdImaging/usdImaging/materialParamUtils.h>
|
||||||
|
|
||||||
|
#ifdef WITH_MATERIALX
|
||||||
#include <pxr/usd/usdMtlx/reader.h>
|
#include <pxr/usd/usdMtlx/reader.h>
|
||||||
#include <pxr/usd/usdMtlx/utils.h>
|
#include <pxr/usd/usdMtlx/utils.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
@ -73,6 +75,7 @@ void MaterialData::init()
|
|||||||
image_cache_file_path()};
|
image_cache_file_path()};
|
||||||
/* Create USD material. */
|
/* Create USD material. */
|
||||||
pxr::UsdShadeMaterial usd_material;
|
pxr::UsdShadeMaterial usd_material;
|
||||||
|
#ifdef WITH_MATERIALX
|
||||||
if (scene_delegate_->use_materialx) {
|
if (scene_delegate_->use_materialx) {
|
||||||
MaterialX::DocumentPtr doc = blender::nodes::materialx::export_to_materialx(
|
MaterialX::DocumentPtr doc = blender::nodes::materialx::export_to_materialx(
|
||||||
scene_delegate_->depsgraph, (Material *)id);
|
scene_delegate_->depsgraph, (Material *)id);
|
||||||
@ -85,8 +88,12 @@ void MaterialData::init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
#endif
|
||||||
usd_material = usd::create_usd_material(export_context, material_path, (Material *)id, "st");
|
usd_material = usd::create_usd_material(export_context, material_path, (Material *)id, "st");
|
||||||
|
#ifdef WITH_MATERIALX
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
BogdanNagirniak marked this conversation as resolved
|
|||||||
|
|
||||||
/* Convert USD material to Hydra material network map, adapted for render delegate. */
|
/* Convert USD material to Hydra material network map, adapted for render delegate. */
|
||||||
const pxr::HdRenderDelegate *render_delegate =
|
const pxr::HdRenderDelegate *render_delegate =
|
||||||
|
Loading…
Reference in New Issue
Block a user
simplify to: