Option not to select with un-hide
authorCampbell Barton <ideasman42@gmail.com>
Sun, 19 Nov 2017 15:28:07 +0000 (02:28 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 19 Nov 2017 15:28:07 +0000 (02:28 +1100)
D1518 from @mba105 w/ edits

15 files changed:
source/blender/editors/armature/armature_edit.c
source/blender/editors/armature/pose_edit.c
source/blender/editors/curve/editcurve.c
source/blender/editors/gpencil/gpencil_data.c
source/blender/editors/include/ED_mesh.h
source/blender/editors/mask/mask_ops.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/metaball/mball_edit.c
source/blender/editors/object/object_edit.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/space_graph/graph_ops.c
source/blender/editors/uvedit/uvedit_ops.c

index ab9a3e068d004ed80a285f38103a2298af31f414..a2fbfe645f7de651be000fb2ac2b3e994a989cf5 100644 (file)
@@ -1564,17 +1564,18 @@ void ARMATURE_OT_hide(wmOperatorType *ot)
        RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected");
 }
 
-static int armature_reveal_exec(bContext *C, wmOperator *UNUSED(op))
+static int armature_reveal_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);
        bArmature *arm = obedit->data;
        EditBone *ebone;
+       const bool select = RNA_boolean_get(op->ptr, "select");
        
        for (ebone = arm->edbo->first; ebone; ebone = ebone->next) {
                if (arm->layer & ebone->layer) {
                        if (ebone->flag & BONE_HIDDEN_A) {
                                if (!(ebone->flag & BONE_UNSELECTABLE)) {
-                                       ebone->flag |= (BONE_TIPSEL | BONE_SELECTED | BONE_ROOTSEL);
+                                       SET_FLAG_FROM_TEST(ebone->flag, select, (BONE_TIPSEL | BONE_SELECTED | BONE_ROOTSEL));
                                }
                                ebone->flag &= ~BONE_HIDDEN_A;
                        }
@@ -1593,7 +1594,7 @@ void ARMATURE_OT_reveal(wmOperatorType *ot)
        /* identifiers */
        ot->name = "Reveal Bones";
        ot->idname = "ARMATURE_OT_reveal";
-       ot->description = "Unhide all bones that have been tagged to be hidden in Edit Mode";
+       ot->description = "Reveal all bones hidden in Edit Mode";
        
        /* api callbacks */
        ot->exec = armature_reveal_exec;
@@ -1602,4 +1603,5 @@ void ARMATURE_OT_reveal(wmOperatorType *ot)
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
index 57c01157f8edf99032650153033863381da8e1cc..acbf23ecf823187fd682bff9e98f19e314aeba9b 100644 (file)
@@ -1098,16 +1098,18 @@ void POSE_OT_hide(wmOperatorType *ot)
        RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "");
 }
 
-static int show_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr)
+static int show_pose_bone_cb(Object *ob, Bone *bone, void *data
 {
+       const bool select = GET_INT_FROM_POINTER(data);
+
        bArmature *arm = ob->data;
        
        if (arm->layer & bone->layer) {
                if (bone->flag & BONE_HIDDEN_P) {
-                       bone->flag &= ~BONE_HIDDEN_P;
                        if (!(bone->flag & BONE_UNSELECTABLE)) {
-                               bone->flag |= BONE_SELECTED;
+                               SET_FLAG_FROM_TEST(bone->flag, select, BONE_SELECTED);
                        }
+                       bone->flag &= ~BONE_HIDDEN_P;
                }
        }
        
@@ -1115,12 +1117,13 @@ static int show_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr))
 }
 
 /* active object is armature in posemode, poll checked */
