diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_explode.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_explode.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 33b090b9577..b3bcd181de9 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -279,12 +279,12 @@ static void remap_faces_3_6_9_12(Mesh *mesh, } static void remap_uvs_3_6_9_12( - Mesh *mesh, Mesh *split, int numlayer, int i, int cur, int c0, int c1, int c2, int c3) + Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2, int c3) { MTFace *mf, *df1, *df2, *df3; int l; - for (l = 0; l < numlayer; l++) { + for (l = 0; l < layers_num; l++) { mf = CustomData_get_layer_n(&split->fdata, CD_MTFACE, l); df1 = mf + cur; df2 = df1 + 1; @@ -339,12 +339,12 @@ static void remap_faces_5_10(Mesh *mesh, } static void remap_uvs_5_10( - Mesh *mesh, Mesh *split, int numlayer, int i, int cur, int c0, int c1, int c2, int c3) + Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2, int c3) { MTFace *mf, *df1, *df2; int l; - for (l = 0; l < numlayer; l++) { + for (l = 0; l < layers_num; l++) { mf = CustomData_get_layer_n(&split->fdata, CD_MTFACE, l); df1 = mf + cur; df2 = df1 + 1; @@ -411,12 +411,12 @@ static void remap_faces_15(Mesh *mesh, } static void remap_uvs_15( - Mesh *mesh, Mesh *split, int numlayer, int i, int cur, int c0, int c1, int c2, int c3) + Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2, int c3) { MTFace *mf, *df1, *df2, *df3, *df4; int l; - for (l = 0; l < numlayer; l++) { + for (l = 0; l < layers_num; l++) { mf = CustomData_get_layer_n(&split->fdata, CD_MTFACE, l); df1 = mf + cur; df2 = df1 + 1; @@ -487,12 +487,12 @@ static void remap_faces_7_11_13_14(Mesh *mesh, } static void remap_uvs_7_11_13_14( - Mesh *mesh, Mesh *split, int numlayer, int i, int cur, int c0, int c1, int c2, int c3) + Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2, int c3) { MTFace *mf, *df1, *df2, *df3; int l; - for (l = 0; l < numlayer; l++) { + for (l = 0; l < layers_num; l++) { mf = CustomData_get_layer_n(&split->fdata, CD_MTFACE, l); df1 = mf + cur; df2 = df1 + 1; @@ -547,12 +547,12 @@ static void remap_faces_19_21_22(Mesh *mesh, } static void remap_uvs_19_21_22( - Mesh *mesh, Mesh *split, int numlayer, int i, int cur, int c0, int c1, int c2) + Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2) { MTFace *mf, *df1, *df2; int l; - for (l = 0; l < numlayer; l++) { + for (l = 0; l < layers_num; l++) { mf = CustomData_get_layer_n(&split->fdata, CD_MTFACE, l); df1 = mf + cur; df2 = df1 + 1; @@ -609,12 +609,12 @@ static void remap_faces_23(Mesh *mesh, } static void remap_uvs_23( - Mesh *mesh, Mesh *split, int numlayer, int i, int cur, int c0, int c1, int c2) + Mesh *mesh, Mesh *split, int layers_num, int i, int cur, int c0, int c1, int c2) { MTFace *mf, *df1, *df2; int l; - for (l = 0; l < numlayer; l++) { + for (l = 0; l < layers_num; l++) { mf = CustomData_get_layer_n(&split->fdata, CD_MTFACE, l); df1 = mf + cur; df2 = df1 + 1; @@ -653,7 +653,7 @@ static Mesh *cutEdges(ExplodeModifierData *emd, Mesh *mesh) int *fs, totesplit = 0, totfsplit = 0, curdupface = 0; int i, v1, v2, v3, v4, esplit, v[4] = {0, 0, 0, 0}, /* To quite gcc barking... */ uv[4] = {0, 0, 0, 0}; /* To quite gcc barking... */ - int numlayer; + int layers_num; uint ed_v1, ed_v2; edgehash = BLI_edgehash_new(__func__); @@ -728,7 +728,7 @@ static Mesh *cutEdges(ExplodeModifierData *emd, Mesh *mesh) split_m = BKE_mesh_new_nomain_from_template(mesh, totesplit, 0, totface + totfsplit, 0, 0); - numlayer = CustomData_number_of_layers(&split_m->fdata, CD_MTFACE); + layers_num = CustomData_number_of_layers(&split_m->fdata, CD_MTFACE); /* copy new faces & verts (is it really this painful with custom data??) */ for (i = 0; i < totvert; i++) { @@ -814,23 +814,23 @@ static Mesh *cutEdges(ExplodeModifierData *emd, Mesh *mesh) case 12: remap_faces_3_6_9_12( mesh, split_m, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2], v[3]); - if (numlayer) { - remap_uvs_3_6_9_12(mesh, split_m, numlayer, i, curdupface, uv[0], uv[1], uv[2], uv[3]); + if (layers_num) { + remap_uvs_3_6_9_12(mesh, split_m, layers_num, i, curdupface, uv[0], uv[1], uv[2], uv[3]); } break; case 5: case 10: remap_faces_5_10( mesh, split_m, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2], v[3]); - if (numlayer) { - remap_uvs_5_10(mesh, split_m, numlayer, i, curdupface, uv[0], uv[1], uv[2], uv[3]); + if (layers_num) { + remap_uvs_5_10(mesh, split_m, layers_num, i, curdupface, uv[0], uv[1], uv[2], uv[3]); } break; case 15: remap_faces_15( mesh, split_m, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2], v[3]); - if (numlayer) { - remap_uvs_15(mesh, split_m, numlayer, i, curdupface, uv[0], uv[1], uv[2], uv[3]); + if (layers_num) { + remap_uvs_15(mesh, split_m, layers_num, i, curdupface, uv[0], uv[1], uv[2], uv[3]); } break; case 7: @@ -839,8 +839,9 @@ static Mesh *cutEdges(ExplodeModifierData *emd, Mesh *mesh) case 14: remap_faces_7_11_13_14( mesh, split_m, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2], v[3]); - if (numlayer) { - remap_uvs_7_11_13_14(mesh, split_m, numlayer, i, curdupface, uv[0], uv[1], uv[2], uv[3]); + if (layers_num) { + remap_uvs_7_11_13_14( + mesh, split_m, layers_num, i, curdupface, uv[0], uv[1], uv[2], uv[3]); } break; case 19: @@ -848,15 +849,15 @@ static Mesh *cutEdges(ExplodeModifierData *emd, Mesh *mesh) case 22: remap_faces_19_21_22( mesh, split_m, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2]); - if (numlayer) { - remap_uvs_19_21_22(mesh, split_m, numlayer, i, curdupface, uv[0], uv[1], uv[2]); + if (layers_num) { + remap_uvs_19_21_22(mesh, split_m, layers_num, i, curdupface, uv[0], uv[1], uv[2]); } break; case 23: remap_faces_23( mesh, split_m, mf, facepa, vertpa, i, edgehash, curdupface, v[0], v[1], v[2]); - if (numlayer) { - remap_uvs_23(mesh, split_m, numlayer, i, curdupface, uv[0], uv[1], uv[2]); + if (layers_num) { + remap_uvs_23(mesh, split_m, layers_num, i, curdupface, uv[0], uv[1], uv[2]); } break; case 0: |