[Bf-blender-cvs] [2741992f660] master: Fix T61935: load camera transforms from Alembic files written by Meshroom

Sybren A. Stüvel noreply at git.blender.org
Thu Aug 1 14:57:31 CEST 2019


Commit: 2741992f6608c0f76e1bc95ca5d6e05a63348c7f
Author: Sybren A. Stüvel
Date:   Thu Aug 1 14:54:22 2019 +0200
Branches: master
https://developer.blender.org/rB2741992f6608c0f76e1bc95ca5d6e05a63348c7f

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.

===================================================================

M	source/blender/alembic/intern/abc_object.cc

===================================================================

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 {



More information about the Bf-blender-cvs mailing list