[Bf-blender-cvs] [dc31e243887] temp-usd-udim-import: USD material import format fixes.

Michael Kowalski noreply at git.blender.org
Thu Jan 6 01:34:41 CET 2022


Commit: dc31e2438870730a6b6f7d540301333bf7f4d9de
Author: Michael Kowalski
Date:   Tue Dec 28 21:55:38 2021 -0500
Branches: temp-usd-udim-import
https://developer.blender.org/rBdc31e2438870730a6b6f7d540301333bf7f4d9de

USD material import format fixes.

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

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

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

diff --git a/source/blender/io/usd/intern/usd_reader_mesh.cc b/source/blender/io/usd/intern/usd_reader_mesh.cc
index 98d21c6138e..45972471473 100644
--- a/source/blender/io/usd/intern/usd_reader_mesh.cc
+++ b/source/blender/io/usd/intern/usd_reader_mesh.cc
@@ -92,15 +92,16 @@ static pxr::UsdShadeMaterial compute_bound_material(const pxr::UsdPrim &prim)
 /* Returns an existing Blender material that corresponds to the USD
  * material with with the given path.  Returns null if no such material
  * exists. */
-static Material *find_existing_material(const pxr::SdfPath &usd_mat_path,
-                                        const USDImportParams &params,
-                                        const std::map<std::string, Material *> &mat_map,
-                                        const std::map<std::string, std::string> &usd_path_to_mat_name)
+static Material *find_existing_material(
+    const pxr::SdfPath &usd_mat_path,
+    const USDImportParams &params,
+    const std::map<std::string, Material *> &mat_map,
+    const std::map<std::string, std::string> &usd_path_to_mat_name)
 {
   if (params.mtl_name_collision_mode == USD_MTL_NAME_COLLISION_UNIQUE_NAME) {
     /* Check if we've already created the Blender material with a modified name. */
     std::map<std::string, std::string>::const_iterator path_to_name_iter =
-      usd_path_to_mat_name.find(usd_mat_path.GetAsString());
+        usd_path_to_mat_name.find(usd_mat_path.GetAsString());
 
     if (path_to_name_iter != usd_path_to_mat_name.end()) {
       std::string mat_name = path_to_name_iter->second;
@@ -110,8 +111,8 @@ static Material *find_existing_material(const pxr::SdfPath &usd_mat_path,
       }
       else {
         std::cout
-          << "WARNING: Couldn't find previously assigned Blender material for USD material "
-          << usd_mat_path << std::endl;
+            << "WARNING: Couldn't find previously assigned Blender material for USD material "
+            << usd_mat_path << std::endl;
       }
     }
   }
@@ -156,10 +157,8 @@ static void assign_materials(Main *bmain,
 
   for (it = mat_index_map.begin(); it != mat_index_map.end(); ++it) {
 
-    Material *assigned_mat = find_existing_material(it->first,
-                                                    params,
-                                                    mat_map,
-                                                    usd_path_to_mat_name);
+    Material *assigned_mat = find_existing_material(
+        it->first, params, mat_map, usd_path_to_mat_name);
     if (!assigned_mat) {
       /* Blender material doesn't exist, so create it now. */



More information about the Bf-blender-cvs mailing list