[Bf-blender-cvs] [3ca34d49bcd] temp-usd-udim-import: USD import: fix compile error and warning.

Michael Kowalski noreply at git.blender.org
Thu Jan 6 02:51:32 CET 2022


Commit: 3ca34d49bcd351d75dd07d3126558d70e94b5601
Author: Michael Kowalski
Date:   Wed Jan 5 20:48:00 2022 -0500
Branches: temp-usd-udim-import
https://developer.blender.org/rB3ca34d49bcd351d75dd07d3126558d70e94b5601

USD import: fix compile error and warning.

Removed unnecessary assert which was causing a compile
warning.  Also, removed call to std::optional::value(),
which is not supported in macOS versions prior to 10.14.1.

===================================================================

M	source/blender/io/usd/intern/usd_reader_material.cc

===================================================================

diff --git a/source/blender/io/usd/intern/usd_reader_material.cc b/source/blender/io/usd/intern/usd_reader_material.cc
index 6f0134b17d4..58bacccca5f 100644
--- a/source/blender/io/usd/intern/usd_reader_material.cc
+++ b/source/blender/io/usd/intern/usd_reader_material.cc
@@ -138,10 +138,6 @@ static bool is_udim_path(const std::string &path)
  * Returns std::nullopt if no tiles were found. */
 static std::optional<blender::Vector<int>> get_udim_tiles(const std::string &file_path)
 {
-  /* Check if we have a UDIM path. */
-  std::size_t udim_token_offset = file_path.find("<UDIM>");
-  BLI_assert(udim_token_offset != std::string::npos);
-
   char base_udim_path[FILE_MAX];
   BLI_strncpy(base_udim_path, file_path.c_str(), sizeof(base_udim_path));
 
@@ -718,7 +714,9 @@ void USDMaterialReader::load_tex_image(const pxr::UsdShadeShader &usd_shader,
   }
 
   if (udim_tiles) {
-    add_udim_tiles(image, udim_tiles.value());
+    /* Not calling udim_tiles.value(), which is not
+     * supported in macOS versions prior to 10.14.1. */
+    add_udim_tiles(image, *udim_tiles);
   }
 
   tex_image->id = &image->id;



More information about the Bf-blender-cvs mailing list