[Bf-blender-cvs] [b523449fc62] usd-importer-T81257: USD importer: added comments and minor cleanup.

Michael A. Kowalski noreply at git.blender.org
Thu Nov 5 21:36:27 CET 2020


Commit: b523449fc6253eca6e7d04ec26b353a2d9b47519
Author: Michael A. Kowalski
Date:   Thu Nov 5 13:04:49 2020 -0500
Branches: usd-importer-T81257
https://developer.blender.org/rBb523449fc6253eca6e7d04ec26b353a2d9b47519

USD importer: added comments and minor cleanup.

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

M	source/blender/io/usd/import/usd_reader_mesh.h
M	source/blender/io/usd/import/usd_reader_mesh_base.h
M	source/blender/io/usd/import/usd_reader_prim.h
M	source/blender/io/usd/import/usd_reader_xform.h
M	source/blender/io/usd/import/usd_reader_xformable.cc
M	source/blender/io/usd/import/usd_reader_xformable.h
M	source/blender/io/usd/intern/usd_capi.cc

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

diff --git a/source/blender/io/usd/import/usd_reader_mesh.h b/source/blender/io/usd/import/usd_reader_mesh.h
index 8098f7e245d..b9a8c898391 100644
--- a/source/blender/io/usd/import/usd_reader_mesh.h
+++ b/source/blender/io/usd/import/usd_reader_mesh.h
@@ -24,6 +24,9 @@
 
 namespace blender::io::usd {
 
+/* Wraps the UsdGeomMesh schema. Defines the logic for reading
+ * Mesh data for the object created by USDMeshReaderBase. */
+
 class USDMeshReader : public USDMeshReaderBase {
  protected:
   pxr::UsdGeomMesh mesh_;
diff --git a/source/blender/io/usd/import/usd_reader_mesh_base.h b/source/blender/io/usd/import/usd_reader_mesh_base.h
index 4bcf0b50c83..687659e7887 100644
--- a/source/blender/io/usd/import/usd_reader_mesh_base.h
+++ b/source/blender/io/usd/import/usd_reader_mesh_base.h
@@ -22,6 +22,10 @@
 
 namespace blender::io::usd {
 
+/* Abstract base class of readers that can create a Blender mesh object.
+ * Subclasses must define the create_mesh() and assign_materials() virtual
+ * functions to implement the logic for creating the Mesh data and materials. */
+
 class USDMeshReaderBase : public USDXformableReader {
  protected:
  public:
diff --git a/source/blender/io/usd/import/usd_reader_prim.h b/source/blender/io/usd/import/usd_reader_prim.h
index 448a8cedda5..e8dcd631487 100644
--- a/source/blender/io/usd/import/usd_reader_prim.h
+++ b/source/blender/io/usd/import/usd_reader_prim.h
@@ -25,6 +25,8 @@
 
 namespace blender::io::usd {
 
+/* Abstract base class of all USD readers.  It wraps a single UsdPrim. */
+
 class USDPrimReader {
 
  protected:
diff --git a/source/blender/io/usd/import/usd_reader_xform.h b/source/blender/io/usd/import/usd_reader_xform.h
index e6f440dcc6d..893bd55d56f 100644
--- a/source/blender/io/usd/import/usd_reader_xform.h
+++ b/source/blender/io/usd/import/usd_reader_xform.h
@@ -24,6 +24,8 @@
 
 namespace blender::io::usd {
 
+/* Wraps the UsdGeomXform schema. Creates a Blender Empty object. */
+
 class USDXformReader : public USDXformableReader {
 
   pxr::UsdGeomXform xform_;
diff --git a/source/blender/io/usd/import/usd_reader_xformable.cc b/source/blender/io/usd/import/usd_reader_xformable.cc
index 7dead91415f..aecefb55a4e 100644
--- a/source/blender/io/usd/import/usd_reader_xformable.cc
+++ b/source/blender/io/usd/import/usd_reader_xformable.cc
@@ -50,7 +50,7 @@ Object *USDXformableReader::object() const
   return object_;
 }
 
-void USDXformableReader::setup_object_transform(const double time)
+void USDXformableReader::set_object_transform(const double time)
 {
   if (!this->object_) {
     return;
diff --git a/source/blender/io/usd/import/usd_reader_xformable.h b/source/blender/io/usd/import/usd_reader_xformable.h
index 5159b1ea156..11ec5b022b8 100644
--- a/source/blender/io/usd/import/usd_reader_xformable.h
+++ b/source/blender/io/usd/import/usd_reader_xformable.h
@@ -31,6 +31,9 @@ struct Object;
 
 namespace blender::io::usd {
 
+/* Wraps the UsdGeomXformable schema. Abstract base class for all readers
+ * that create a Blender object and compute its transform. */
+
 class USDXformableReader : public USDPrimReader {
 
  protected:
@@ -71,8 +74,7 @@ class USDXformableReader : public USDPrimReader {
 
   virtual void create_object(Main *bmain, double time) = 0;
 
-  /* Reads the object matrix. */
-  void setup_object_transform(const double time);
+  void set_object_transform(const double time);
 
   void read_matrix(float r_mat[4][4], const double time, const float scale, bool &is_constant);
 };
diff --git a/source/blender/io/usd/intern/usd_capi.cc b/source/blender/io/usd/intern/usd_capi.cc
index 1b9665b55e5..926713eaecd 100644
--- a/source/blender/io/usd/intern/usd_capi.cc
+++ b/source/blender/io/usd/intern/usd_capi.cc
@@ -324,7 +324,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
   i = 0;
   for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
     USDXformableReader *reader = *iter;
-    reader->setup_object_transform(time);
+    reader->set_object_transform(time);
 
     *data->progress = 0.7f + 0.3f * (++i / size);
     *data->do_update = true;



More information about the Bf-blender-cvs mailing list