[Bf-blender-cvs] [b31807c75f0] tmp-usd-alab-v2-T100452: Format fixes.

Michael Kowalski noreply at git.blender.org
Wed Aug 17 04:46:08 CEST 2022


Commit: b31807c75f0c18c43ac6979e6da57dc9d420167a
Author: Michael Kowalski
Date:   Tue Aug 16 22:25:51 2022 -0400
Branches: tmp-usd-alab-v2-T100452
https://developer.blender.org/rBb31807c75f0c18c43ac6979e6da57dc9d420167a

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_mesh.cc
M	source/blender/io/usd/usd.h

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

diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c
index 6c4c35fe490..fd8caf6836e 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -612,15 +612,14 @@ void WM_OT_usd_import(struct wmOperatorType *ot)
                   "the material blend method will automatically be set based on the "
                   "shader's opacity and opacityThreshold inputs");
 
-  RNA_def_enum(
-      ot->srna,
-      "mtl_purpose",
-      rna_enum_usd_mtl_purpose_items,
-      USD_MTL_PURPOSE_ALL,
-      "Material Purpose",
-      "Attempt to import materials with the given purpose. "
-      "If no material with this purpose is bound to the primitive, "
-      "fall back on loading any other bound material");
+  RNA_def_enum(ot->srna,
+               "mtl_purpose",
+               rna_enum_usd_mtl_purpose_items,
+               USD_MTL_PURPOSE_ALL,
+               "Material Purpose",
+               "Attempt to import materials with the given purpose. "
+               "If no material with this purpose is bound to the primitive, "
+               "fall back on loading any other bound material");
 
   RNA_def_float(ot->srna,
                 "light_intensity_scale",
diff --git a/source/blender/io/usd/intern/usd_reader_material.cc b/source/blender/io/usd/intern/usd_reader_material.cc
index 5d64f3279ee..a786cdc70f4 100644
--- a/source/blender/io/usd/intern/usd_reader_material.cc
+++ b/source/blender/io/usd/intern/usd_reader_material.cc
@@ -749,7 +749,8 @@ void USDMaterialReader::convert_usd_primvar_reader_float2(
       std::string varname;
       if (varname_val.IsHolding<std::string>()) {
         varname = varname_val.Get<std::string>();
-      } else if (varname_val.IsHolding<pxr::TfToken>()) {
+      }
+      else if (varname_val.IsHolding<pxr::TfToken>()) {
         varname = varname_val.Get<pxr::TfToken>().GetString();
       }
       if (!varname.empty()) {
diff --git a/source/blender/io/usd/intern/usd_reader_mesh.cc b/source/blender/io/usd/intern/usd_reader_mesh.cc
index fb7f2cfe41c..c016c9127ec 100644
--- a/source/blender/io/usd/intern/usd_reader_mesh.cc
+++ b/source/blender/io/usd/intern/usd_reader_mesh.cc
@@ -62,7 +62,8 @@ static void build_mat_map(const Main *bmain, std::map<std::string, Material *> *
   }
 }
 
-static pxr::UsdShadeMaterial compute_bound_material(const pxr::UsdPrim &prim, eUSDMtlPurpose purpose)
+static pxr::UsdShadeMaterial compute_bound_material(const pxr::UsdPrim &prim,
+                                                    eUSDMtlPurpose purpose)
 {
   pxr::UsdShadeMaterial mtl;
 
@@ -791,8 +792,8 @@ void USDMeshReader::assign_facesets_to_mpoly(double motionSampleTime,
   if (!subsets.empty()) {
     for (const pxr::UsdGeomSubset &subset : subsets) {
 
-      pxr::UsdShadeMaterial subset_mtl =
-        utils::compute_bound_material(subset.GetPrim(), import_params_.mtl_purpose);
+      pxr::UsdShadeMaterial subset_mtl = utils::compute_bound_material(subset.GetPrim(),
+                                                                       import_params_.mtl_purpose);
       if (!subset_mtl) {
         continue;
       }
@@ -822,8 +823,7 @@ void USDMeshReader::assign_facesets_to_mpoly(double motionSampleTime,
 
   if (r_mat_map->empty()) {
 
-    pxr::UsdShadeMaterial mtl =
-      utils::compute_bound_material(prim_, import_params_.mtl_purpose);
+    pxr::UsdShadeMaterial mtl = utils::compute_bound_material(prim_, import_params_.mtl_purpose);
     if (mtl) {
       pxr::SdfPath mtl_path = mtl.GetPath();
 
diff --git a/source/blender/io/usd/usd.h b/source/blender/io/usd/usd.h
index 7caba9dea07..7f0660765d1 100644
--- a/source/blender/io/usd/usd.h
+++ b/source/blender/io/usd/usd.h
@@ -31,7 +31,6 @@ typedef enum eUSDMtlPurpose {
   USD_MTL_PURPOSE_FULL = 2
 } eUSDMtlPurpose;
 
-
 struct USDExportParams {
   bool export_animation;
   bool export_hair;



More information about the Bf-blender-cvs mailing list