Renaming CD_WEIGHT_MCOL/MLOOPCOL and their masks from WEIGHT to PREVIEW, as this...
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 22 Mar 2012 08:41:50 +0000 (08:41 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 22 Mar 2012 08:41:50 +0000 (08:41 +0000)
“Cleanup” commit, no functional changes.

16 files changed:
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_modifier.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/gpu/intern/gpu_buffers.c
source/blender/makesdna/DNA_customdata_types.h
source/blender/modifiers/intern/MOD_weightvgedit.c
source/blender/modifiers/intern/MOD_weightvgmix.c
source/blender/modifiers/intern/MOD_weightvgproximity.c

index 546fd2bb354e98de992cfb11c0f9b2bc1df02cdd..4bccbf9e61e5d7097457e35bef49ac5e13b21381 100644 (file)
@@ -301,7 +301,7 @@ void BKE_mesh_tessface_clear(struct Mesh *mesh);
 void mesh_loops_to_mface_corners(struct CustomData *fdata, struct CustomData *ldata,
                                  struct CustomData *pdata, int lindex[4], int findex,
                                  const int polyindex, const int mf_len,
-                                 const int numTex, const int numCol, const int hasWCol, const int hasOrigSpace);
+                                 const int numTex, const int numCol, const int hasPCol, const int hasOrigSpace);
 
 #ifdef __cplusplus
 }
index 937eb02743f7ee08de3fed766d47a623470cc679..b73982ca852e0fbf031395d22300b6e7f0fa4632 100644 (file)
@@ -101,7 +101,7 @@ typedef enum {
        /* Some modifier can't be added manually by user */
        eModifierTypeFlag_NoUserAdd = (1<<8),
 
-       /* For modifiers that use CD_WEIGHT_MCOL for preview. */
+       /* For modifiers that use CD_PREVIEW_MCOL for preview. */
        eModifierTypeFlag_UsesPreview = (1<<9)
 } ModifierTypeFlag;
 
index b599c325e64a802198b112a458e12d4bf5817bae..48dee60d470129c751c90ad321ab4041a70c32df 100644 (file)
@@ -398,7 +398,7 @@ void DM_update_tessface_data(DerivedMesh *dm)
 
        const int numTex = CustomData_number_of_layers(pdata, CD_MTEXPOLY);
        const int numCol = CustomData_number_of_layers(ldata, CD_MLOOPCOL);
-       const int hasWCol = CustomData_has_layer(ldata, CD_WEIGHT_MLOOPCOL);
+       const int hasPCol = CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL);
        const int hasOrigSpace = CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP);
 
        int *polyindex = CustomData_get_layer(fdata, CD_POLYINDEX);
@@ -442,7 +442,7 @@ void DM_update_tessface_data(DerivedMesh *dm)
                mesh_loops_to_mface_corners(fdata, ldata, pdata,
                                            ml_idx, mf_idx, polyindex[mf_idx],
                                            mf_len,
-                                           numTex, numCol, hasWCol, hasOrigSpace);
+                                           numTex, numCol, hasPCol, hasOrigSpace);
        }
 
        if (G.f & G_DEBUG)
@@ -1124,9 +1124,9 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
 
        unsigned char *wtcol_v;
 #if 0 /* See coment below. */
-       unsigned char *wtcol_f = dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL);
+       unsigned char *wtcol_f = dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL);
 #endif
-       unsigned char(*wtcol_l)[4] = CustomData_get_layer(dm->getLoopDataLayout(dm), CD_WEIGHT_MLOOPCOL);
+       unsigned char(*wtcol_l)[4] = CustomData_get_layer(dm->getLoopDataLayout(dm), CD_PREVIEW_MLOOPCOL);
 #if 0 /* See coment below. */
        MFace *mf = dm->getTessFaceArray(dm);
 #endif
@@ -1140,17 +1140,17 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
        int i, j;
 
 #if 0 /* See comment below */
-       /* If no CD_WEIGHT_MCOL existed yet, add a new one! */
+       /* If no CD_PREVIEW_MCOL existed yet, add a new one! */
        if (!wtcol_f)
