[Bf-blender-cvs] [1d613940c93] usd-importer-T81257-merge: USDNurbsReader minor cleanup.

makowalski noreply at git.blender.org
Mon Jul 19 06:27:35 CEST 2021


Commit: 1d613940c9382dcab8ea7a7fb57584de6110f3ab
Author: makowalski
Date:   Sun Jul 18 21:53:19 2021 -0400
Branches: usd-importer-T81257-merge
https://developer.blender.org/rB1d613940c9382dcab8ea7a7fb57584de6110f3ab

USDNurbsReader minor cleanup.

Removed unneeded num_subcurves variable.  Added
braces to if statement.

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

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

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

diff --git a/source/blender/io/usd/intern/usd_reader_nurbs.cc b/source/blender/io/usd/intern/usd_reader_nurbs.cc
index c4f05115c7c..a4cd75bc950 100644
--- a/source/blender/io/usd/intern/usd_reader_nurbs.cc
+++ b/source/blender/io/usd/intern/usd_reader_nurbs.cc
@@ -108,9 +108,7 @@ void USDNurbsReader::read_curve_sample(Curve *cu, const double motionSampleTime)
   pxr::UsdAttribute pointsAttr = curve_prim_.GetPointsAttr();
 
   pxr::VtIntArray usdCounts;
-
   vertexAttr.Get(&usdCounts, motionSampleTime);
-  int num_subcurves = usdCounts.size();
 
   pxr::VtVec3fArray usdPoints;
   pointsAttr.Get(&usdPoints, motionSampleTime);
@@ -139,7 +137,7 @@ void USDNurbsReader::read_curve_sample(Curve *cu, const double motionSampleTime)
   }
 
   size_t idx = 0;
-  for (size_t i = 0; i < num_subcurves; i++) {
+  for (size_t i = 0; i < usdCounts.size(); i++) {
     const int num_verts = usdCounts[i];
 
     Nurb *nu = static_cast<Nurb *>(MEM_callocN(sizeof(Nurb), __func__));
@@ -183,8 +181,9 @@ void USDNurbsReader::read_curve_sample(Curve *cu, const double motionSampleTime)
       bp->weight = weight;
 
       float radius = 0.1f;
-      if (idx < usdWidths.size())
+      if (idx < usdWidths.size()) {
         radius = usdWidths[idx];
+      }
 
       bp->radius = radius;
     }



More information about the Bf-blender-cvs mailing list