Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormakowalski <makowalski@nvidia.com>2021-02-12 23:18:36 +0300
committermakowalski <makowalski@nvidia.com>2021-02-12 23:18:36 +0300
commit84bb4fc00c82a7952830000eaa571413306c2f95 (patch)
tree1a2258e12bbb4b0c00e0961a47a9fce4de6fd2ee
parent0f84fbd6fdb490efe70aadaadb41c6d7ef72b2a7 (diff)
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.
-rw-r--r--source/blender/io/usd/intern/usd_util.cc4
1 files changed, 2 insertions, 2 deletions
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;