-               wtcol_f = CustomData_add_layer(&dm->faceData, CD_WEIGHT_MCOL, CD_CALLOC, NULL, numFaces);
+               wtcol_f = CustomData_add_layer(&dm->faceData, CD_PREVIEW_MCOL, CD_CALLOC, NULL, numFaces);
 
        if (wtcol_f) {
                unsigned char *wtcol_f_step = wtcol_f;
 # else
 #if 0
-       /* XXX We have to create a CD_WEIGHT_MCOL, else it might sigsev (after a SubSurf mod, eg)... */
-       if(!dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL))
-               CustomData_add_layer(&dm->faceData, CD_WEIGHT_MCOL, CD_CALLOC, NULL, numFaces);
+       /* XXX We have to create a CD_PREVIEW_MCOL, else it might sigsev (after a SubSurf mod, eg)... */
+       if(!dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL))
+               CustomData_add_layer(&dm->faceData, CD_PREVIEW_MCOL, CD_CALLOC, NULL, numFaces);
 #endif
 
        {
@@ -1208,7 +1208,7 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
                }
 #endif
                /*now add to loops, so the data can be passed through the modifier stack*/
-               /* If no CD_WEIGHT_MLOOPCOL existed yet, we have to add a new one! */
+               /* If no CD_PREVIEW_MLOOPCOL existed yet, we have to add a new one! */
                if (!wtcol_l) {
                        BLI_array_declare(wtcol_l);
                        totloop = 0;
@@ -1221,7 +1221,7 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
                                                        (char *)&wtcol_v[4 * ml->v]);
                                }
                        }
-                       CustomData_add_layer(&dm->loopData, CD_WEIGHT_MLOOPCOL, CD_ASSIGN, wtcol_l, totloop);
+                       CustomData_add_layer(&dm->loopData, CD_PREVIEW_MLOOPCOL, CD_ASSIGN, wtcol_l, totloop);
                }
                else {
                        totloop = 0;
@@ -1370,7 +1370,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
        const int do_final_wmcol = (scene->toolsettings->weights_preview == WP_WPREVIEW_FINAL) && do_wmcol;
 #endif
        const int do_final_wmcol = FALSE;
-       int do_init_wmcol = ((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT) && !do_final_wmcol);
+       int do_init_wmcol = ((dataMask & CD_MASK_PREVIEW_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT) && !do_final_wmcol);
        /* XXX Same as above... For now, only weights preview in WPaint mode. */
        const int do_mod_wmcol = do_init_wmcol;
 
@@ -1659,11 +1659,11 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                        /* in case of dynamic paint, make sure preview mask remains for following modifiers */
                        /* XXX Temp and hackish solution! */
                        if (md->type == eModifierType_DynamicPaint)
-                               append_mask |= CD_MASK_WEIGHT_MLOOPCOL;
+                               append_mask |= CD_MASK_PREVIEW_MLOOPCOL;
                        /* In case of active preview modifier, make sure preview mask remains for following modifiers. */
                        else if ((md == previewmd) && (do_mod_wmcol)) {
                                DM_update_weight_mcol(ob, dm, draw_flag, NULL, 0, NULL);
-                               append_mask |= CD_MASK_WEIGHT_MLOOPCOL;
+                               append_mask |= CD_MASK_PREVIEW_MLOOPCOL;
                        }
                }
 
@@ -1693,7 +1693,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                CDDM_calc_normals(finaldm);
 
 #if 0 /* For later nice mod preview! */
-               /* In case we need modified weights in CD_WEIGHT_MCOL, we have to re-compute it. */
+               /* In case we need modified weights in CD_PREVIEW_MCOL, we have to re-compute it. */
                if(do_final_wmcol)
                        DM_update_weight_mcol(ob, finaldm, draw_flag, NULL, 0, NULL);
 #endif
@@ -1701,7 +1701,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                finaldm = dm;
 
 #if 0 /* For later nice mod preview! */
-               /* In case we need modified weights in CD_WEIGHT_MCOL, we have to re-compute it. */
+               /* In case we need modified weights in CD_PREVIEW_MCOL, we have to re-compute it. */
                if(do_final_wmcol)
                        DM_update_weight_mcol(ob, finaldm, draw_flag, NULL, 0, NULL);
 #endif
