Fix #98572: handle the 'mirror' texture wrap mode for USD materials

Support for the texture extension mode of "mirror" was simply missed
from `925fb66693d`.

With this patch, #98572 should be completely fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/118947
This commit is contained in:
Jesse Yurkovich
2024-03-08 23:23:58 +01:00
committed by Jesse Yurkovich
parent 9bebd39197
commit 88b335aa0f
2 changed files with 9 additions and 0 deletions

View File

@@ -74,6 +74,7 @@ static const pxr::TfToken RAW("RAW", pxr::TfToken::Immortal);
static const pxr::TfToken black("black", pxr::TfToken::Immortal);
static const pxr::TfToken clamp("clamp", pxr::TfToken::Immortal);
static const pxr::TfToken repeat("repeat", pxr::TfToken::Immortal);
static const pxr::TfToken mirror("mirror", pxr::TfToken::Immortal);
static const pxr::TfToken wrapS("wrapS", pxr::TfToken::Immortal);
static const pxr::TfToken wrapT("wrapT", pxr::TfToken::Immortal);
@@ -332,6 +333,10 @@ static int get_image_extension(const pxr::UsdShadeShader &usd_shader, const int
return SHD_IMAGE_EXTENSION_CLIP;
}
if (wrap_val == usdtokens::mirror) {
return SHD_IMAGE_EXTENSION_MIRROR;
}
return default_value;
}

View File

@@ -80,6 +80,7 @@ static const pxr::TfToken Shader("Shader", pxr::TfToken::Immortal);
static const pxr::TfToken black("black", pxr::TfToken::Immortal);
static const pxr::TfToken clamp("clamp", pxr::TfToken::Immortal);
static const pxr::TfToken repeat("repeat", pxr::TfToken::Immortal);
static const pxr::TfToken mirror("mirror", pxr::TfToken::Immortal);
static const pxr::TfToken wrapS("wrapS", pxr::TfToken::Immortal);
static const pxr::TfToken wrapT("wrapT", pxr::TfToken::Immortal);
static const pxr::TfToken in("in", pxr::TfToken::Immortal);
@@ -697,6 +698,9 @@ static pxr::TfToken get_node_tex_image_wrap(bNode *node)
case SHD_IMAGE_EXTENSION_CLIP:
wrap = usdtokens::black;
break;
case SHD_IMAGE_EXTENSION_MIRROR:
wrap = usdtokens::mirror;
break;
}
return wrap;