From 2eb1a00a9399d2f71907288da9a9b5d2ef89e7b7 Mon Sep 17 00:00:00 2001 From: "georgiy.m.markelov@gmail.com" Date: Thu, 29 Jun 2023 17:33:28 +0300 Subject: [PATCH 1/3] Initial --- source/blender/render/hydra/scene_delegate/world.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/render/hydra/scene_delegate/world.cc b/source/blender/render/hydra/scene_delegate/world.cc index 601be80c0ebc..c94b19f16bf8 100644 --- a/source/blender/render/hydra/scene_delegate/world.cc +++ b/source/blender/render/hydra/scene_delegate/world.cc @@ -83,7 +83,7 @@ void WorldData::init() if (!color_input.directly_linked_links().is_empty()) { bNode *color_input_node = color_input.directly_linked_links()[0]->fromnode; - if (color_input_node->type == SH_NODE_TEX_IMAGE) { + if (ELEM(color_input_node->type, SH_NODE_TEX_IMAGE, SH_NODE_TEX_ENVIRONMENT)) { NodeTexImage *tex = static_cast(color_input_node->storage); Image *image = (Image *)color_input_node->id; if (image) { -- 2.30.2 From 07823b3813c8480cc3b4a0bddf2b643db0681dba Mon Sep 17 00:00:00 2001 From: "georgiy.m.markelov@gmail.com" Date: Fri, 30 Jun 2023 13:21:37 +0300 Subject: [PATCH 2/3] Fixed DomeLight transform for HdStorm --- source/blender/render/hydra/scene_delegate/world.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/source/blender/render/hydra/scene_delegate/world.cc b/source/blender/render/hydra/scene_delegate/world.cc index e8f1ef9255a1..511756cd3936 100644 --- a/source/blender/render/hydra/scene_delegate/world.cc +++ b/source/blender/render/hydra/scene_delegate/world.cc @@ -176,13 +176,11 @@ void WorldData::write_transform() { transform = pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -90), pxr::GfVec3d()); - /* TODO : do this check via RenderSettings*/ - if (scene_delegate_->engine->render_delegate_name == "HdRprPlugin") { - transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -180), - pxr::GfVec3d()); - transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, 1.0), 90.0), - pxr::GfVec3d()); - } + transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(1.0, 0.0, 0.0), -180), + pxr::GfVec3d()); + transform *= pxr::GfMatrix4d(pxr::GfRotation(pxr::GfVec3d(0.0, 0.0, 1.0), 90.0), + pxr::GfVec3d()); + } } // namespace blender::render::hydra -- 2.30.2 From 0a863ab8bf55cc5af804ed04ae59f18b322225d5 Mon Sep 17 00:00:00 2001 From: "georgiy.m.markelov@gmail.com" Date: Fri, 30 Jun 2023 17:00:42 +0300 Subject: [PATCH 3/3] fixed image saving options --- source/blender/render/hydra/scene_delegate/image.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/render/hydra/scene_delegate/image.cc b/source/blender/render/hydra/scene_delegate/image.cc index 340fb34cf424..c737cf333cc5 100644 --- a/source/blender/render/hydra/scene_delegate/image.cc +++ b/source/blender/render/hydra/scene_delegate/image.cc @@ -40,8 +40,12 @@ static std::string cache_image_file(Image *image, ImageSaveOptions opts; if (BKE_image_save_options_init(&opts, main, scene, image, iuser, false, false)) { char file_name[32]; - const char *r_ext; - BKE_image_path_ext_from_imformat(&scene->r.im_format, &r_ext); + const char *r_ext = BLI_path_extension_or_end(image->id.name); + if (!pxr::HioImageRegistry::GetInstance().IsSupportedImageFile(image->id.name)) { + BKE_image_path_ext_from_imformat(&scene->r.im_format, &r_ext); + opts.im_format = scene->r.im_format; + } + snprintf(file_name, sizeof(file_name), "img_%016llx%s", (uintptr_t)image, r_ext); file_path = get_cache_file(file_name); -- 2.30.2