Alembic: only export custom data (UVs, VCols) once, on the first frame.
authorKévin Dietrich <kevin.dietrich@mailoo.org>
Thu, 20 Oct 2016 17:43:22 +0000 (19:43 +0200)
committerKévin Dietrich <kevin.dietrich@mailoo.org>
Thu, 20 Oct 2016 17:43:22 +0000 (19:43 +0200)
This would cause Alembic to throw an exception and fail exporting
animations because it was trying to recreate and overwrite the
attributes for each frame.

source/blender/alembic/intern/abc_mesh.cc

index 84b89d9ab9efa69274adccb7f3dfbda7ddeb7f31..bb5d5ce3566993023674c3ca303dffcc5d81f48d 100644 (file)
@@ -401,7 +401,7 @@ void AbcMeshWriter::writeMesh(DerivedMesh *dm)
                                                Int32ArraySample(loop_counts));
 
        UVSample sample;
-       if (m_settings.export_uvs) {
+       if (m_first_frame && m_settings.export_uvs) {
                const char *name = get_uv_sample(sample, m_custom_data_config, &dm->loopData);
 
                if (!sample.indices.empty() && !sample.uvs.empty()) {
@@ -470,7 +470,7 @@ void AbcMeshWriter::writeSubD(DerivedMesh *dm)
                                              Int32ArraySample(loop_counts));
 
        UVSample sample;
-       if (m_settings.export_uvs) {
+       if (m_first_frame && m_settings.export_uvs) {
                const char *name = get_uv_sample(sample, m_custom_data_config, &dm->loopData);
 
                if (!sample.indices.empty() && !sample.uvs.empty()) {
@@ -565,7 +565,7 @@ void AbcMeshWriter::writeArbGeoParams(DerivedMesh *dm)
                return;
        }
 
-       if (m_settings.export_vcols) {
+       if (m_first_frame && m_settings.export_vcols) {
                if (m_subdiv_schema.valid()) {
                        write_custom_data(m_subdiv_schema.getArbGeomParams(), m_custom_data_config, &dm->loopData, CD_MLOOPCOL);
                }