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