[Bf-blender-cvs] [03d200aae7d] usd-importer-T81257-merge: Formatting fixes.

makowalski noreply at git.blender.org
Wed Mar 3 16:17:11 CET 2021


Commit: 03d200aae7de953921bfe4ca6a6618193e531fbb
Author: makowalski
Date:   Wed Mar 3 09:52:50 2021 -0500
Branches: usd-importer-T81257-merge
https://developer.blender.org/rB03d200aae7de953921bfe4ca6a6618193e531fbb

Formatting fixes.

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

M	source/blender/blenlib/intern/BLI_mmap.c
M	source/blender/editors/io/io_usd.c
M	source/blender/editors/io/io_usd.h
M	source/blender/io/alembic/ABC_alembic.h
M	source/blender/io/usd/intern/usd_capi.cc
M	source/blender/io/usd/intern/usd_reader_geom.cc
M	source/blender/io/usd/intern/usd_reader_instance.cc
M	source/blender/io/usd/intern/usd_reader_instance.h
M	source/blender/io/usd/intern/usd_reader_mesh.cc
M	source/blender/io/usd/intern/usd_reader_stage.cc
M	source/blender/io/usd/intern/usd_reader_stage.h
M	source/blender/makesdna/DNA_cachefile_types.h
M	source/blender/makesdna/DNA_customdata_types.h
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesdna/DNA_tracking_types.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/intern/MOD_meshsequencecache.c

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

diff --git a/source/blender/blenlib/intern/BLI_mmap.c b/source/blender/blenlib/intern/BLI_mmap.c
index f0b13183c68..210312456d9 100644
--- a/source/blender/blenlib/intern/BLI_mmap.c
+++ b/source/blender/blenlib/intern/BLI_mmap.c
@@ -29,8 +29,8 @@
 #include <string.h>
 
 #ifndef WIN32
-#  include <stdlib.h>
 #  include <signal.h>
+#  include <stdlib.h>
 #  include <sys/mman.h>  // for mmap
 #  include <unistd.h>    // for read close
 #else
diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c
index a1f2d14b606..671e05e54b5 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -22,9 +22,9 @@
  */
 
 #ifdef WITH_USD
-#  include <string.h>
-#  include "DNA_space_types.h"
 #  include "DNA_modifier_types.h"
+#  include "DNA_space_types.h"
+#  include <string.h>
 
 #  include "BKE_context.h"
 #  include "BKE_main.h"
@@ -546,7 +546,7 @@ void WM_OT_usd_import(struct wmOperatorType *ot)
                   "Import Instance Proxies",
                   "If enabled, USD instances will be traversed with instance proxies, "
                   "creating a unique Blender object for each instance.  Note that "
-                  "this option is ignored if the Instancing option is also checked"  );
+                  "this option is ignored if the Instancing option is also checked");
 
   RNA_def_boolean(ot->srna,
                   "import_visible_only",
@@ -584,15 +584,15 @@ void WM_OT_usd_import(struct wmOperatorType *ot)
   RNA_def_boolean(ot->srna, "import_proxy", true, "Proxy", "When checked, import proxy geometry");
 
   RNA_def_boolean(
-    ot->srna, "import_render", true, "Render", "When checked, import final render geometry");
+      ot->srna, "import_render", true, "Render", "When checked, import final render geometry");
 
   RNA_def_boolean(
-    ot->srna,
-    "use_instancing",
-    false,
-    "Instancing",
-    "When checked, USD scenegraph instances are imported as collection instances in Blender. "
-    "(Note that point instancers are not yet handled by this option.)");
+      ot->srna,
+      "use_instancing",
+      false,
+      "Instancing",
+      "When checked, USD scenegraph instances are imported as collection instances in Blender. "
+      "(Note that point instancers are not yet handled by this option.)");
 }
 
 #endif /* WITH_USD */
