[Bf-blender-cvs] [ccb5bd3778b] usd-importer-T81257-merge: Rename USDStageReader prune functions.

makowalski noreply at git.blender.org
Tue Jun 22 04:13:35 CEST 2021


Commit: ccb5bd3778b84d6eaf12ad9abb5ca17f4ec9d05e
Author: makowalski
Date:   Mon Jun 21 14:48:05 2021 -0400
Branches: usd-importer-T81257-merge
https://developer.blender.org/rBccb5bd3778b84d6eaf12ad9abb5ca17f4ec9d05e

Rename USDStageReader prune functions.

Renamed USDStageReader prune_by_visibility()
and prune_by_purpose() member functions to
include_by_visibility() and include_by_purpse(),
respectively, to reflect the current semantics.
I.e., both functions are now answering the question,
'should the prim be included in the traversal',
returning true to include and false to exclude.

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

M	source/blender/io/usd/intern/usd_reader_stage.cc
M	source/blender/io/usd/intern/usd_reader_stage.h

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

diff --git a/source/blender/io/usd/intern/usd_reader_stage.cc b/source/blender/io/usd/intern/usd_reader_stage.cc
index 7b69a7e8983..420d6de970a 100644
--- a/source/blender/io/usd/intern/usd_reader_stage.cc
+++ b/source/blender/io/usd/intern/usd_reader_stage.cc
@@ -117,7 +117,7 @@ USDPrimReader *USDStageReader::create_reader(const pxr::UsdPrim &prim)
  * attribute.  Note that the prim will be trivially included
  * if it has no visibility attribute or if the visibility
  * is inherited. */
-bool USDStageReader::prune_by_visibility(const pxr::UsdGeomImageable &imageable) const
+bool USDStageReader::include_by_visibility(const pxr::UsdGeomImageable &imageable) const
 {
   if (!params_.import_visible_only) {
     /* Invisible prims are allowed. */
@@ -147,7 +147,7 @@ bool USDStageReader::prune_by_visibility(const pxr::UsdGeomImageable &imageable)
  * attribute. E.g., return false (to exclude the prim) if the prim
  * represents guide geometry and the 'Import Guide' option is
  * toggled off. */
-bool USDStageReader::prune_by_purpose(const pxr::UsdGeomImageable &imageable) const
+bool USDStageReader::include_by_purpose(const pxr::UsdGeomImageable &imageable) const
 {
   if (params_.import_guide && params_.import_proxy && params_.import_render) {
     /* The options allow any purpose, so we trivially include the prim. */
@@ -220,11 +220,11 @@ USDPrimReader *USDStageReader::collect_readers(Main *bmain, const pxr::UsdPrim &
   if (prim.IsA<pxr::UsdGeomImageable>()) {
     pxr::UsdGeomImageable imageable(prim);
 
-    if (!prune_by_purpose(imageable)) {
+    if (!include_by_purpose(imageable)) {
       return nullptr;
     }
 
-    if (!prune_by_visibility(imageable)) {
+    if (!include_by_visibility(imageable)) {
       return nullptr;
     }
   }
diff --git a/source/blender/io/usd/intern/usd_reader_stage.h b/source/blender/io/usd/intern/usd_reader_stage.h
index 2be36bec5be..34ca1fe24bc 100644
--- a/source/blender/io/usd/intern/usd_reader_stage.h
+++ b/source/blender/io/usd/intern/usd_reader_stage.h
@@ -92,9 +92,9 @@ class USDStageReader {
  private:
   USDPrimReader *collect_readers(Main *bmain, const pxr::UsdPrim &prim);
 
-  bool prune_by_visibility(const pxr::UsdGeomImageable &imageable) const;
+  bool include_by_visibility(const pxr::UsdGeomImageable &imageable) const;
 
-  bool prune_by_purpose(const pxr::UsdGeomImageable &imageable) const;
+  bool include_by_purpose(const pxr::UsdGeomImageable &imageable) const;
 };
 
 };  // namespace blender::io::usd



More information about the Bf-blender-cvs mailing list