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);
|
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_);
|
Scene *scene = DEG_get_input_scene(depsgraph_);
|
||||||
Main *bmain = DEG_get_bmain(depsgraph_);
|
Main *bmain = DEG_get_bmain(depsgraph_);
|
||||||
|
image_path = export_image_fn_(bmain, scene, image, &tex_env->iuser);
|
||||||
std::string image_path = export_image_fn_ ?
|
}
|
||||||
export_image_fn_(bmain, scene, image, &tex_env->iuser) :
|
|
||||||
image->id.name;
|
|
||||||
|
|
||||||
NodeItem vector = get_input_link("Vector", NodeItem::Type::Vector2);
|
NodeItem vector = get_input_link("Vector", NodeItem::Type::Vector2);
|
||||||
if (!vector) {
|
if (!vector) {
|
||||||
|
@ -189,12 +189,13 @@ NODE_SHADER_MATERIALX_BEGIN
|
|||||||
Image *image = (Image *)node_->id;
|
Image *image = (Image *)node_->id;
|
||||||
if (image) {
|
if (image) {
|
||||||
NodeTexImage *tex_image = static_cast<NodeTexImage *>(node_->storage);
|
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_);
|
Scene *scene = DEG_get_input_scene(depsgraph_);
|
||||||
Main *bmain = DEG_get_bmain(depsgraph_);
|
Main *bmain = DEG_get_bmain(depsgraph_);
|
||||||
|
image_path = export_image_fn_(bmain, scene, image, &tex_image->iuser);
|
||||||
std::string image_path = export_image_fn_ ?
|
}
|
||||||
export_image_fn_(bmain, scene, image, &tex_image->iuser) :
|
|
||||||
image->id.name;
|
|
||||||
|
|
||||||
NodeItem vector = get_input_link("Vector", NodeItem::Type::Vector2);
|
NodeItem vector = get_input_link("Vector", NodeItem::Type::Vector2);
|
||||||
if (!vector) {
|
if (!vector) {
|
||||||
|
Loading…
Reference in New Issue
Block a user