diff --git a/source/blender/editors/io/io_usd.h b/source/blender/editors/io/io_usd.h
index 24de748285c..7424cc0df32 100644
--- a/source/blender/editors/io/io_usd.h
+++ b/source/blender/editors/io/io_usd.h
@@ -28,4 +28,3 @@ struct wmOperatorType;
 void WM_OT_usd_export(struct wmOperatorType *ot);
 
 void WM_OT_usd_import(struct wmOperatorType *ot);
-
diff --git a/source/blender/io/alembic/ABC_alembic.h b/source/blender/io/alembic/ABC_alembic.h
index 9432e54346f..6faf763f8a5 100644
--- a/source/blender/io/alembic/ABC_alembic.h
+++ b/source/blender/io/alembic/ABC_alembic.h
@@ -98,8 +98,8 @@ bool ABC_import(struct bContext *C,
                 bool as_background_job);
 
 CacheArchiveHandle *ABC_create_handle(struct Main *bmain,
-                                    const char *filename,
-                                    struct ListBase *object_paths);
+                                      const char *filename,
+                                      struct ListBase *object_paths);
 
 void ABC_free_handle(CacheArchiveHandle *handle);
 
diff --git a/source/blender/io/usd/intern/usd_capi.cc b/source/blender/io/usd/intern/usd_capi.cc
index dd4ca6e28da..7f8775c570b 100644
--- a/source/blender/io/usd/intern/usd_capi.cc
+++ b/source/blender/io/usd/intern/usd_capi.cc
@@ -135,11 +135,11 @@ static Collection *create_collection(Main *bmain, Collection *parent, const char
 }
 
 /* Set the instance collection on the given instance reader.
-*  The collection is assigned from the given map based on
-*  the prototype (maser) prim path. */
+ *  The collection is assigned from the given map based on
+ *  the prototype (maser) prim path. */
 static void set_instance_collection(
-  USDInstanceReader *instance_reader,
-  const std::map<pxr::SdfPath, Collection *> &proto_collection_map)
+    USDInstanceReader *instance_reader,
+    const std::map<pxr::SdfPath, Collection *> &proto_collection_map)
 {
   if (!instance_reader) {
     return;
@@ -154,17 +154,16 @@ static void set_instance_collection(
   }
   else {
     std::cerr << "WARNING: Couldn't find prototype collection for " << instance_reader->prim_path()
-      << std::endl;
+              << std::endl;
   }
 }
 
 /* Create instance collections for the USD instance readers. */
-static void create_proto_collections(
-  Main *bmain,
-  ViewLayer *view_layer,
-  Collection *parent_collection,
-  const USDStageReader::ProtoReaderMap &proto_readers,
-  const std::vector<USDPrimReader *> &readers)
+static void create_proto_collections(Main *bmain,
+                                     ViewLayer *view_layer,
+                                     Collection *parent_collection,
+                                     const USDStageReader::ProtoReaderMap &proto_readers,
+                                     const std::vector<USDPrimReader *> &readers)
 {
   Collection *all_protos_collection = create_collection(bmain, parent_collection, "prototypes");
 
@@ -179,10 +178,10 @@ static void create_proto_collections(
     // std::replace(proto_collection_name.begin(), proto_collection_name.end(), '/', '_');
 
     Collection *proto_collection = create_collection(
-      bmain, all_protos_collection, proto_collection_name.c_str());
+        bmain, all_protos_collection, proto_collection_name.c_str());
 
     LayerCollection *proto_lc = BKE_layer_collection_first_from_scene_collection(view_layer,
-      proto_collection);
+                                                                                 proto_collection);
     if (proto_lc) {
       proto_lc->flag |= LAYER_COLLECTION_HIDE;
     }
@@ -211,11 +210,11 @@ static void create_proto_collections(
   for (const auto &pair : proto_readers) {
 
     std::map<pxr::SdfPath, Collection *>::const_iterator it = proto_collection_map.find(
-      pair.first);
+        pair.first);
 
     if (it == proto_collection_map.end()) {
       std::cerr << "WARNING: Couldn't find collection when adding objects for prototype "
-        << pair.first << std::endl;
+                << pair.first << std::endl;
       continue;
     }
 
@@ -232,9 +231,9 @@ static void create_proto_collections(
 
       DEG_id_tag_update(&coll->id, ID_RECALC_COPY_ON_WRITE);
       DEG_id_tag_update_ex(bmain,
-        &ob->id,
-        ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION |
-        ID_RECALC_BASE_FLAGS);
+                           &ob->id,
+                           ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION |
+                               ID_RECALC_BASE_FLAGS);
     }
   }
 }
