Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-08-07 14:04:31 +0300
committerJulian Eisel <julian@blender.org>2020-08-07 14:04:31 +0300
commit0d2d4a6d4a75ac38c41f872c88255eab70e88ab7 (patch)
treeb7a7518af86dddba48e05a98b3c2be55e8804721 /source/blender/editors/uvedit/uvedit_smart_stitch.c
parent9b416c66fb714bdfd15a481489dbf650d0f389ea (diff)
parentcfc6f9eb18e701f5be601b95c45004e8cf7fbc81 (diff)
Merge branch 'master' into temp-ui-button-type-refactortemp-ui-button-type-refactor
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_smart_stitch.c')
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c44
1 files changed, 15 insertions, 29 deletions
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index 594847b7249..f649ee528d4 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -320,9 +320,7 @@ static int getNumOfIslandUvs(UvElementMap *elementMap, int island)
if (island == elementMap->totalIslands - 1) {
return elementMap->totalUVs - elementMap->islandIndices[island];
}
- else {
- return elementMap->islandIndices[island + 1] - elementMap->islandIndices[island];
- }
+ return elementMap->islandIndices[island + 1] - elementMap->islandIndices[island];
}
static void stitch_uv_rotate(float mat[2][2], float medianPoint[2], float uv[2], float aspect)
@@ -367,13 +365,9 @@ static bool stitch_check_uvs_stitchable(UvElement *element,
fabsf(luv->uv[1] - luv_iter->uv[1]) < limit) {
return 1;
}
- else {
- return 0;
- }
- }
- else {
- return 1;
+ return 0;
}
+ return 1;
}
static bool stitch_check_edges_stitchable(UvEdge *edge,
@@ -411,13 +405,9 @@ static bool stitch_check_edges_stitchable(UvEdge *edge,
fabsf(luv_orig2->uv[1] - luv_iter2->uv[1]) < limit) {
return 1;
}
- else {
- return 0;
- }
- }
- else {
- return 1;
+ return 0;
}
+ return 1;
}
static bool stitch_check_uvs_state_stitchable(UvElement *element,
@@ -544,7 +534,7 @@ static void stitch_island_calculate_edge_rotation(UvEdge *edge,
StitchStateContainer *ssc,
StitchState *state,
UVVertAverage *uv_average,
- uint *uvfinal_map,
+ const uint *uvfinal_map,
IslandStitchData *island_stitch_data)
{
BMesh *bm = state->em->bm;
@@ -991,7 +981,7 @@ static void stitch_propagate_uv_final_position(Scene *scene,
if (final) {
copy_v2_v2(luv->uv, final_position[index].uv);
- uvedit_uv_select_enable(state->em, scene, l, false, cd_loop_uv_offset);
+ uvedit_uv_select_enable(scene, state->em, l, false, cd_loop_uv_offset);
}
else {
int face_preview_pos =
@@ -1945,7 +1935,7 @@ static StitchState *stitch_init(bContext *C,
return NULL;
}
- ED_uvedit_get_aspect(scene, obedit, em->bm, &aspx, &aspy);
+ ED_uvedit_get_aspect(obedit, &aspx, &aspy);
state->aspect = aspx / aspy;
/* Count 'unique' uvs */
@@ -2535,10 +2525,8 @@ static int stitch_exec(bContext *C, wmOperator *op)
stitch_exit(C, op, 1);
return OPERATOR_FINISHED;
}
- else {
- stitch_cancel(C, op);
- return OPERATOR_CANCELLED;
- }
+ stitch_cancel(C, op);
+ return OPERATOR_CANCELLED;
}
static StitchState *stitch_select(bContext *C,
@@ -2619,14 +2607,12 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
stitch_exit(C, op, 1);
return OPERATOR_FINISHED;
}
- else {
- stitch_cancel(C, op);
- return OPERATOR_CANCELLED;
- }
- }
- else {
- return OPERATOR_PASS_THROUGH;
+
+ stitch_cancel(C, op);
+ return OPERATOR_CANCELLED;
}
+ return OPERATOR_PASS_THROUGH;
+
/* Increase limit */
case EVT_PADPLUSKEY:
case WHEELUPMOUSE: