[Bf-blender-cvs] [94cbfb71bcf] blender-v2.83-release: Fix T76132: Can't import Alembic with changing UVs

Sybren A. Stüvel noreply at git.blender.org
Tue May 12 15:07:33 CEST 2020


Commit: 94cbfb71bcf4f0499301f7c6f201124d8740cacf
Author: Sybren A. Stüvel
Date:   Tue May 12 15:06:29 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB94cbfb71bcf4f0499301f7c6f201124d8740cacf

Fix T76132: Can't import Alembic with changing UVs

In the Alembic importer, the animation of UVs and normals was
overlooked; when the mesh geometry is not animated, the entire mesh was
considered constant.

T76132 concerns both the exporting and importing of changing UVs. This
commit fixes the importing.

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

M	source/blender/io/alembic/intern/abc_reader_mesh.cc

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

diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc
index b85bce3e10a..b69a5301d76 100644
--- a/source/blender/io/alembic/intern/abc_reader_mesh.cc
+++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc
@@ -482,6 +482,19 @@ bool AbcMeshReader::valid() const
   return m_schema.valid();
 }
 
+/* Specialisation of has_animations() as defined in abc_reader_object.h. */
+template<> bool has_animations(Alembic::AbcGeom::IPolyMeshSchema &schema, ImportSettings *settings)
+{
+  if (settings->is_sequence || !schema.isConstant()) {
+    return true;
+  }
+
+  IV2fGeomParam uvsParam = schema.getUVsParam();
+  IN3fGeomParam normalsParam = schema.getNormalsParam();
+  return (uvsParam.valid() && !uvsParam.isConstant()) ||
+         (normalsParam.valid() && !normalsParam.isConstant());
+}
+
 void AbcMeshReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel)
 {
   Mesh *mesh = BKE_mesh_add(bmain, m_data_name.c_str());



More information about the Bf-blender-cvs mailing list