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:
authorCampbell Barton <ideasman42@gmail.com>2011-02-24 19:04:36 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-24 19:04:36 +0300
commit197a57db697048d84eff6ba71f9ead16c49ccae2 (patch)
tree62940024648a3c778bceffc25133f06062947927 /source/blender/editors/sculpt_paint
parent04d04f64011a06255f91faf4445947d162b5a9f0 (diff)
face-paint mode operators were not ported from 2.4x yet hide/reveal/sel-swap
also added hide-unselected option to armature mode.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h3
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c9
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c66
3 files changed, 77 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 9c0da1f1005..e0a09184e28 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -114,6 +114,9 @@ void BRUSH_OT_curve_preset(struct wmOperatorType *ot);
void PAINT_OT_face_select_linked(struct wmOperatorType *ot);
void PAINT_OT_face_select_linked_pick(struct wmOperatorType *ot);
void PAINT_OT_face_select_all(struct wmOperatorType *ot);
+void PAINT_OT_face_select_inverse(struct wmOperatorType *ot);
+void PAINT_OT_face_select_hide(struct wmOperatorType *ot);
+void PAINT_OT_face_select_reveal(struct wmOperatorType *ot);
int facemask_paint_poll(struct bContext *C);
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index e86a068459e..979b6508b16 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -224,6 +224,9 @@ void ED_operatortypes_paint(void)
WM_operatortype_append(PAINT_OT_face_select_linked);
WM_operatortype_append(PAINT_OT_face_select_linked_pick);
WM_operatortype_append(PAINT_OT_face_select_all);
+ WM_operatortype_append(PAINT_OT_face_select_inverse);
+ WM_operatortype_append(PAINT_OT_face_select_hide);
+ WM_operatortype_append(PAINT_OT_face_select_reveal);
}
@@ -414,7 +417,11 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
keymap->poll= facemask_paint_poll;
WM_keymap_add_item(keymap, "PAINT_OT_face_select_all", AKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "PAINT_OT_face_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
+ WM_keymap_add_item(keymap, "PAINT_OT_face_select_hide", HKEY, KM_PRESS, 0, 0);
+ RNA_boolean_set(WM_keymap_add_item(keymap, "PAINT_OT_face_select_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
+ WM_keymap_add_item(keymap, "PAINT_OT_face_select_reveal", HKEY, KM_PRESS, KM_ALT, 0);
+
WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked_pick", LKEY, KM_PRESS, 0, 0);
-
}
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 2962ea7e51b..b02c0db7da4 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -350,3 +350,69 @@ void PAINT_OT_face_select_all(wmOperatorType *ot)
WM_operator_properties_select_all(ot);
}
+
+static int face_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Object *ob= CTX_data_active_object(C);
+ paintface_deselect_all_visible(ob, SEL_INVERT, TRUE);
+ ED_region_tag_redraw(CTX_wm_region(C));
+ return OPERATOR_FINISHED;
+}
+
+
+void PAINT_OT_face_select_inverse(wmOperatorType *ot)
+{
+ ot->name= "Face Select Invert";
+ ot->description= "Invert selection of faces";
+ ot->idname= "PAINT_OT_face_select_inverse";
+
+ ot->exec= face_select_inverse_exec;
+ ot->poll= facemask_paint_poll;
+
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int face_select_hide_exec(bContext *C, wmOperator *op)
+{
+ const int unselected= RNA_boolean_get(op->ptr, "unselected");
+ Object *ob= CTX_data_active_object(C);
+ paintface_hide(ob, unselected);
+ ED_region_tag_redraw(CTX_wm_region(C));
+ return OPERATOR_FINISHED;
+}
+
+void PAINT_OT_face_select_hide(wmOperatorType *ot)
+{
+ ot->name= "Face Select Hide";
+ ot->description= "Hide selected faces";
+ ot->idname= "PAINT_OT_face_select_hide";
+
+ ot->exec= face_select_hide_exec;
+ ot->poll= facemask_paint_poll;
+
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects.");
+}
+
+static int face_select_reveal_exec(bContext *C, wmOperator *op)
+{
+ Object *ob= CTX_data_active_object(C);
+ paintface_reveal(ob);
+ ED_region_tag_redraw(CTX_wm_region(C));
+ return OPERATOR_FINISHED;
+}
+
+void PAINT_OT_face_select_reveal(wmOperatorType *ot)
+{
+ ot->name= "Face Select Reveal";
+ ot->description= "Reveal hidden faces";
+ ot->idname= "PAINT_OT_face_select_reveal";
+
+ ot->exec= face_select_reveal_exec;
+ ot->poll= facemask_paint_poll;
+
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects.");
+}