[Bf-blender-cvs] [84bb4fc00c8] usd-importer-T81257-merge: USD import: convert UsdGeomImageables only.

makowalski noreply at git.blender.org
Fri Feb 12 21:24:21 CET 2021


Commit: 84bb4fc00c82a7952830000eaa571413306c2f95
Author: makowalski
Date:   Fri Feb 12 15:18:36 2021 -0500
Branches: usd-importer-T81257-merge
https://developer.blender.org/rB84bb4fc00c82a7952830000eaa571413306c2f95

USD import: convert UsdGeomImageables only.

Currently, the importer converts every node in the USD
to a Blender Empty object by default, including nodes
that aren't of UsdGeomImageable type, such as materials
and shaders.  This can unnecessarily bloat the Blender
scene with nodes that are not immediately useful.  I've
added logic to restrict conversion to nodes that are
UsdGeomImageables, and this can have a dramatic effect
in some cases.  For exmaple, the number of nodes imported
in the Attic scene is reduced from 1,025 to 238 with
this change.

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

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 89be690f0b6..4a218b954f0 100644
--- a/source/blender/io/usd/intern/usd_util.cc
+++ b/source/blender/io/usd/intern/usd_util.cc
@@ -111,7 +111,7 @@ USDPrimReader *create_reader(const pxr::UsdStageRefPtr &stage,
   else if (params.import_volumes && prim.IsA<pxr::UsdVolVolume>()) {
     reader = new USDVolumeReader(stage, prim, params, settings);
   }
-  else {
+  else if (prim.IsA<pxr::UsdGeomImageable>()) {
     reader = new USDXformReader(stage, prim, params, settings);
   }
 
@@ -140,7 +140,7 @@ USDPrimReader *create_fake_reader(USDStageReader *archive, const pxr::UsdPrim &p
   else if (prim.IsA<pxr::UsdVolVolume>()) {
     reader = new USDVolumeReader(archive->stage(), prim, archive->params(), archive->settings());
   }
-  else {
+  else if (prim.IsA<pxr::UsdGeomImageable>()) {
     reader = new USDXformReader(archive->stage(), prim, archive->params(), archive->settings());
   }
   return reader;



More information about the Bf-blender-cvs mailing list