index 94741ec3b7807c81fc14898d959799e99fc27af6..dab6ad27f3fd671de3bae3606f37d80dce0b7265 100644 (file)
@@ -612,7 +612,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
        MTFace *tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
        int i, j, orig, *index = DM_get_tessface_data_layer(dm, CD_ORIGINDEX);
        int startFace = 0 /*, lastFlag = 0xdeadbeef */ /* UNUSED */;
-       MCol *mcol = dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL);
+       MCol *mcol = dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL);
        if(!mcol)
                mcol = dm->getTessFaceDataArray(dm, CD_MCOL);
 
@@ -811,7 +811,7 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
 
        mc = DM_get_tessface_data_layer(dm, CD_ID_MCOL);
        if(!mc)
-               mc = DM_get_tessface_data_layer(dm, CD_WEIGHT_MCOL);
+               mc = DM_get_tessface_data_layer(dm, CD_PREVIEW_MCOL);
        if(!mc)
                mc = DM_get_tessface_data_layer(dm, CD_MCOL);
 
@@ -1742,7 +1742,7 @@ static void loops_to_customdata_corners(BMesh *bm, CustomData *facedata,
        MCol *mcol;
        MLoopCol *mloopcol;
        MLoopUV *mloopuv;
-       int i, j, hasWCol = CustomData_has_layer(&bm->ldata, CD_WEIGHT_MLOOPCOL);
+       int i, j, hasPCol = CustomData_has_layer(&bm->ldata, CD_PREVIEW_MLOOPCOL);
 
        for (i=0; i < numTex; i++) {
                texface = CustomData_get_n(facedata, CD_MTFACE, cdindex, i);
@@ -1767,12 +1767,12 @@ static void loops_to_customdata_corners(BMesh *bm, CustomData *facedata,
                }
        }
 
-       if (hasWCol) {
-               mcol = CustomData_get(facedata, cdindex, CD_WEIGHT_MCOL);
+       if (hasPCol) {
+               mcol = CustomData_get(facedata, cdindex, CD_PREVIEW_MCOL);
 
                for (j=0; j<3; j++) {
                        l = l3[j];
-                       mloopcol = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_WEIGHT_MLOOPCOL);
+                       mloopcol = CustomData_bmesh_get(&bm->ldata, l->head.data, CD_PREVIEW_MLOOPCOL);
                        MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]);
                }
        }
index 79e1daab226dfd049b3df4f0c5dfdf6a45b9c44f..3ce11f178f6110249852d4d9bb740aa2758d7415 100644 (file)
@@ -1012,8 +1012,8 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
         layerFree_mdisps, NULL, layerSwap_mdisps, NULL,
         NULL, NULL, NULL, NULL, NULL, NULL, 
         layerRead_mdisps, layerWrite_mdisps, layerFilesize_mdisps},
