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>2020-12-23 20:34:14 +0300
committermakowalski <makowalski@nvidia.com>2020-12-23 20:34:14 +0300
commitee9d96f458a206b26edf069d8c7ecba3a76816f6 (patch)
tree2d98781fd8cbe93c2c734441e34653ba43c65b06 /source/blender/io/usd/import
parent7c6561e1c6c8627ee5d717d26ecea2bcad6dee0d (diff)
USD Importer Xform merge bug fix.
Disallow merging if parent isn't a UsdGeomXform.
Diffstat (limited to 'source/blender/io/usd/import')
-rw-r--r--source/blender/io/usd/import/usd_reader_xformable.cc12
-rw-r--r--source/blender/io/usd/import/usd_reader_xformable.h5
2 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/io/usd/import/usd_reader_xformable.cc b/source/blender/io/usd/import/usd_reader_xformable.cc
index 7a830269f00..2d96effa0c1 100644
--- a/source/blender/io/usd/import/usd_reader_xformable.cc
+++ b/source/blender/io/usd/import/usd_reader_xformable.cc
@@ -76,6 +76,18 @@ void USDXformableReader::eval_merged_with_parent()
}
}
+bool USDXformableReader::can_merge_with_parent() const
+{
+ bool can_merge = false;
+
+ if (valid()) {
+ pxr::UsdPrim parent = prim_.GetParent();
+ can_merge = parent && !parent.IsPseudoRoot() && parent.IsA<pxr::UsdGeomXform>();
+ }
+
+ return can_merge;
+}
+
void USDXformableReader::set_object_transform(const double time, CacheFile *cache_file)
{
if (!object_) {
diff --git a/source/blender/io/usd/import/usd_reader_xformable.h b/source/blender/io/usd/import/usd_reader_xformable.h
index 4f21f153482..65511f8b092 100644
--- a/source/blender/io/usd/import/usd_reader_xformable.h
+++ b/source/blender/io/usd/import/usd_reader_xformable.h
@@ -99,10 +99,7 @@ class USDXformableReader : public USDPrimReader {
virtual void create_object(Main *bmain, double time, USDDataCache *data_cache) = 0;
- virtual bool can_merge_with_parent() const
- {
- return true;
- }
+ virtual bool can_merge_with_parent() const;
void set_object_transform(const double time, CacheFile *cache_file = nullptr);