Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 5 Sep 2018 14:05:43 +0000 (16:05 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 5 Sep 2018 14:05:43 +0000 (16:05 +0200)
source/blender/blenkernel/BKE_ccg.h
source/blender/blenkernel/intern/CCGSubSurf.c
source/blender/blenkernel/intern/multires.c

index 7d5d423282dbc6adc2ebc5a8197b30f62211f385..65d4688947e6e765e460fa40e315ff79a563a8c1 100644 (file)
@@ -72,7 +72,6 @@ typedef struct CCGKey {
         * true */
        int mask_offset;
 
-       int num_layers;
        int has_normals;
        int has_mask;
 } CCGKey;
index dd5a87a445d1361f88ae7c0230c4dfd211b87923..6ec1b1b36b9d831e536767126a1be4c37010218b 100644 (file)
@@ -1555,7 +1555,6 @@ void CCG_key(CCGKey *key, const CCGSubSurf *ss, int level)
 
        key->elem_size = ss->meshIFC.vertDataSize;
        key->has_normals = ss->calcVertNormals;
-       key->num_layers = ss->meshIFC.numLayers;
 
        /* if normals are present, always the last three floats of an
         * element */
index f44f1265904532743569018c49f2bf0140511346..22a335c7fd4d0df1c7fcb7d8fa7b0b9825018851 100644 (file)
@@ -539,7 +539,7 @@ static void multires_copy_dm_grid(CCGElem *gridA, CCGElem *gridB, CCGKey *keyA,
                        for (x = 0; x < keyB->grid_size; x++, j++)
                                memcpy(CCG_elem_offset_co(keyA, gridA, y * skip * keyA->grid_size + x * skip),
                                       CCG_elem_offset_co(keyB, gridB, j),
-                                      sizeof(float) * keyA->num_layers);
+                                      keyA->elem_size);
        }
        else {
                skip = (keyB->grid_size - 1) / (keyA->grid_size - 1);
@@ -548,7 +548,7 @@ static void multires_copy_dm_grid(CCGElem *gridA, CCGElem *gridB, CCGKey *keyA,
                        for (x = 0; x < keyA->grid_size; x++, j++)
                                memcpy(CCG_elem_offset_co(keyA, gridA, j),
                                       CCG_elem_offset_co(keyB, gridB, y * skip * keyB->grid_size + x * skip),
-                                      sizeof(float) * keyA->num_layers);
+                                      keyA->elem_size);
        }
 }