-       /* 20: CD_WEIGHT_MCOL */
-       {sizeof(MCol)*4, "MCol", 4, "WeightCol", NULL, NULL, layerInterp_mcol,
+       /* 20: CD_PREVIEW_MCOL */
+       {sizeof(MCol)*4, "MCol", 4, "PreviewCol", NULL, NULL, layerInterp_mcol,
         layerSwap_mcol, layerDefault_mcol},
        /* 21: CD_ID_MCOL */
        {sizeof(MCol)*4, "MCol", 4, "IDCol", NULL, NULL, layerInterp_mcol,
@@ -1044,8 +1044,8 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
        {sizeof(OrigSpaceLoop), "OrigSpaceLoop", 1, "OS Loop", NULL, NULL, layerInterp_mloop_origspace, NULL, NULL,
         layerEqual_mloop_origspace, layerMultiply_mloop_origspace, layerInitMinMax_mloop_origspace,
         layerAdd_mloop_origspace, layerDoMinMax_mloop_origspace, layerCopyValue_mloop_origspace},
-       /* 32: CD_WEIGHT_MLOOPCOL */
-       {sizeof(MLoopCol), "MLoopCol", 1, "WeightLoopCol", NULL, NULL, layerInterp_mloopcol, NULL,
+       /* 32: CD_PREVIEW_MLOOPCOL */
+       {sizeof(MLoopCol), "MLoopCol", 1, "PreviewLoopCol", NULL, NULL, layerInterp_mloopcol, NULL,
         layerDefault_mloopcol, layerEqual_mloopcol, layerMultiply_mloopcol, layerInitMinMax_mloopcol,
         layerAdd_mloopcol, layerDoMinMax_mloopcol, layerCopyValue_mloopcol},
        /* 33: CD_BM_ELEM_PYPTR */
@@ -1064,12 +1064,12 @@ static const char *LAYERTYPENAMES[CD_NUMTYPES] = {
        /*   5-9 */ "CDMTFace", "CDMCol", "CDOrigIndex", "CDNormal", "CDFlags",
        /* 10-14 */ "CDMFloatProperty", "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco",
        /* 15-19 */ "CDMTexPoly", "CDMLoopUV", "CDMloopCol", "CDTangent", "CDMDisps",
-       /* 20-24 */"CDWeightMCol", "CDIDMCol", "CDTextureMCol", "CDClothOrco", "CDMRecast"
+       /* 20-24 */"CDPreviewMCol", "CDIDMCol", "CDTextureMCol", "CDClothOrco", "CDMRecast"
 
 /* BMESH ONLY */
        ,
        /* 25-29 */ "CDMPoly", "CDMLoop", "CDShapeKeyIndex", "CDShapeKey", "CDBevelWeight",
-       /* 30-32 */ "CDSubSurfCrease", "CDOrigSpaceLoop", "CDWeightLoopCol"
+       /* 30-32 */ "CDSubSurfCrease", "CDOrigSpaceLoop", "CDPreviewLoopCol"
 /* END BMESH ONLY */
 
 };
@@ -1091,9 +1091,9 @@ const CustomDataMask CD_MASK_EDITMESH =
 const CustomDataMask CD_MASK_DERIVEDMESH =
        CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_MTFACE |
        CD_MASK_MCOL | CD_MASK_PROP_FLT | CD_MASK_PROP_INT | CD_MASK_CLOTH_ORCO |
-       CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL | CD_MASK_MTEXPOLY | CD_MASK_WEIGHT_MLOOPCOL |
+       CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL | CD_MASK_MTEXPOLY | CD_MASK_PREVIEW_MLOOPCOL |
        CD_MASK_PROP_STR | CD_MASK_ORIGSPACE | CD_MASK_ORIGSPACE_MLOOP | CD_MASK_ORCO | CD_MASK_TANGENT |
-       CD_MASK_WEIGHT_MCOL | CD_MASK_NORMAL | CD_MASK_SHAPEKEY | CD_MASK_RECAST |
+       CD_MASK_PREVIEW_MCOL | CD_MASK_NORMAL | CD_MASK_SHAPEKEY | CD_MASK_RECAST |
        CD_MASK_ORIGINDEX | CD_MASK_POLYINDEX;
 const CustomDataMask CD_MASK_BMESH = CD_MASK_MLOOPUV | CD_MASK_MLOOPCOL | CD_MASK_MTEXPOLY |
        CD_MASK_MSTICKY | CD_MASK_MDEFORMVERT | CD_MASK_PROP_FLT | CD_MASK_PROP_INT | 
@@ -2082,8 +2082,8 @@ void CustomData_from_bmeshpoly(CustomData *fdata, CustomData *pdata, CustomData
                if (ldata->layers[i].type == CD_MLOOPCOL) {
                        CustomData_add_layer_named(fdata, CD_MCOL, CD_CALLOC, NULL, total, ldata->layers[i].name);
                }
-               else if (ldata->layers[i].type == CD_WEIGHT_MLOOPCOL) {
-                       CustomData_add_layer_named(fdata, CD_WEIGHT_MCOL, CD_CALLOC, NULL, total, ldata->layers[i].name);
+               else if (ldata->layers[i].type == CD_PREVIEW_MLOOPCOL) {
+                       CustomData_add_layer_named(fdata, CD_PREVIEW_MCOL, CD_CALLOC, NULL, total, ldata->layers[i].name);
                }
                else if (ldata->layers[i].type == CD_ORIGSPACE_MLOOP) {
                        CustomData_add_layer_named(fdata, CD_ORIGSPACE, CD_CALLOC, NULL, total, ldata->layers[i].name);
index 56637dc84e1532266eb176b03e4d786460ba8777..2e13890dbd5959ffaa27ffc0b84710f97ff63dec 100644 (file)
@@ -1613,18 +1613,20 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
                                                        int totpoly = result->numPolyData;
 
 #if 0
-                                                       /* XXX We have to create a CD_WEIGHT_MCOL, else it might sigsev
+                                                       /* XXX We have to create a CD_PREVIEW_MCOL, else it might sigsev
                                                         *     (after a SubSurf mod, eg)... */
-                                                       if(!result->getTessFaceDataArray(result, CD_WEIGHT_MCOL)) {
+                                                       if(!result->getTessFaceDataArray(result, CD_PREVIEW_MCOL)) {
                                                                int numFaces = result->getNumTessFaces(result);
-                                                               CustomData_add_layer(&result->faceData, CD_WEIGHT_MCOL, CD_CALLOC, NULL, numFaces);
+                                                               CustomData_add_layer(&result->faceData, CD_PREVIEW_MCOL, CD_CALLOC, NULL, numFaces);
                                                        }
 #endif
 
                                                        /* Save preview results to weight layer to be
                                                        *   able to share same drawing methods */
-                                                       col = CustomData_get_layer(&result->loopData, CD_WEIGHT_MLOOPCOL);
-                                                       if (!col) col = CustomData_add_layer(&result->loopData, CD_WEIGHT_MLOOPCOL, CD_CALLOC, NULL, totloop);
+                                                       col = CustomData_get_layer(&result->loopData, CD_PREVIEW_MLOOPCOL);
+                                                       if (!col)
+                                                               col = CustomData_add_layer(&result->loopData, CD_PREVIEW_MLOOPCOL, CD_CALLOC,
+                                                                                          NULL, totloop);
 
                                                        if (col) {
                                                                #pragma omp parallel for schedule(static)
index 476fcff9220bdc315573bd9f9b44bb3d65fece67..5dfabc644426a318c196d766bf714120994bba39 100644 (file)
@@ -2274,7 +2274,7 @@ void mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata,
                                  /* cache values to avoid lookups every time */
                                  const int numTex, /* CustomData_number_of_layers(pdata, CD_MTEXPOLY) */
                                  const int numCol, /* CustomData_number_of_layers(ldata, CD_MLOOPCOL) */
-                                 const int hasWCol, /* CustomData_has_layer(ldata, CD_WEIGHT_MLOOPCOL) */
+                                 const int hasPCol, /* CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL) */
                                  const int hasOrigSpace /* CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP) */
                                  )
 {
@@ -2306,11 +2306,11 @@ void mesh_loops_to_mface_corners(CustomData *fdata, CustomData *ldata,
                }
        }
 
-       if (hasWCol) {
-               mcol = CustomData_get(fdata,  findex, CD_WEIGHT_MCOL);
+       if (hasPCol) {
+               mcol = CustomData_get(fdata,  findex, CD_PREVIEW_MCOL);
 
                for (j=0; j < mf_len; j++) {
-                       mloopcol = CustomData_get(ldata, lindex[j], CD_WEIGHT_MLOOPCOL);
+                       mloopcol = CustomData_get(ldata, lindex[j], CD_PREVIEW_MLOOPCOL);
                        MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]);
                }
        }
@@ -2364,7 +2364,7 @@ int mesh_recalcTessellation(CustomData *fdata,
 
        const int numTex = CustomData_number_of_layers(pdata, CD_MTEXPOLY);
        const int numCol = CustomData_number_of_layers(ldata, CD_MLOOPCOL);
-       const int hasWCol = CustomData_has_layer(ldata, CD_WEIGHT_MLOOPCOL);
+       const int hasPCol = CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL);
        const int hasOrigSpace = CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP);
 
        mpoly = CustomData_get_layer(pdata, CD_MPOLY);
@@ -2587,7 +2587,7 @@ int mesh_recalcTessellation(CustomData *fdata,
 #else
                                            3,
 #endif
-                                           numTex, numCol, hasWCol, hasOrigSpace);
+                                           numTex, numCol, hasPCol, hasOrigSpace);
 
 
 #ifdef USE_TESSFACE_QUADS
@@ -2624,7 +2624,7 @@ int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
 
        const int numTex = CustomData_number_of_layers(pdata, CD_MTEXPOLY);
        const int numCol = CustomData_number_of_layers(ldata, CD_MLOOPCOL);
-       const int hasWCol = CustomData_has_layer(ldata, CD_WEIGHT_MLOOPCOL);
+       const int hasPCol = CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL);
        const int hasOrigSpace = CustomData_has_layer(ldata, CD_ORIGSPACE_MLOOP);
 
        mpoly = CustomData_get_layer(pdata, CD_MPOLY);
@@ -2683,7 +2683,7 @@ int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
 
                                mesh_loops_to_mface_corners(fdata, ldata, pdata,
                                                            lindex, k, i, 3,
-                                                           numTex, numCol, hasWCol, hasOrigSpace);
+                                                           numTex, numCol, hasPCol, hasOrigSpace);
                                test_index_face(mf, fdata, k, 3);
                        }
                        else {
@@ -2703,7 +2703,7 @@ int mesh_mpoly_to_mface(struct CustomData *fdata, struct CustomData *ldata,
 
                                mesh_loops_to_mface_corners(fdata, ldata, pdata,
                                                            lindex, k, i, 4,
-                                                           numTex, numCol, hasWCol, hasOrigSpace);
+                                                           numTex, numCol, hasPCol, hasOrigSpace);
                                test_index_face(mf, fdata, k, 4);
                        }
 
index 1951ce834ea8fbd682347287acfa69a5e231be24..163223d1a184fb0d697d9b899cac746626c74b7a 100644 (file)
@@ -1964,7 +1964,7 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
 {
        CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
        CCGSubSurf *ss = ccgdm->ss;
-       MCol *mcol = dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL);
+       MCol *mcol = dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL);
        MTFace *tf = DM_get_tessface_data_layer(dm, CD_MTFACE);
        DMFlagMat *faceFlags = ccgdm->faceFlags;
        DMDrawOption draw_option;
