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:
committed by
Jesse Yurkovich
parent
9bebd39197
commit
88b335aa0f
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user