diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-03-22 12:41:50 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-03-22 12:41:50 +0400 |
commit | 975165341033baee59603a9648fc158ffd085d30 (patch) | |
tree | 92d7bfadff33cd074f3c89c65b5e87b70096933e | |
parent | 7044d806399db4c24b3e9d04f64bd85951c599ba (diff) |
Renaming CD_WEIGHT_MCOL/MLOOPCOL and their masks from WEIGHT to PREVIEW, as this layer is now also used for various preview tasks in Object mode.
“Cleanup” commit, no functional changes.
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_modifier.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 32 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/cdderivedmesh.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 20 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 20 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawmesh.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_customdata_types.h | 8 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgedit.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgmix.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgproximity.c | 2 |
16 files changed, 72 insertions, 70 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 546fd2bb354..4bccbf9e61e 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -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 } diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index 937eb02743f..b73982ca852 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -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; diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index b599c325e64..48dee60d470 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -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 diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 94741ec3b78..dab6ad27f3f 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -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]); } } diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 79e1daab226..3ce11f178f6 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -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); diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 56637dc84e1..2e13890dbd5 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -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) diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 476fcff9220..5dfabc64442 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -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); } diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 1951ce834ea..163223d1a18 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -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) { diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 3bf4be1ec3d..816667978f1 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -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); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index f470accae82..82dca500737 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -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 */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index dbd4a4107f8..49216310713 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -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; } } diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 57118e92d93..8698f036491 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -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; diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index 2a8c4c3a74e..9898f9715a0 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -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 */ diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index 45c934654d0..53bbaccd284 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -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; } diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c index 81a6ecc99e5..7e90a2d5526 100644 --- a/source/blender/modifiers/intern/MOD_weightvgmix.c +++ b/source/blender/modifiers/intern/MOD_weightvgmix.c @@ -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; } diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 4babe615a19..c15edec9108 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -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; } |