@@ -2171,7 +2171,7 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm,
        (void)compareDrawOptions;
 
        if(useColors) {
-               mcol = dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL);
+               mcol = dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL);
                if(!mcol)
                        mcol = dm->getTessFaceDataArray(dm, CD_MCOL);
        }
@@ -2424,7 +2424,7 @@ static void ccgDM_release(DerivedMesh *dm)
 
 static void ccg_loops_to_corners(CustomData *fdata, CustomData *ldata, 
                                  CustomData *pdata, int loopstart, int findex,  int polyindex,
-                                 const int numTex, const int numCol, const int hasWCol, const int hasOrigSpace)
+                                 const int numTex, const int numCol, const int hasPCol, const int hasOrigSpace)
 {
        MTFace *texface;
        MTexPoly *texpoly;
@@ -2454,9 +2454,9 @@ static void ccg_loops_to_corners(CustomData *fdata, CustomData *ldata,
                }
        }
        
-       if (hasWCol) {
-               mloopcol = CustomData_get(ldata, loopstart, CD_WEIGHT_MLOOPCOL);
-               mcol = CustomData_get(fdata, findex, CD_WEIGHT_MCOL);
+       if (hasPCol) {
+               mloopcol = CustomData_get(ldata, loopstart, CD_PREVIEW_MLOOPCOL);
+               mcol = CustomData_get(fdata, findex, CD_PREVIEW_MCOL);
 
                for (j=0; j<4; j++, mloopcol++) {
                        MESH_MLOOPCOL_TO_MCOL(mloopcol, &mcol[j]);
@@ -2898,7 +2898,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
        /*int gridSideVerts;*/
        int gridSideEdges;
        int numTex, numCol;
-       int hasWCol, hasOrigSpace;
+       int hasPCol, hasOrigSpace;
        int gridInternalEdges;
        float *w = NULL;
        WeightTable wtable = {0};
@@ -2916,13 +2916,13 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
        
        numTex = CustomData_number_of_layers(&ccgdm->dm.loopData, CD_MLOOPUV);
        numCol = CustomData_number_of_layers(&ccgdm->dm.loopData, CD_MLOOPCOL);
-       hasWCol = CustomData_has_layer(&ccgdm->dm.loopData, CD_WEIGHT_MLOOPCOL);
+       hasPCol = CustomData_has_layer(&ccgdm->dm.loopData, CD_PREVIEW_MLOOPCOL);
        hasOrigSpace = CustomData_has_layer(&ccgdm->dm.loopData, CD_ORIGSPACE_MLOOP);
        
        if (
                (numTex && CustomData_number_of_layers(&ccgdm->dm.faceData, CD_MTFACE) != numTex)  ||
                (numCol && CustomData_number_of_layers(&ccgdm->dm.faceData, CD_MCOL) != numCol)    ||
-               (hasWCol && !CustomData_has_layer(&ccgdm->dm.faceData, CD_WEIGHT_MCOL))            ||
+               (hasPCol && !CustomData_has_layer(&ccgdm->dm.faceData, CD_PREVIEW_MCOL))            ||
                (hasOrigSpace && !CustomData_has_layer(&ccgdm->dm.faceData, CD_ORIGSPACE)) )
        {
                CustomData_from_bmeshpoly(&ccgdm->dm.faceData,
@@ -3198,7 +3198,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
                                        /*generate tessellated face data used for drawing*/
                                        ccg_loops_to_corners(&ccgdm->dm.faceData, &ccgdm->dm.loopData,
                                                             &ccgdm->dm.polyData, loopindex2-4, faceNum, faceNum,
-                                                            numTex, numCol, hasWCol, hasOrigSpace);
+                                                            numTex, numCol, hasPCol, hasOrigSpace);
                                        
                                        /*set original index data*/
                                        if (faceOrigIndex) {
index 3bf4be1ec3d75e5d038a2bc112cceecec6cd0c49..816667978f12f7ad46ed686776571131df79a182 100644 (file)
@@ -461,7 +461,7 @@ static void add_tface_color_layer(DerivedMesh *dm)
        MFace *mface = dm->getTessFaceArray(dm);
        MCol *finalCol;
        int i,j;
-       MCol *mcol = dm->getTessFaceDataArray(dm, CD_WEIGHT_MCOL);
+       MCol *mcol = dm->getTessFaceDataArray(dm, CD_PREVIEW_MCOL);
        if (!mcol)
                mcol = dm->getTessFaceDataArray(dm, CD_MCOL);
 
index f470accae82180a4cb27e6f4bc54b96f22ffba35..82dca5007372fb80462c5e5005f4316e7c874356 100644 (file)
@@ -3227,7 +3227,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
 
        /* Check to draw dynamic paint colors (or weights from WeightVG modifiers).
         * Note: Last "preview-active" modifier in stack will win! */
-       if (DM_get_tessface_data_layer(dm, CD_WEIGHT_MCOL) && modifiers_isPreview(ob))
+       if (DM_get_tessface_data_layer(dm, CD_PREVIEW_MCOL) && modifiers_isPreview(ob))
                draw_flags |= DRAW_MODIFIERS_PREVIEW;
 
        /* Unwanted combination */
index dbd4a4107f8f0f997f412f978a76e4359bdda13e..492163107134b197370a7b915b3727c8407280c6 100644 (file)
@@ -2301,7 +2301,7 @@ CustomDataMask ED_view3d_object_datamask(Scene *scene)
                }
 
                if (ob->mode & OB_MODE_WEIGHT_PAINT) {
-                       mask |= CD_MASK_WEIGHT_MCOL;
+                       mask |= CD_MASK_PREVIEW_MCOL;
                }
        }
 
index 57118e92d938215807ddb320f68545873c15c488..8698f03649111f8928c550701ef8a3e1c5fff914 100644 (file)
@@ -812,7 +812,7 @@ static void GPU_buffer_copy_uvedge(DerivedMesh *dm, float *varray, int *UNUSED(i
 }
 
 /* get the DerivedMesh's MCols; choose (in decreasing order of
-   preference) from CD_ID_MCOL, CD_WEIGHT_MCOL, or CD_MCOL */
+   preference) from CD_ID_MCOL, CD_PREVIEW_MCOL, or CD_MCOL */
 static MCol *gpu_buffer_color_type(DerivedMesh *dm)
 {
        MCol *c;
@@ -821,7 +821,7 @@ static MCol *gpu_buffer_color_type(DerivedMesh *dm)
        type = CD_ID_MCOL;
        c = DM_get_tessface_data_layer(dm, type);
        if(!c) {
-               type = CD_WEIGHT_MCOL;
+               type = CD_PREVIEW_MCOL;
                c = DM_get_tessface_data_layer(dm, type);
                if(!c) {
                        type = CD_MCOL;
index 2a8c4c3a74e8cdd9b9a644192c50f8ec5a359538..9898f9715a0731bb5e8a666b2cb24bfb8409987b 100644 (file)
@@ -94,7 +94,7 @@ typedef struct CustomData {
 #define CD_MLOOPCOL            17
 #define CD_TANGENT             18
 #define CD_MDISPS              19
-#define CD_WEIGHT_MCOL 20 /* for displaying weightpaint colors */
+#define CD_PREVIEW_MCOL        20 /* for displaying weightpaint colors */
 #define CD_ID_MCOL             21
 #define CD_TEXTURE_MCOL        22
 #define CD_CLOTH_ORCO  23
@@ -108,7 +108,7 @@ typedef struct CustomData {
 #define CD_BWEIGHT             29
 #define CD_CREASE              30
 #define CD_ORIGSPACE_MLOOP     31
-#define CD_WEIGHT_MLOOPCOL     32
+#define CD_PREVIEW_MLOOPCOL    32
 #define CD_BM_ELEM_PYPTR       33
 /* BMESH ONLY END */
 
@@ -135,7 +135,7 @@ typedef struct CustomData {
 #define CD_MASK_MLOOPCOL       (1 << CD_MLOOPCOL)
 #define CD_MASK_TANGENT                (1 << CD_TANGENT)
 #define CD_MASK_MDISPS         (1 << CD_MDISPS)
-#define CD_MASK_WEIGHT_MCOL    (1 << CD_WEIGHT_MCOL)
+#define CD_MASK_PREVIEW_MCOL   (1 << CD_PREVIEW_MCOL)
 #define CD_MASK_CLOTH_ORCO     (1 << CD_CLOTH_ORCO)
 #define CD_MASK_RECAST         (1 << CD_RECAST)
 
@@ -147,7 +147,7 @@ typedef struct CustomData {
 #define CD_MASK_BWEIGHT                (1 << CD_BWEIGHT)
 #define CD_MASK_CREASE         (1 << CD_CREASE)
 #define CD_MASK_ORIGSPACE_MLOOP        (1 << CD_ORIGSPACE_MLOOP)
-#define CD_MASK_WEIGHT_MLOOPCOL (1LL << CD_WEIGHT_MLOOPCOL)
+#define CD_MASK_PREVIEW_MLOOPCOL (1LL << CD_PREVIEW_MLOOPCOL)
 #define CD_MASK_BM_ELEM_PYPTR (1LL << CD_BM_ELEM_PYPTR)
 /* BMESH ONLY END */
 
index 45c934654d0678947beae355ce08b35bdfdc16c5..53bbaccd284aa6d4beddd4f31e91b743a217d14c 100644 (file)
@@ -114,7 +114,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
        if(wmd->mask_tex_mapping == MOD_DISP_MAP_UV)
                dataMask |= CD_MASK_MTFACE;
 
-       /* No need to ask for CD_WEIGHT_MCOL... */
+       /* No need to ask for CD_PREVIEW_MLOOPCOL... */
 
        return dataMask;
 }
index 81a6ecc99e5e8382f89988597411b63a70764cba..7e90a2d5526ad8082514a08d43f7e74f44ec52da 100644 (file)
@@ -156,7 +156,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
        if(wmd->mask_tex_mapping == MOD_DISP_MAP_UV)
                dataMask |= CD_MASK_MTFACE;
 
-       /* No need to ask for CD_WEIGHT_MCOL... */
+       /* No need to ask for CD_PREVIEW_MLOOPCOL... */
 
        return dataMask;
 }
index 4babe615a190e2a03cd62d0ef827b2aea4fe852d..c15edec91080b57680f14916abed8441249cdc04 100644 (file)
@@ -267,7 +267,7 @@ static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
        if(wmd->mask_tex_mapping == MOD_DISP_MAP_UV)
                dataMask |= CD_MASK_MTFACE;
 
-       /* No need to ask for CD_WEIGHT_MCOL... */
+       /* No need to ask for CD_PREVIEW_MLOOPCOL... */
 
        return dataMask;
 }