diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_uvproject.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_uvproject.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index 642aac17efd..d4d7ecef283 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -72,7 +72,7 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte { UVProjectModifierData *umd = (UVProjectModifierData *)md; bool do_add_own_transform = false; - for (int i = 0; i < umd->num_projectors; i++) { + for (int i = 0; i < umd->projectors_num; i++) { if (umd->projectors[i] != NULL) { DEG_add_object_relation( ctx->node, umd->projectors[i], DEG_OB_COMP_TRANSFORM, "UV Project Modifier"); @@ -98,11 +98,11 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd, { float(*coords)[3], (*co)[3]; MLoopUV *mloop_uv; - int i, numVerts, numPolys, numLoops; + int i, verts_num, polys_num, loops_num; MPoly *mpoly, *mp; MLoop *mloop; Projector projectors[MOD_UVPROJECT_MAXPROJECTORS]; - int num_projectors = 0; + int projectors_num = 0; char uvname[MAX_CUSTOMDATA_LAYER_NAME]; float aspx = umd->aspectx ? umd->aspectx : 1.0f; float aspy = umd->aspecty ? umd->aspecty : 1.0f; @@ -110,13 +110,13 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd, float scay = umd->scaley ? umd->scaley : 1.0f; int free_uci = 0; - for (i = 0; i < umd->num_projectors; i++) { + for (i = 0; i < umd->projectors_num; i++) { if (umd->projectors[i] != NULL) { - projectors[num_projectors++].ob = umd->projectors[i]; + projectors[projectors_num++].ob = umd->projectors[i]; } } - if (num_projectors == 0) { + if (projectors_num == 0) { return mesh; } @@ -131,7 +131,7 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd, CustomData_validate_layer_name(&mesh->ldata, CD_MLOOPUV, umd->uvlayer_name, uvname); /* calculate a projection matrix and normal for each projector */ - for (i = 0; i < num_projectors; i++) { + for (i = 0; i < projectors_num; i++) { float tmpmat[4][4]; float offsetmat[4][4]; Camera *cam = NULL; @@ -184,23 +184,23 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd, mul_mat3_m4_v3(projectors[i].ob->obmat, projectors[i].normal); } - numPolys = mesh->totpoly; - numLoops = mesh->totloop; + polys_num = mesh->totpoly; + loops_num = mesh->totloop; /* make sure we are not modifying the original UV map */ mloop_uv = CustomData_duplicate_referenced_layer_named( - &mesh->ldata, CD_MLOOPUV, uvname, numLoops); + &mesh->ldata, CD_MLOOPUV, uvname, loops_num); - coords = BKE_mesh_vert_coords_alloc(mesh, &numVerts); + coords = BKE_mesh_vert_coords_alloc(mesh, &verts_num); /* Convert coords to world-space. */ - for (i = 0, co = coords; i < numVerts; i++, co++) { + for (i = 0, co = coords; i < verts_num; i++, co++) { mul_m4_v3(ob->obmat, *co); } /* if only one projector, project coords to UVs */ - if (num_projectors == 1 && projectors[0].uci == NULL) { - for (i = 0, co = coords; i < numVerts; i++, co++) { + if (projectors_num == 1 && projectors[0].uci == NULL) { + for (i = 0, co = coords; i < verts_num; i++, co++) { mul_project_m4_v3(projectors[0].projmat, *co); } } @@ -209,8 +209,8 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd, mloop = mesh->mloop; /* apply coords as UVs */ - for (i = 0, mp = mpoly; i < numPolys; i++, mp++) { - if (num_projectors == 1) { + for (i = 0, mp = mpoly; i < polys_num; i++, mp++) { + if (projectors_num == 1) { if (projectors[0].uci) { uint fidx = mp->totloop - 1; do { @@ -246,7 +246,7 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd, best_dot = dot_v3v3(projectors[0].normal, face_no); best_projector = &projectors[0]; - for (j = 1; j < num_projectors; j++) { + for (j = 1; j < projectors_num; j++) { float tmp_dot = dot_v3v3(projectors[j].normal, face_no); if (tmp_dot > best_dot) { best_dot = tmp_dot; @@ -277,7 +277,7 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd, if (free_uci) { int j; - for (j = 0; j < num_projectors; j++) { + for (j = 0; j < projectors_num; j++) { if (projectors[j].uci) { MEM_freeN(projectors[j].uci); } |