-static int pose_reveal_exec(bContext *C, wmOperator *UNUSED(op)
+static int pose_reveal_exec(bContext *C, wmOperator *op
 {
        Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm = ob->data;
+       const bool select = RNA_boolean_get(op->ptr, "select");
        
-       bone_looper(ob, arm->bonebase.first, NULL, show_pose_bone_cb);
+       bone_looper(ob, arm->bonebase.first, SET_INT_IN_POINTER(select), show_pose_bone_cb);
        
        /* note, notifier might evolve */
        WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob);
@@ -1133,7 +1136,7 @@ void POSE_OT_reveal(wmOperatorType *ot)
        /* identifiers */
        ot->name = "Reveal Selected";
        ot->idname = "POSE_OT_reveal";
-       ot->description = "Unhide all bones that have been tagged to be hidden in Pose Mode";
+       ot->description = "Reveal all bones hidden in Pose Mode";
        
        /* api callbacks */
        ot->exec = pose_reveal_exec;
@@ -1141,6 +1144,8 @@ void POSE_OT_reveal(wmOperatorType *ot)
        
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
 
 /* ********************************************** */
index 4916c206a85cd5501fab74fe37947b8c6e95932d..fc363475608a4de07b48c72c015441e3f84837e4 100644 (file)
@@ -2926,7 +2926,7 @@ void CURVE_OT_hide(wmOperatorType *ot)
 
 /********************** reveal operator *********************/
 
-static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
+static int reveal_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);
        ListBase *editnurb = object_editcurve_get(obedit);
@@ -2934,6 +2934,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
        BPoint *bp;
        BezTriple *bezt;
        int a;
+       const bool select = RNA_boolean_get(op->ptr, "select");
 
        for (nu = editnurb->first; nu; nu = nu->next) {
                nu->hide = 0;
@@ -2942,7 +2943,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                        a = nu->pntsu;
                        while (a--) {
                                if (bezt->hide) {
-                                       select_beztriple(bezt, SELECT, SELECT, HIDDEN);
+                                       select_beztriple(bezt, select, SELECT, HIDDEN);
                                        bezt->hide = 0;
                                }
                                bezt++;
@@ -2953,7 +2954,7 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                        a = nu->pntsu * nu->pntsv;
                        while (a--) {
                                if (bp->hide) {
-                                       select_bpoint(bp, SELECT, SELECT, HIDDEN);
+                                       select_bpoint(bp, select, SELECT, HIDDEN);
                                        bp->hide = 0;
                                }
                                bp++;
@@ -2972,7 +2973,7 @@ void CURVE_OT_reveal(wmOperatorType *ot)
        /* identifiers */
        ot->name = "Reveal Hidden";
        ot->idname = "CURVE_OT_reveal";
-       ot->description = "Show again hidden control points";
+       ot->description = "Reveal hidden control points";
        
        /* api callbacks */
        ot->exec = reveal_exec;
@@ -2980,6 +2981,8 @@ void CURVE_OT_reveal(wmOperatorType *ot)
        
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
 
 /********************** subdivide operator *********************/
index 93c9d21e7175bad84432a557fa0c7d8abe8c580c..5bd5c9c74b96b98727c5ef1f53a0482f1798a6c0 100644 (file)
@@ -423,18 +423,59 @@ static int gp_reveal_poll(bContext *C)
        return ED_gpencil_data_get_active(C) != NULL;
 }
 
-static int gp_reveal_exec(bContext *C, wmOperator *UNUSED(op))
+static void gp_reveal_select_frame(bContext *C, bGPDframe *frame, bool select)
+{
+       bGPDstroke *gps;
+       for (gps = frame->strokes.first; gps; gps = gps->next) {
+
+               /* only deselect strokes that are valid in this view */
+               if (ED_gpencil_stroke_can_use(C, gps)) {
+
+                       /* (de)select points */
+                       int i;
+                       bGPDspoint *pt;
+                       for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
+                               SET_FLAG_FROM_TEST(pt->flag, select, GP_SPOINT_SELECT);
+                       }
+
+                       /* (de)select stroke */
+                       SET_FLAG_FROM_TEST(gps->flag, select, GP_STROKE_SELECT);
+               }
+       }
+}
+
+static int gp_reveal_exec(bContext *C, wmOperator *op)
 {
        bGPdata *gpd = ED_gpencil_data_get_active(C);
        bGPDlayer *gpl;
-       
+       const bool select = RNA_boolean_get(op->ptr, "select");
+
        /* sanity checks */
        if (gpd == NULL)
                return OPERATOR_CANCELLED;
        
-       /* make all layers visible */
        for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
-               gpl->flag &= ~GP_LAYER_HIDE;
+
+               if (gpl->flag & GP_LAYER_HIDE) {
+                       gpl->flag &= ~GP_LAYER_HIDE;
+
+                       /* select or deselect if requested, only on hidden layers */
+                       if (gpd->flag & GP_DATA_STROKE_EDITMODE) {
+                               if (select) {
+                                       /* select all strokes on active frame only (same as select all operator) */
+                                       if (gpl->actframe) {
+                                               gp_reveal_select_frame(C, gpl->actframe, true);
+                                       }
+                               }
+                               else {
+                                       /* deselect strokes on all frames (same as deselect all operator) */
+                                       bGPDframe *gpf;
+                                       for (gpf = gpl->frames.first; gpf; gpf = gpf->next) {
+                                               gp_reveal_select_frame(C, gpf, false);
+                                       }
+                               }
+                       }
+               }
        }
        
        /* notifiers */
@@ -456,6 +497,9 @@ void GPENCIL_OT_reveal(wmOperatorType *ot)
        
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+       /* props */
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
 
 /* ***************** Lock/Unlock All Layers ************************ */
index c867df2d01ac2b97348c7cf314ae09d82c4d1be4..c2c00ad5635b210f815fe9fd5d4741bdd4d088c4 100644 (file)
@@ -103,7 +103,7 @@ void undo_push_mesh(struct bContext *C, const char *name);
 bool EDBM_vert_color_check(struct BMEditMesh *em);
 
 void EDBM_mesh_hide(struct BMEditMesh *em, bool swap);
-void EDBM_mesh_reveal(struct BMEditMesh *em);
+void EDBM_mesh_reveal(struct BMEditMesh *em, bool select);
 
 void EDBM_update_generic(struct BMEditMesh *em, const bool do_tessface, const bool is_destructive);
 
@@ -205,7 +205,7 @@ void paintface_select_linked(struct bContext *C, struct Object *ob, const int mv
 bool paintface_minmax(struct Object *ob, float r_min[3], float r_max[3]);
 
 void paintface_hide(struct Object *ob, const bool unselected);
-void paintface_reveal(struct Object *ob);
+void paintface_reveal(struct Object *ob, const bool select);
 
 void paintvert_deselect_all_visible(struct Object *ob, int action, bool flush_flags);
 void paintvert_select_ungrouped(struct Object *ob, bool extend, bool flush_flags);
index 101ef70fb70ee1826f87e4afe07b683122a56c75..97d5ee1eff0dd3fe93172ec5d4a03dadf79f797f 100644 (file)
@@ -1937,16 +1937,17 @@ void MASK_OT_handle_type_set(wmOperatorType *ot)
 
 
 /* ********* clear/set restrict view *********/
-static int mask_hide_view_clear_exec(bContext *C, wmOperator *UNUSED(op))
+static int mask_hide_view_clear_exec(bContext *C, wmOperator *op)
 {
        Mask *mask = CTX_data_edit_mask(C);
        MaskLayer *masklay;
        bool changed = false;
+       const bool select = RNA_boolean_get(op->ptr, "select");
 
        for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) {
 
                if (masklay->restrictflag & OB_RESTRICT_VIEW) {
-                       ED_mask_layer_select_set(masklay, true);
+                       ED_mask_layer_select_set(masklay, select);
                        masklay->restrictflag &= ~OB_RESTRICT_VIEW;
                        changed = true;
                }
@@ -1977,6 +1978,8 @@ void MASK_OT_hide_view_clear(wmOperatorType *ot)
 
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
 
 static int mask_hide_view_set_exec(bContext *C, wmOperator *op)
index 4336fff45d59e441492e19c550dfa1ad44e21fed..87c8c55b0a1571a59aefa0496cc489ec8791bd52 100644 (file)
@@ -138,7 +138,7 @@ void paintface_hide(Object *ob, const bool unselected)
 }
 
 
-void paintface_reveal(Object *ob)
+void paintface_reveal(Object *ob, const bool select)
 {
        Mesh *me;
        MPoly *mpoly;
@@ -151,8 +151,8 @@ void paintface_reveal(Object *ob)
        a = me->totpoly;
        while (a--) {
                if (mpoly->flag & ME_HIDE) {
-                       mpoly->flag |= ME_FACE_SEL;
-                       mpoly->flag -= ME_HIDE;
+                       SET_FLAG_FROM_TEST(mpoly->flag, select, ME_FACE_SEL);
+                       mpoly->flag &= ~ME_HIDE;
                }
                mpoly++;
        }
index bf25f7ee7d1fe80d8b59e8a9a481b24e43cdbac0..bc251869e3d0c71d1c593cd61224f860e8671bb7 100644 (file)
@@ -1652,12 +1652,13 @@ void MESH_OT_hide(wmOperatorType *ot)
        RNA_def_boolean(ot->srna, "unselected", false, "Unselected", "Hide unselected rather than selected");
 }
 
-static int edbm_reveal_exec(bContext *C, wmOperator *UNUSED(op))
+static int edbm_reveal_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = BKE_editmesh_from_object(obedit);
-       
-       EDBM_mesh_reveal(em);
+       const bool select = RNA_boolean_get(op->ptr, "select");
+
+       EDBM_mesh_reveal(em, select);
 
        EDBM_update_generic(em, true, false);
 
@@ -1677,6 +1678,8 @@ void MESH_OT_reveal(wmOperatorType *ot)
        
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
 
 static int edbm_normals_make_consistent_exec(bContext *C, wmOperator *op)
index c8151862b6c5a3f895dc9f87c3a15bc19d0362b3..fc568a8b8eefa15a9097d4487e95ed4dac62b081 100644 (file)
@@ -1225,7 +1225,7 @@ void EDBM_mesh_hide(BMEditMesh *em, bool swap)
 }
 
 
-void EDBM_mesh_reveal(BMEditMesh *em)
+void EDBM_mesh_reveal(BMEditMesh *em, bool select)
 {
        const char iter_types[3] = {BM_VERTS_OF_MESH,
                                    BM_EDGES_OF_MESH,
@@ -1264,7 +1264,7 @@ void EDBM_mesh_reveal(BMEditMesh *em)
 
                BM_ITER_MESH (ele, &iter, em->bm, iter_types[i]) {
                        if (BM_elem_flag_test(ele, BM_ELEM_TAG)) {
-                               BM_elem_select_set(em->bm, ele, true);
+                               BM_elem_select_set(em->bm, ele, select);
                        }
                }
        }
index 009aa921e1116597fce18c58a891b6527bd04b23..5b4078b98b79e2ae96941212c5c1d404877e5fa8 100644 (file)
@@ -542,19 +542,21 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot)
 /***************************** Unhide operator *****************************/
 
 /* Unhide all edited MetaElems */
-static int reveal_metaelems_exec(bContext *C, wmOperator *UNUSED(op))
+static int reveal_metaelems_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);
        MetaBall *mb = (MetaBall *)obedit->data;
-       MetaElem *ml;
-
-       ml = mb->editelems->first;
+       const bool select = RNA_boolean_get(op->ptr, "select");
+       bool changed = false;
 
-       if (ml) {
-               while (ml) {
+       for (MetaElem *ml = mb->editelems->first; ml; ml = ml->next) {
+               if (ml->flag & MB_HIDE) {
+                       SET_FLAG_FROM_TEST(ml->flag, select, SELECT);
                        ml->flag &= ~MB_HIDE;
-                       ml = ml->next;
+                       changed = true;
                }
+       }
+       if (changed) {
                WM_event_add_notifier(C, NC_GEOM | ND_DATA, mb);
                DAG_id_tag_update(obedit->data, 0);
        }
@@ -575,6 +577,9 @@ void MBALL_OT_reveal_metaelems(wmOperatorType *ot)
        
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+       /* props */
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
 
 /* Select MetaElement with mouse click (user can select radius circle or
index 4e949c82a9ff0a452bea140cf5ac5fca9cb66694..d7c7976c344a09ced572c48f1d9944eddc3ebd2e 100644 (file)
@@ -133,7 +133,7 @@ Object *ED_object_active_context(bContext *C)
 
 
 /* ********* clear/set restrict view *********/
-static int object_hide_view_clear_exec(bContext *C, wmOperator *UNUSED(op))
+static int object_hide_view_clear_exec(bContext *C, wmOperator *op)
 {
        Main *bmain = CTX_data_main(C);
        ScrArea *sa = CTX_wm_area(C);
@@ -141,12 +141,13 @@ static int object_hide_view_clear_exec(bContext *C, wmOperator *UNUSED(op))
        Scene *scene = CTX_data_scene(C);
        Base *base;
        bool changed = false;
+       const bool select = RNA_boolean_get(op->ptr, "select");
        
        /* XXX need a context loop to handle such cases */
        for (base = FIRSTBASE; base; base = base->next) {
                if ((base->lay & v3d->lay) && base->object->restrictflag & OB_RESTRICT_VIEW) {
                        if (!(base->object->restrictflag & OB_RESTRICT_SELECT)) {
-                               base->flag |= SELECT;
+                               SET_FLAG_FROM_TEST(base->flag, select, SELECT);
                        }
                        base->object->flag = base->flag;
                        base->object->restrictflag &= ~OB_RESTRICT_VIEW; 
@@ -176,6 +177,8 @@ void OBJECT_OT_hide_view_clear(wmOperatorType *ot)
        
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
 
 static int object_hide_view_set_exec(bContext *C, wmOperator *op)
index 199d5e0fbfa4b011db40dfaf95c76e44e11134c1..da66ec44235fef8ce7f6203f9fc975f75f82b39e 100644 (file)
@@ -1950,11 +1950,12 @@ void PARTICLE_OT_hide(wmOperatorType *ot)
 
 /*************************** reveal operator **************************/
 
-static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
+static int reveal_exec(bContext *C, wmOperator *op)
 {
        Object *ob= CTX_data_active_object(C);
        Scene *scene= CTX_data_scene(C);
-       PTCacheEdit *edit= PE_get_current(scene, ob);
+       PTCacheEdit *edit = PE_get_current(scene, ob);
+       const bool select = RNA_boolean_get(op->ptr, "select");
        POINT_P; KEY_K;
 
        LOOP_POINTS {
@@ -1962,8 +1963,9 @@ static int reveal_exec(bContext *C, wmOperator *UNUSED(op))
                        point->flag &= ~PEP_HIDE;
                        point->flag |= PEP_EDIT_RECALC;
 
-                       LOOP_KEYS
-                               key->flag |= PEK_SELECT;
+                       LOOP_KEYS {
+                               SET_FLAG_FROM_TEST(key->flag, select, PEK_SELECT);
+                       }
                }
        }
 
@@ -1986,6 +1988,9 @@ void PARTICLE_OT_reveal(wmOperatorType *ot)
 
        /* flags */
        ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+
+       /* props */
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
 
 /************************ select less operator ************************/
index 8304e782b070b0631a37cd19bdac2a972e363db5..1c2ab442e95c18c2137a53840e84bdf8e7bfe8ce 100644 (file)
@@ -749,10 +749,11 @@ void PAINT_OT_face_select_hide(wmOperatorType *ot)
        RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects");
 }
 
-static int face_select_reveal_exec(bContext *C, wmOperator *UNUSED(op))
+static int face_select_reveal_exec(bContext *C, wmOperator *op)
 {
+       const bool select = RNA_boolean_get(op->ptr, "select");
        Object *ob = CTX_data_active_object(C);
-       paintface_reveal(ob);
+       paintface_reveal(ob, select);
        ED_region_tag_redraw(CTX_wm_region(C));
        return OPERATOR_FINISHED;
 }
@@ -768,5 +769,5 @@ void PAINT_OT_face_select_reveal(wmOperatorType *ot)
 
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
-       RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects");
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
index 5c670a216d8cd52ca96e4740fed38e5b2876fe05..62275abcd02a8cec7afe58d18699bbb6fc978893 100644 (file)
@@ -333,13 +333,14 @@ static void GRAPH_OT_hide(wmOperatorType *ot)
 
 /* ........ */
 
-static int graphview_curves_reveal_exec(bContext *C, wmOperator *UNUSED(op))
+static int graphview_curves_reveal_exec(bContext *C, wmOperator *op)
 {
        bAnimContext ac;
        ListBase anim_data = {NULL, NULL};
        ListBase all_data = {NULL, NULL};
        bAnimListElem *ale;
        int filter;
+       const bool select = RNA_boolean_get(op->ptr, "select");
        
        /* get editor data */
        if (ANIM_animdata_get_context(C, &ac) == 0)
@@ -364,8 +365,11 @@ static int graphview_curves_reveal_exec(bContext *C, wmOperator *UNUSED(op))
                        continue;
                
                /* select if it is not visible */
-               if (ANIM_channel_setting_get(&ac, ale, ACHANNEL_SETTING_VISIBLE) == 0)
-                       ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_SELECT, ACHANNEL_SETFLAG_ADD);
+               if (ANIM_channel_setting_get(&ac, ale, ACHANNEL_SETTING_VISIBLE) == 0) {
+                       ANIM_channel_setting_set(
+                               &ac, ale, ACHANNEL_SETTING_SELECT,
+                               select ? ACHANNEL_SETFLAG_ADD : ACHANNEL_SETFLAG_CLEAR);
+               }
                
                /* change the visibility setting */
                ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_VISIBLE, ACHANNEL_SETFLAG_ADD);
@@ -397,6 +401,8 @@ static void GRAPH_OT_reveal(wmOperatorType *ot)
        
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
 
 /* ************************** registration - operator types **********************************/
index c369068fe05f43bf87ff5a8ed1a5313d3eef45b3..d69588e91c61a197484bd63d2a7cd9a23fdfef76 100644 (file)
@@ -3761,7 +3761,7 @@ static void UV_OT_hide(wmOperatorType *ot)
 
 /****************** reveal operator ******************/
 
-static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op))
+static int uv_reveal_exec(bContext *C, wmOperator *op)
 {
        SpaceImage *sima = CTX_wm_space_image(C);
        Object *obedit = CTX_data_edit_object(C);
@@ -3777,12 +3777,14 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op))
 
        const int cd_loop_uv_offset  = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV);
 
