Fix: edge uv stitch mode did not average final position of uvs in

midpoint, non-snapping mode.
This commit is contained in:
Antony Riakiotakis
2012-12-27 03:14:11 +00:00
parent 540cbbc1d0
commit 6586fd9c62

View File

@@ -1164,6 +1164,14 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
}
}
/* take mean position here. For edge case, this can't be done inside the loop for shared uvverts */
if (state->mode == STITCH_EDGE && stitch_midpoints) {
for (i = 0; i < state->total_separate_uvs; i++) {
final_position[i].uv[0] /= final_position[i].count;
final_position[i].uv[1] /= final_position[i].count;
}
}
/* second pass, calculate island rotation and translation before modifying any uvs */
if (state->snap_islands) {
if (state->mode == STITCH_VERT) {
@@ -1218,11 +1226,6 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final)
for (i = 0; i < state->total_separate_uvs; i++) {
UvElement *element = state->uvs[i];
if (stitch_midpoints) {
final_position[i].uv[0] /= final_position[i].count;
final_position[i].uv[1] /= final_position[i].count;
}
if (element->flag & STITCH_STITCHABLE) {
BMLoop *l;
MLoopUV *luv;