forked from blender/blender
MaterialX: make caching image in MaterialX independent from bf_usd
project
#31
@ -140,12 +140,13 @@ NODE_SHADER_MATERIALX_BEGIN
|
||||
}
|
||||
|
||||
NodeTexEnvironment *tex_env = static_cast<NodeTexEnvironment *>(node_->storage);
|
||||
|
||||
std::string image_path = image->id.name;
|
||||
if (export_image_fn_) {
|
||||
Scene *scene = DEG_get_input_scene(depsgraph_);
|
||||
Main *bmain = DEG_get_bmain(depsgraph_);
|
||||
|
||||
std::string image_path = export_image_fn_ ?
|
||||
export_image_fn_(bmain, scene, image, &tex_env->iuser) :
|
||||
image->id.name;
|
||||
image_path = export_image_fn_(bmain, scene, image, &tex_env->iuser);
|
||||
}
|
||||
|
||||
NodeItem vector = get_input_link("Vector", NodeItem::Type::Vector2);
|
||||
if (!vector) {
|
||||
|
@ -189,12 +189,13 @@ NODE_SHADER_MATERIALX_BEGIN
|
||||
Image *image = (Image *)node_->id;
|
||||
if (image) {
|
||||
NodeTexImage *tex_image = static_cast<NodeTexImage *>(node_->storage);
|
||||
|
||||
std::string image_path = image->id.name;
|
||||
if (export_image_fn_) {
|
||||
Scene *scene = DEG_get_input_scene(depsgraph_);
|
||||
Main *bmain = DEG_get_bmain(depsgraph_);
|
||||
|
||||
std::string image_path = export_image_fn_ ?
|
||||
export_image_fn_(bmain, scene, image, &tex_image->iuser) :
|
||||
image->id.name;
|
||||
image_path = export_image_fn_(bmain, scene, image, &tex_image->iuser);
|
||||
}
|
||||
|
||||
NodeItem vector = get_input_link("Vector", NodeItem::Type::Vector2);
|
||||
if (!vector) {
|
||||
|
Loading…
Reference in New Issue
Block a user