diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-04-14 19:20:24 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-04-14 19:20:28 +0300 |
commit | 5fa4f397c2050fa15e28855acae1520377a4a517 (patch) | |
tree | f0f1afb37f20ba39c90d4c59b4cb7c9abf92d73a /source/blender/alembic/intern/abc_util.cc | |
parent | 4d117f2fd2438989d90b40f38d2ca1625be9e6e0 (diff) |
Alembic import: fixed dupligroup export when the dupli-empty has a parent
Diffstat (limited to 'source/blender/alembic/intern/abc_util.cc')
-rw-r--r-- | source/blender/alembic/intern/abc_util.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/alembic/intern/abc_util.cc b/source/blender/alembic/intern/abc_util.cc index 248ca4e64ae..67d2d3b1eb2 100644 --- a/source/blender/alembic/intern/abc_util.cc +++ b/source/blender/alembic/intern/abc_util.cc @@ -257,7 +257,8 @@ void convert_matrix(const Imath::M44d &xform, Object *ob, float r_mat[4][4]) /* Recompute transform matrix of object in new coordinate system * (from Z-Up to Y-Up). */ -void create_transform_matrix(Object *obj, float r_yup_mat[4][4], AbcMatrixMode mode) +void create_transform_matrix(Object *obj, float r_yup_mat[4][4], AbcMatrixMode mode, + Object *proxy_from) { float zup_mat[4][4]; @@ -267,11 +268,16 @@ void create_transform_matrix(Object *obj, float r_yup_mat[4][4], AbcMatrixMode m * constraints and modifiers as well as the obj->parentinv matrix. */ invert_m4_m4(obj->parent->imat, obj->parent->obmat); mul_m4_m4m4(zup_mat, obj->parent->imat, obj->obmat); - copy_m44_axis_swap(r_yup_mat, zup_mat, ABC_YUP_FROM_ZUP); } else { - copy_m44_axis_swap(r_yup_mat, obj->obmat, ABC_YUP_FROM_ZUP); + copy_m4_m4(zup_mat, obj->obmat); } + + if (proxy_from) { + mul_m4_m4m4(zup_mat, proxy_from->obmat, zup_mat); + } + + copy_m44_axis_swap(r_yup_mat, zup_mat, ABC_YUP_FROM_ZUP); } bool has_property(const Alembic::Abc::ICompoundProperty &prop, const std::string &name) |