+       const bool select = RNA_boolean_get(op->ptr, "select");
+
        /* note on tagging, selecting faces needs to be delayed so it doesn't select the verts and
         * confuse our checks on selected verts. */
 
        /* call the mesh function if we are in mesh sync sel */
        if (ts->uv_flag & UV_SYNC_SELECTION) {
-               EDBM_mesh_reveal(em);
+               EDBM_mesh_reveal(em, select);
                WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
 
                return OPERATOR_FINISHED;
@@ -3794,7 +3796,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op))
                                if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
                                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                                luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
-                                               luv->flag |= MLOOPUV_VERTSEL;
+                                               SET_FLAG_FROM_TEST(luv->flag, select, MLOOPUV_VERTSEL);
                                        }
                                        /* BM_face_select_set(em->bm, efa, true); */
                                        BM_elem_flag_enable(efa, BM_ELEM_TAG);
@@ -3815,7 +3817,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op))
                                                if (!totsel) {
                                                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                                                luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
-                                                               luv->flag |= MLOOPUV_VERTSEL;
+                                                               SET_FLAG_FROM_TEST(luv->flag, select, MLOOPUV_VERTSEL);
                                                        }
                                                        /* BM_face_select_set(em->bm, efa, true); */
                                                        BM_elem_flag_enable(efa, BM_ELEM_TAG);
