From dc48fcfac0bf50421a9bd3f5684f9853e0c56dc9 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Sun, 22 Jul 2012 14:19:06 +0000 Subject: Add property to stitch operator to clear seam flag of stitched edges (on by default, since people usually want the layout to be updated). Motivation has been confused user that tried to use live unwrap afterwards and found that it would not work as it should. --- source/blender/editors/uvedit/uvedit_smart_stitch.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/blender/editors/uvedit') diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 5c2e57cf27f..4e0e7944e84 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -118,6 +118,8 @@ typedef struct StitchState { char midpoints; /* editmesh, cached for use in modal handler */ BMEditMesh *em; + /* clear seams of stitched edges after stitch */ + char clear_seams; /* element map for getting info about uv connectivity */ UvElementMap *element_map; /* edge container */ @@ -833,6 +835,15 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final) } } + /* clear seams of stitched edges */ + if (final && state->clear_seams) { + for (i = 0; i < state->total_boundary_edges; i++) { + UvEdge *edge = state->edges + i; + if ((state->uvs[edge->uv1]->flag & STITCH_STITCHABLE) && (state->uvs[edge->uv2]->flag & STITCH_STITCHABLE)) + BM_elem_flag_disable(edge->element->l->e, BM_ELEM_SEAM); + } + } + for (i = 0; i < state->selection_size; i++) { UvElement *element = state->selection_stack[i]; if (!island_stitch_data[element->island].use_edge_rotation) { @@ -1004,6 +1015,7 @@ static int stitch_init(bContext *C, wmOperator *op) state->snap_islands = RNA_boolean_get(op->ptr, "snap_islands"); state->static_island = RNA_int_get(op->ptr, "static_island"); state->midpoints = RNA_boolean_get(op->ptr, "midpoint_snap"); + state->clear_seams = RNA_boolean_get(op->ptr, "clear_seams"); /* in uv synch selection, all uv's are visible */ if (ts->uv_flag & UV_SYNC_SELECTION) { state->element_map = EDBM_uv_element_map_create(state->em, 0, 1); @@ -1488,6 +1500,8 @@ void UV_OT_stitch(wmOperatorType *ot) "Island that stays in place when stitching islands", 0, INT_MAX); RNA_def_boolean(ot->srna, "midpoint_snap", 0, "Snap At Midpoint", "UVs are stitched at midpoint instead of at static island"); + RNA_def_boolean(ot->srna, "clear_seams", 1, "Clear Seams", + "Clear seams of stitched edges"); prop = RNA_def_collection_runtime(ot->srna, "selection", &RNA_SelectedUvElement, "Selection", ""); /* Selection should not be editable or viewed in toolbar */ RNA_def_property_flag(prop, PROP_HIDDEN); -- cgit v1.2.3