@@ -582,7 +581,7 @@ static void import_startjob(void *customdata, short *stop, short *do_update, flo
       }
 
       /* TODO(makowalski): Here and below, should we call
-      *  readObjectData() with the actual time? */
+       *  readObjectData() with the actual time? */
       reader->readObjectData(data->bmain, 0.0);
 
       Object *ob = reader->object();
@@ -678,7 +677,7 @@ static void import_endjob(void *customdata)
 
     if (data->archive && !data->archive->proto_readers().empty()) {
       create_proto_collections(
-        data->bmain, view_layer, lc->collection, data->archive->proto_readers(), data->readers);
+          data->bmain, view_layer, lc->collection, data->archive->proto_readers(), data->readers);
     }
 
     for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
@@ -923,7 +922,10 @@ void USD_free_handle(USDStageHandle *handle)
   delete archive;
 }
 
-void USD_get_transform(struct CacheReader *reader, float r_mat_world[4][4], float time, float scale)
+void USD_get_transform(struct CacheReader *reader,
+                       float r_mat_world[4][4],
+                       float time,
+                       float scale)
 {
   if (!reader) {
     return;
diff --git a/source/blender/io/usd/intern/usd_reader_geom.cc b/source/blender/io/usd/intern/usd_reader_geom.cc
index c23b7db338b..bd4394c9192 100644
--- a/source/blender/io/usd/intern/usd_reader_geom.cc
+++ b/source/blender/io/usd/intern/usd_reader_geom.cc
@@ -107,5 +107,5 @@ void USDGeomReader::addSubdivModifier()
   ModifierData *md = BKE_modifier_new(eModifierType_Subsurf);
   BLI_addtail(&m_object->modifiers, md);
 
-  //SubsurfModifierData *subd = reinterpret_cast<SubsurfModifierData *>(md);
+  // SubsurfModifierData *subd = reinterpret_cast<SubsurfModifierData *>(md);
 }
diff --git a/source/blender/io/usd/intern/usd_reader_instance.cc b/source/blender/io/usd/intern/usd_reader_instance.cc
index bb0ac3c1e2b..5ed32956898 100644
--- a/source/blender/io/usd/intern/usd_reader_instance.cc
+++ b/source/blender/io/usd/intern/usd_reader_instance.cc
@@ -26,40 +26,40 @@
 
 namespace blender::io::usd {
 
- USDInstanceReader::USDInstanceReader(pxr::UsdStageRefPtr stage,
-                                      const pxr::UsdPrim &object,
-                                      const USDImportParams &import_params,
-                                      ImportSettings &settings)
-   : USDXformReader(stage, object, import_params, settings)
- {
- }
+USDInstanceReader::USDInstanceReader(pxr::UsdStageRefPtr stage,
+                                     const pxr::UsdPrim &object,
+                                     const USDImportParams &import_params,
+                                     ImportSettings &settings)
+    : USDXformReader(stage, object, import_params, settings)
+{
+}
 
- bool USDInstanceReader::valid() const
- {
-   return m_prim.IsValid() && m_prim.IsInstance();
- }
+bool USDInstanceReader::valid() const
+{
+  return m_prim.IsValid() && m_prim.IsInstance();
+}
 
- void USDInstanceReader::createObject(Main *bmain, double motionSampleTime)
- {
-   this->m_object = BKE_object_add_only_object(bmain, OB_EMPTY, m_name.c_str());
-   this->m_object->data = nullptr;
-   this->m_object->transflag |= OB_DUPLICOLLECTION;
- }
+void USDInstanceReader::createObject(Main *bmain, double motionSampleTime)
+{


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list