From 2741992f6608c0f76e1bc95ca5d6e05a63348c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 1 Aug 2019 14:54:22 +0200 Subject: Fix T61935: load camera transforms from Alembic files written by Meshroom Meshroom writes two hierarchies to Alembic, one rooted at `/mvgRoot/mvgCameras` and the other at `/mvgRoot/mvgCamerasUndefined`. These paths have no schema definition, and thus are ignored by Blender. The cameras themselves have those schemaless paths as parent, and have their transforms marked as "inherited", e.g. relative to their parent. As these cameras have no valid parent, there is no Blender object to use to convert their local matrices to world matrices, and Blender just decided to reset them to the unit matrix. Now "inherited" transforms without a parent in Blender are interpreted as world transforms. Reparenting those objects to a Blender object will re-interpret the transforms as local to the parent again. --- source/blender/alembic/intern/abc_object.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/alembic') diff --git a/source/blender/alembic/intern/abc_object.cc b/source/blender/alembic/intern/abc_object.cc index 7b0d94a2305..f863fe4fee7 100644 --- a/source/blender/alembic/intern/abc_object.cc +++ b/source/blender/alembic/intern/abc_object.cc @@ -335,8 +335,10 @@ void AbcObjectReader::read_matrix(float r_mat[4][4], mul_m4_m4m4(r_mat, m_object->parent->obmat, r_mat); } else { - /* This can happen if the user deleted the parent object. */ - unit_m4(r_mat); + /* This can happen if the user deleted the parent object, but also if the Alembic parent was + * not imported (because of unknown/unsupported schema, for example). In that case just use + * the local matrix as if it is the world matrix. This allows us to import Alembic files from + * MeshRoom, see T61935. */ } } else { -- cgit v1.2.3