@@ -3830,7 +3832,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op))
                                                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                                        if (BM_elem_flag_test(l->v, BM_ELEM_SELECT) == 0) {
                                                                luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
-                                                               luv->flag |= MLOOPUV_VERTSEL;
+                                                               SET_FLAG_FROM_TEST(luv->flag, select, MLOOPUV_VERTSEL);
                                                        }
                                                }
                                                /* BM_face_select_set(em->bm, efa, true); */
@@ -3846,7 +3848,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op))
                        if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
                                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                        luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
-                                       luv->flag |= MLOOPUV_VERTSEL;
+                                       SET_FLAG_FROM_TEST(luv->flag, select, MLOOPUV_VERTSEL);
                                }
                                /* BM_face_select_set(em->bm, efa, true); */
                                BM_elem_flag_enable(efa, BM_ELEM_TAG);
@@ -3860,7 +3862,7 @@ static int uv_reveal_exec(bContext *C, wmOperator *UNUSED(op))
                                BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                        if (BM_elem_flag_test(l->v, BM_ELEM_SELECT) == 0) {
                                                luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
-                                               luv->flag |= MLOOPUV_VERTSEL;
+                                               SET_FLAG_FROM_TEST(luv->flag, select, MLOOPUV_VERTSEL);
                                        }
                                }
                                /* BM_face_select_set(em->bm, efa, true); */
@@ -3888,6 +3890,8 @@ static void UV_OT_reveal(wmOperatorType *ot)
        /* api callbacks */
        ot->exec = uv_reveal_exec;
        ot->poll = ED_operator_uvedit;
+
+       RNA_def_boolean(ot->srna, "select", true, "Select", "");
 }
 
 /******************** set 3d cursor operator ********************/