Commit: 5b0abee989a9604d0f8292fa86dfc2df11c969ad
Author: Kévin Dietrich
Date:   Mon Jul 4 08:49:10 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB5b0abee989a9604d0f8292fa86dfc2df11c969ad

Fix for UVs being missing when creating a new DerivedMesh in the cache
modifier.

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

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

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

diff --git a/source/blender/alembic/intern/alembic_capi.cc 
b/source/blender/alembic/intern/alembic_capi.cc
index c07d41d..6bd9bd2 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -703,7 +703,13 @@ static DerivedMesh *read_mesh_sample(DerivedMesh *dm, 
const IObject &iobject, co
 
        bool new_dm = false;
        if (dm->getNumVerts(dm) != positions->size()) {
-               dm = CDDM_new(positions->size(), 0, 0, face_indices->size(), 
face_counts->size());
+               DerivedMesh *tmp = CDDM_from_template(dm,
+                                                     positions->size(),
+                                                     0,
+                                                     0,
+                                                     face_indices->size(),
+                                                     face_counts->size());
+               dm = tmp;
                new_dm = true;
        }
 
@@ -758,8 +764,9 @@ static DerivedMesh *read_mesh_sample(DerivedMesh *dm, const 
IObject &iobject, co
                {
                        vertex_normals = normsamp.getVals();
                }
-
-               dm->dirty = 
static_cast<DMDirtyFlag>(static_cast<int>(dm->dirty) | 
static_cast<int>(DM_DIRTY_NORMALS));
+               else {
+                       dm->dirty = 
static_cast<DMDirtyFlag>(static_cast<int>(dm->dirty) | 
static_cast<int>(DM_DIRTY_NORMALS));
+               }
        }
 
        read_mverts(mverts, positions, vertex_normals);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to