Page MenuHome

ExtendSelections.patch

Authored By
codemanx
Nov 13 2013, 5:31 PM
Size
6 KB
Subscribers
None

ExtendSelections.patch

Index: release/scripts/startup/bl_operators/object.py
===================================================================
--- release/scripts/startup/bl_operators/object.py (revision 53510)
+++ release/scripts/startup/bl_operators/object.py (working copy)
@@ -110,6 +110,13 @@
bl_label = "Select Camera"
bl_options = {'REGISTER', 'UNDO'}
+ extend = BoolProperty(
+ name="Extend",
+ description="Extend selection instead of "
+ "deselecting everything first",
+ default=False
+ )
+
def execute(self, context):
scene = context.scene
view = context.space_data
@@ -123,6 +130,8 @@
elif camera.name not in scene.objects:
self.report({'WARNING'}, "Active camera is not in this scene")
else:
+ if not self.extend:
+ bpy.ops.object.select_all(action='DESELECT')
context.scene.objects.active = camera
camera.select = True
return {'FINISHED'}
Index: source/blender/editors/curve/editcurve.c
===================================================================
--- source/blender/editors/curve/editcurve.c (revision 53510)
+++ source/blender/editors/curve/editcurve.c (working copy)
@@ -5510,7 +5510,7 @@
/* properties */
RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of elements to select randomly", 0.f, 100.0f);
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
}
/********************* every nth number of point *******************/
Index: source/blender/editors/mesh/editmesh_select.c
===================================================================
--- source/blender/editors/mesh/editmesh_select.c (revision 53510)
+++ source/blender/editors/mesh/editmesh_select.c (working copy)
@@ -1746,7 +1746,7 @@
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", "");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
}
/* ************************************************** */
@@ -2822,6 +3012,9 @@
BMEdge *e;
BMIter iter;
+ if (!RNA_boolean_get(op->ptr, "extend"))
+ EDBM_flag_disable_all(em, BM_ELEM_SELECT);
+
/* Selects isolated verts, and edges that do not have 2 neighboring
* faces
*/
@@ -2861,6 +3054,10 @@
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+ /* props */
+ RNA_def_boolean(ot->srna, "extend", TRUE,
+ "Extend", "Extend selection instead of deselecting everything first");
}
static int edbm_select_random_exec(bContext *C, wmOperator *op)
@@ -2925,8 +3122,8 @@
/* props */
RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f,
"Percent", "Percentage of elements to select randomly", 0.f, 100.0f);
- RNA_def_boolean(ot->srna, "extend", 0,
- "Extend Selection", "Extend selection instead of deselecting everything first");
+ RNA_def_boolean(ot->srna, "extend", FALSE,
+ "Extend", "Extend selection instead of deselecting everything first");
}
static int edbm_select_next_loop_exec(bContext *C, wmOperator *UNUSED(op))
Index: source/blender/editors/mesh/editmesh_tools.c
===================================================================
--- source/blender/editors/mesh/editmesh_tools.c (revision 53510)
+++ source/blender/editors/mesh/editmesh_tools.c (working copy)
@@ -3838,6 +3838,9 @@
const int numverts = RNA_int_get(op->ptr, "number");
const int type = RNA_enum_get(op->ptr, "type");
+ if (!RNA_boolean_get(op->ptr, "extend"))
+ EDBM_flag_disable_all(em, BM_ELEM_SELECT);
+
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
int select;
@@ -3897,9 +3900,10 @@
/* properties */
RNA_def_int(ot->srna, "number", 4, 3, INT_MAX, "Number of Vertices", "", 3, INT_MAX);
RNA_def_enum(ot->srna, "type", type_items, 1, "Type", "Type of comparison to make");
+ RNA_def_boolean(ot->srna, "extend", TRUE, "Extend", "Extend selection instead of deselecting everything first");
}
-static int edbm_select_loose_verts_exec(bContext *C, wmOperator *UNUSED(op))
+static int edbm_select_loose_verts_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = BMEdit_FromObject(obedit);
@@ -3907,6 +3911,9 @@
BMEdge *eed;
BMIter iter;
+ if (!RNA_boolean_get(op->ptr, "extend"))
+ EDBM_flag_disable_all(em, BM_ELEM_SELECT);
+
BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
if (!eve->e) {
BM_vert_select_set(em->bm, eve, TRUE);
@@ -3938,6 +3945,10 @@
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+ /* props */
+ RNA_def_boolean(ot->srna, "extend", FALSE,
+ "Extend", "Extend selection instead of deselecting everything first");
}
static int edbm_select_mirror_exec(bContext *C, wmOperator *op)
Index: source/blender/editors/object/object_select.c
===================================================================
--- source/blender/editors/object/object_select.c (revision 53510)
+++ source/blender/editors/object/object_select.c (working copy)
@@ -1153,5 +1153,5 @@
/* properties */
RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f, "Percent", "Percentage of objects to select randomly", 0.f, 100.0f);
- RNA_def_boolean(ot->srna, "extend", FALSE, "Extend Selection", "Extend selection instead of deselecting everything first");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
}
Index: armature/editarmature.c
===================================================================
--- armature/editarmature.c (revision 53510)
+++ armature/editarmature.c (working copy)
@@ -4349,7 +4349,7 @@
/* props */
RNA_def_enum(ot->srna, "direction", direction_items,
BONE_SELECT_PARENT, "Direction", "");
- RNA_def_boolean(ot->srna, "extend", 0, "Add to Selection", "");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
}
/* ***************** EditBone Alignment ********************* */
Index: armature/poseobject.c
===================================================================
--- armature/poseobject.c (revision 53510)
+++ armature/poseobject.c (working copy)
@@ -576,7 +576,7 @@
/* props */
ot->prop = RNA_def_enum(ot->srna, "direction", direction_items, BONE_SELECT_PARENT, "Direction", "");
- RNA_def_boolean(ot->srna, "extend", 0, "Add to Selection", "");
+ RNA_def_boolean(ot->srna, "extend", FALSE, "Extend", "Extend selection instead of deselecting everything first");
}
/* ******************* select grouped operator ************* */

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
af/c6/6f39e2073538c348145b74805e37

Event Timeline