[Bf-blender-cvs] [3f3b447f52c] usd-importer-T81257: USD importer bug fix.

Michael A. Kowalski noreply at git.blender.org
Mon Oct 12 04:52:05 CEST 2020


Commit: 3f3b447f52c9662be7fc7189a92ee1cef1009f3e
Author: Michael A. Kowalski
Date:   Sun Oct 11 22:50:44 2020 -0400
Branches: usd-importer-T81257
https://developer.blender.org/rB3f3b447f52c9662be7fc7189a92ee1cef1009f3e

USD importer bug fix.

Fixed error in merging logic when creating
readers, which was causing missing Xforms
in the Blender hierarchy.

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

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

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

diff --git a/source/blender/io/usd/intern/usd_util.cc b/source/blender/io/usd/intern/usd_util.cc
index c81d882758f..dff9fca6b4c 100644
--- a/source/blender/io/usd/intern/usd_util.cc
+++ b/source/blender/io/usd/intern/usd_util.cc
@@ -377,15 +377,17 @@ void create_readers(const pxr::UsdPrim &prim,
   }
 
   /* If this is an Xform prim, see if we can merge with the child reader.
-   * We only merge if the Xform has a single child of Mesh type.
-   * The list of child types that can be merged will be expanded as we
-   * support more reader types (e.g., for lights, curves, etc.). */
+   * We only merge if the child reader hasn't yet been merged
+   * and if it corresponds to a mesh prim.  The list of child types that
+   * can be merged will be expanded as we support more reader types
+   * (e.g., for lights, curves, etc.). */
 
   if (prim.GetTypeName() == usdtokens::xform_type && child_readers.size() == 1 &&
+      !child_readers.front()->merged_with_parent() &&
       child_readers.front()->prim().GetTypeName() == usdtokens::mesh_type) {
     child_readers.front()->set_merged_with_parent(true);
-    // We don't create a reader for the Xform but, instead, we return the grandchild
-    // that we merged.
+    /* Don't create a reader for the Xform but, instead, return the grandchild
+     * that we merged. */
     r_child_readers.push_back(child_readers.front());
     return;
   }



More information about the Bf-blender-cvs mailing list