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

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to