[Bf-blender-cvs] [82964294a55] universal-scene-description: USD Import: Incorrect merge of untyped prims.

Michael Kowalski noreply at git.blender.org
Mon Apr 25 20:55:01 CEST 2022


Commit: 82964294a55c82c0efd82dc3db5b1f3ca7a0a72f
Author: Michael Kowalski
Date:   Mon Apr 25 14:18:43 2022 -0400
Branches: universal-scene-description
https://developer.blender.org/rB82964294a55c82c0efd82dc3db5b1f3ca7a0a72f

USD Import: Incorrect merge of untyped prims.

Fixed bug where prims with undefined types were incorrectly merged
with parent xforms on import.  In some cases, this was causing
root xforms to be lost and prevented unit scale from being applied.

As an example, a scene with a single untyped prim parented to the
top level World xform would result in the World and untyped prim
being merged into a single Blender object representing only the
untyped prim.  Moreover, the UsdXformReader logic for identifying
root transform objects would fail in this case and no scene scale
would be applied to the imported hierarchy.

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

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

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

diff --git a/source/blender/io/usd/intern/usd_reader_stage.cc b/source/blender/io/usd/intern/usd_reader_stage.cc
index 1ac8c7a3a7d..4cd8650127b 100644
--- a/source/blender/io/usd/intern/usd_reader_stage.cc
+++ b/source/blender/io/usd/intern/usd_reader_stage.cc
@@ -194,9 +194,11 @@ bool USDStageReader::merge_with_parent(USDPrimReader *reader) const
     return false;
   }
 
-  /* Don't merge Xform and Scope prims. */
+  /* Don't merge Xform, Scope or undefined prims. */
   if (xform_reader->prim().IsA<pxr::UsdGeomXform>() ||
-      xform_reader->prim().IsA<pxr::UsdGeomScope>()) {
+      xform_reader->prim().IsA<pxr::UsdGeomScope>() ||
+      xform_reader->prim().GetPrimTypeInfo()
+        == pxr::UsdPrimTypeInfo::GetEmptyPrimType()) {
     return false;
   }



More information about the Bf-blender-cvs mailing list