[Bf-blender-cvs] [092fe1ef293] tmp_usd_import_unbound_mtls: USD IO format fixes.

Michael Kowalski noreply at git.blender.org
Thu Oct 6 05:42:02 CEST 2022


Commit: 092fe1ef293280cbf0ff2f8b892f5c455aea3c38
Author: Michael Kowalski
Date:   Wed Oct 5 23:11:43 2022 -0400
Branches: tmp_usd_import_unbound_mtls
https://developer.blender.org/rB092fe1ef293280cbf0ff2f8b892f5c455aea3c38

USD IO format fixes.

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

M	source/blender/editors/io/io_usd.c
M	source/blender/io/usd/intern/usd_reader_material.cc
M	source/blender/io/usd/intern/usd_reader_material.h
M	source/blender/io/usd/intern/usd_reader_stage.cc

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

diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c
index 5fe8ff7a16c..9bcd16a04df 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -583,8 +583,11 @@ void WM_OT_usd_import(struct wmOperatorType *ot)
 
   RNA_def_boolean(ot->srna, "import_render", true, "Render", "Import final render geometry");
 
-  RNA_def_boolean(ot->srna, "import_unbound_materials", false,
-    "Unbound Materials", "Include materials not bound to any geometry");
+  RNA_def_boolean(ot->srna,
+                  "import_unbound_materials",
+                  false,
+                  "Unbound Materials",
+                  "Include materials not bound to any geometry");
 
   RNA_def_boolean(ot->srna,
                   "import_usd_preview",
diff --git a/source/blender/io/usd/intern/usd_reader_material.cc b/source/blender/io/usd/intern/usd_reader_material.cc
index 6416f6861d4..bf4ee0ad208 100644
--- a/source/blender/io/usd/intern/usd_reader_material.cc
+++ b/source/blender/io/usd/intern/usd_reader_material.cc
@@ -757,7 +757,6 @@ void USDMaterialReader::convert_usd_primvar_reader_float2(
   link_nodes(ntree, uv_map, "UV", dest_node, dest_socket_name);
 }
 
-
 void build_material_map(const Main *bmain, std::map<std::string, Material *> *r_mat_map)
 {
   if (r_mat_map == nullptr) {
@@ -771,11 +770,10 @@ void build_material_map(const Main *bmain, std::map<std::string, Material *> *r_
   }
 }
 
-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)
+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_MAKE_UNIQUE) {
     /* Check if we've already created the Blender material with a modified name. */
diff --git a/source/blender/io/usd/intern/usd_reader_material.h b/source/blender/io/usd/intern/usd_reader_material.h
index abd810b9936..871954f3a99 100644
--- a/source/blender/io/usd/intern/usd_reader_material.h
+++ b/source/blender/io/usd/intern/usd_reader_material.h
@@ -71,7 +71,6 @@ class USDMaterialReader {
   Main *bmain_;
 
  public:
-
   USDMaterialReader(const USDImportParams &params, Main *bmain);
 
   Material *add_material(const pxr::UsdShadeMaterial &usd_material) const;
diff --git a/source/blender/io/usd/intern/usd_reader_stage.cc b/source/blender/io/usd/intern/usd_reader_stage.cc
index 89dd7098f6c..0533cbbffee 100644
--- a/source/blender/io/usd/intern/usd_reader_stage.cc
+++ b/source/blender/io/usd/intern/usd_reader_stage.cc
@@ -353,7 +353,8 @@ void USDStageReader::import_all_materials(Main *bmain)
  * materials. */
 void USDStageReader::fake_users_for_unbound_materials()
 {
-  std::map<std::string, std::string>::const_iterator mat_name_it = settings_.usd_path_to_mat_name.begin();
+  std::map<std::string, std::string>::const_iterator mat_name_it =
+      settings_.usd_path_to_mat_name.begin();
   for (; mat_name_it != settings_.usd_path_to_mat_name.end(); ++mat_name_it) {
     std::map<std::string, Material *>::iterator mat_it = settings_.mat_name_to_mat.find(
         mat_name_it->second);



More information about the Bf-blender-cvs mailing list