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:
authorAntony Riakiotakis <kalast@gmail.com>2015-05-14 13:48:47 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-05-14 13:48:47 +0300
commit057a8c625038ba9b22b01ebbd7bce9940479c034 (patch)
tree2a6f3fbf227086ca28f52003621af428c1bcf828 /source/blender/editors/uvedit
parent8bf9e1412fac3312cfdf22869312caf32f99c4c2 (diff)
Add clear seams to uv editor
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 37070a37c05..a5c5a015c72 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -4142,7 +4142,7 @@ static void UV_OT_seams_from_islands(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "mark_sharp", 0, "Mark Sharp", "Mark boundary edges as sharp");
}
-static int uv_mark_seam_exec(bContext *C, wmOperator *UNUSED(op))
+static int uv_mark_seam_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_edit_object(C);
Scene *scene = CTX_data_scene(C);
@@ -4152,13 +4152,17 @@ static int uv_mark_seam_exec(bContext *C, wmOperator *UNUSED(op))
BMFace *efa;
BMLoop *loop;
BMIter iter, liter;
+ bool clear = RNA_boolean_get(op->ptr, "clear");
const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV);
BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
BM_ITER_ELEM (loop, &liter, efa, BM_LOOPS_OF_FACE) {
if (uvedit_edge_select_test(scene, loop, cd_loop_uv_offset)) {
- BM_elem_flag_enable(loop->e, BM_ELEM_SEAM);
+ if (clear)
+ BM_elem_flag_disable(loop->e, BM_ELEM_SEAM);
+ else
+ BM_elem_flag_enable(loop->e, BM_ELEM_SEAM);
}
}
}
@@ -4177,7 +4181,7 @@ static int uv_mark_seam_exec(bContext *C, wmOperator *UNUSED(op))
static void UV_OT_mark_seam(wmOperatorType *ot)
{
/* identifiers */
- ot->name = "Mark Seams";
+ ot->name = "Mark Seam";
ot->description = "Mark selected UV edges as seams";
ot->idname = "UV_OT_mark_seam";
@@ -4187,6 +4191,8 @@ static void UV_OT_mark_seam(wmOperatorType *ot)
/* api callbacks */
ot->exec = uv_mark_seam_exec;
ot->poll = ED_operator_uvedit;
+
+ RNA_def_boolean(ot->srna, "clear", false, "Clear Seams", "Clear instead of marking seams");
}