[Bf-blender-cvs] [20029f91b0e] usd-importer-T81257: USD importer: fixed scene scaling.
Michael A. Kowalski
noreply at git.blender.org
Fri Oct 16 01:20:50 CEST 2020
Commit: 20029f91b0ea587ecbfc2bb260fd489347b99c49
Author: Michael A. Kowalski
Date: Thu Oct 15 19:19:05 2020 -0400
Branches: usd-importer-T81257
https://developer.blender.org/rB20029f91b0ea587ecbfc2bb260fd489347b99c49
USD importer: fixed scene scaling.
===================================================================
M source/blender/io/usd/import/usd_reader_object.cc
===================================================================
diff --git a/source/blender/io/usd/import/usd_reader_object.cc b/source/blender/io/usd/import/usd_reader_object.cc
index 55eb0328acb..1ffa698f567 100644
--- a/source/blender/io/usd/import/usd_reader_object.cc
+++ b/source/blender/io/usd/import/usd_reader_object.cc
@@ -159,9 +159,12 @@ void UsdObjectReader::read_matrix(float r_mat[4][4] /* local matrix */,
copy_m44_axis_swap(r_mat, r_mat, USD_ZUP_FROM_YUP);
}
- float scale_mat[4][4];
- scale_m4_fl(scale_mat, scale);
- mul_m4_m4m4(r_mat, scale_mat, r_mat);
+ /* Apply scaling only to root objects, parenting will propagate it. */
+ if (!this->parent_) {
+ float scale_mat[4][4];
+ scale_m4_fl(scale_mat, scale);
+ mul_m4_m4m4(r_mat, scale_mat, r_mat);
+ }
}
double UsdObjectReader::minTime() const
More information about the Bf-blender-cvs
mailing list