remove *.select_inverse operators where the *.select_all operator has an invert option.
This commit is contained in:
@@ -13,8 +13,8 @@ class SubMenu(bpy.types.Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("object.select_all", text="Select/Deselect All")
|
||||
layout.operator("object.select_inverse", text="Inverse")
|
||||
layout.operator("object.select_all", text="Select/Deselect All").action = 'TOGGLE'
|
||||
layout.operator("object.select_all", text="Inverse").action = 'INVERT'
|
||||
layout.operator("object.select_random", text="Random")
|
||||
|
||||
# access this operator as a submenu
|
||||
|
@@ -27,8 +27,8 @@ class BasicMenu(bpy.types.Menu):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("object.select_all", text="Select/Deselect All")
|
||||
layout.operator("object.select_inverse", text="Inverse")
|
||||
layout.operator("object.select_all", text="Select/Deselect All").action = 'TOGGLE'
|
||||
layout.operator("object.select_all", text="Inverse").action = 'INVERT'
|
||||
layout.operator("object.select_random", text="Random")
|
||||
|
||||
|
||||
|
@@ -34,9 +34,9 @@ class ObjectSelectPanel(bpy.types.Panel):
|
||||
|
||||
box = layout.box()
|
||||
box.label("Selection Tools")
|
||||
box.operator("object.select_all")
|
||||
box.operator("object.select_all").action = 'TOGGLE'
|
||||
row = box.row()
|
||||
row.operator("object.select_inverse")
|
||||
row.operator("object.select_all").action = 'INVERT'
|
||||
row.operator("object.select_random")
|
||||
|
||||
|
||||
|
@@ -219,7 +219,7 @@ kmi.properties.value_1 = 'DISABLED'
|
||||
kmi.properties.value_2 = 'ENABLED'
|
||||
kmi = km.keymap_items.new('view3d.game_start', 'P', 'PRESS')
|
||||
kmi = km.keymap_items.new('object.select_all', 'A', 'PRESS')
|
||||
kmi = km.keymap_items.new('object.select_inverse', 'I', 'PRESS', ctrl=True)
|
||||
kmi = km.keymap_items.new('object.select_all', 'I', 'PRESS', ctrl=True).action = 'INVERT'
|
||||
kmi = km.keymap_items.new('object.select_linked', 'L', 'PRESS', shift=True)
|
||||
kmi = km.keymap_items.new('object.select_grouped', 'G', 'PRESS', shift=True)
|
||||
kmi = km.keymap_items.new('object.select_mirror', 'M', 'PRESS', shift=True, ctrl=True)
|
||||
@@ -304,7 +304,8 @@ kmi = km.keymap_items.new('mesh.select_shortest_path', 'SELECTMOUSE', 'PRESS', c
|
||||
kmi = km.keymap_items.new('mesh.select_all', 'A', 'PRESS')
|
||||
kmi = km.keymap_items.new('mesh.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True)
|
||||
kmi = km.keymap_items.new('mesh.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True)
|
||||
kmi = km.keymap_items.new('mesh.select_inverse', 'I', 'PRESS', ctrl=True)
|
||||
kmi = km.keymap_items.new('mesh.select_all', 'I', 'PRESS', ctrl=True)
|
||||
kmi.properties.action = 'INVERT'
|
||||
kmi = km.keymap_items.new('mesh.select_non_manifold', 'M', 'PRESS', shift=True, ctrl=True, alt=True)
|
||||
kmi = km.keymap_items.new('mesh.select_linked', 'L', 'PRESS', ctrl=True)
|
||||
kmi = km.keymap_items.new('mesh.select_linked_pick', 'L', 'PRESS')
|
||||
|
@@ -485,7 +485,7 @@ class VIEW3D_MT_select_particle(Menu):
|
||||
|
||||
layout.operator("particle.select_all", text="Select/Deselect All").action = 'TOGGLE'
|
||||
layout.operator("particle.select_linked")
|
||||
layout.operator("particle.select_inverse")
|
||||
layout.operator("particle.select_all").action = 'INVERT'
|
||||
|
||||
layout.separator()
|
||||
|
||||
@@ -1508,7 +1508,7 @@ class VIEW3D_MT_edit_mesh_specials(Menu):
|
||||
layout.operator("mesh.remove_doubles")
|
||||
layout.operator("mesh.hide", text="Hide")
|
||||
layout.operator("mesh.reveal", text="Reveal")
|
||||
layout.operator("mesh.select_inverse")
|
||||
layout.operator("mesh.select_all").action = 'INVERT'
|
||||
layout.operator("mesh.flip_normals")
|
||||
layout.operator("mesh.vertices_smooth", text="Smooth")
|
||||
# layout.operator("mesh.bevel", text="Bevel")
|
||||
|
@@ -99,7 +99,6 @@ void POSE_OT_copy(struct wmOperatorType *ot);
|
||||
void POSE_OT_paste(struct wmOperatorType *ot);
|
||||
|
||||
void POSE_OT_select_all(struct wmOperatorType *ot);
|
||||
void POSE_OT_select_inverse(struct wmOperatorType *ot);
|
||||
void POSE_OT_select_parent(struct wmOperatorType *ot);
|
||||
void POSE_OT_select_hierarchy(struct wmOperatorType *ot);
|
||||
void POSE_OT_select_linked(struct wmOperatorType *ot);
|
||||
|
@@ -114,7 +114,6 @@ void ED_operatortypes_armature(void)
|
||||
WM_operatortype_append(POSE_OT_paste);
|
||||
|
||||
WM_operatortype_append(POSE_OT_select_all);
|
||||
WM_operatortype_append(POSE_OT_select_inverse);
|
||||
|
||||
WM_operatortype_append(POSE_OT_select_parent);
|
||||
WM_operatortype_append(POSE_OT_select_hierarchy);
|
||||
@@ -322,7 +321,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf)
|
||||
RNA_boolean_set(kmi->ptr, "flipped", 1);
|
||||
|
||||
WM_keymap_add_item(keymap, "POSE_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "POSE_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "POSE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "action", SEL_INVERT);
|
||||
|
||||
WM_keymap_add_item(keymap, "POSE_OT_select_parent", PKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
|
||||
|
@@ -5031,38 +5031,6 @@ void POSE_OT_transforms_clear(wmOperatorType *ot)
|
||||
|
||||
/* ***************** selections ********************** */
|
||||
|
||||
static int pose_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
|
||||
/* Set the flags */
|
||||
CTX_DATA_BEGIN(C, bPoseChannel *, pchan, visible_pose_bones)
|
||||
{
|
||||
if ((pchan->bone->flag & BONE_UNSELECTABLE) == 0) {
|
||||
pchan->bone->flag ^= (BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL);
|
||||
}
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, NULL);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void POSE_OT_select_inverse(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Select Inverse";
|
||||
ot->idname= "POSE_OT_select_inverse";
|
||||
ot->description= "Flip the selection status of bones (selected -> unselected, unselected -> selected)";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= pose_select_inverse_exec;
|
||||
ot->poll= ED_operator_posemode;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
}
|
||||
static int pose_de_select_all_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
int action = RNA_enum_get(op->ptr, "action");
|
||||
|
@@ -106,7 +106,6 @@ void SURFACE_OT_primitive_nurbs_surface_torus_add(struct wmOperatorType *ot);
|
||||
void CURVE_OT_de_select_first(struct wmOperatorType *ot);
|
||||
void CURVE_OT_de_select_last(struct wmOperatorType *ot);
|
||||
void CURVE_OT_select_all(struct wmOperatorType *ot);
|
||||
void CURVE_OT_select_inverse(struct wmOperatorType *ot);
|
||||
void CURVE_OT_select_linked(struct wmOperatorType *ot);
|
||||
void CURVE_OT_select_linked_pick(struct wmOperatorType *ot);
|
||||
void CURVE_OT_select_row(struct wmOperatorType *ot);
|
||||
|
@@ -116,7 +116,6 @@ void ED_operatortypes_curve(void)
|
||||
WM_operatortype_append(CURVE_OT_de_select_first);
|
||||
WM_operatortype_append(CURVE_OT_de_select_last);
|
||||
WM_operatortype_append(CURVE_OT_select_all);
|
||||
WM_operatortype_append(CURVE_OT_select_inverse);
|
||||
WM_operatortype_append(CURVE_OT_select_linked);
|
||||
WM_operatortype_append(CURVE_OT_select_linked_pick);
|
||||
WM_operatortype_append(CURVE_OT_select_row);
|
||||
@@ -224,10 +223,11 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_vertex_add", LEFTMOUSE, KM_CLICK, KM_CTRL, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "action", SEL_INVERT);
|
||||
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_select_row", RKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "CURVE_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0);
|
||||
RNA_boolean_set(WM_keymap_add_item(keymap, "CURVE_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "deselect", 1);
|
||||
|
@@ -2749,64 +2749,6 @@ void CURVE_OT_reveal(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/********************** select invert operator *********************/
|
||||
|
||||
static int select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
Object *obedit= CTX_data_edit_object(C);
|
||||
Curve *cu= obedit->data;
|
||||
ListBase *editnurb= object_editcurve_get(obedit);
|
||||
Nurb *nu;
|
||||
BPoint *bp;
|
||||
BezTriple *bezt;
|
||||
int a;
|
||||
|
||||
cu->lastsel= NULL;
|
||||
|
||||
for(nu= editnurb->first; nu; nu= nu->next) {
|
||||
if(nu->type == CU_BEZIER) {
|
||||
bezt= nu->bezt;
|
||||
a= nu->pntsu;
|
||||
while(a--) {
|
||||
if(bezt->hide==0) {
|
||||
bezt->f2 ^= SELECT; /* always do the center point */
|
||||
if((cu->drawflag & CU_HIDE_HANDLES)==0) {
|
||||
bezt->f1 ^= SELECT;
|
||||
bezt->f3 ^= SELECT;
|
||||
}
|
||||
}
|
||||
bezt++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
bp= nu->bp;
|
||||
a= nu->pntsu*nu->pntsv;
|
||||
while(a--) {
|
||||
swap_selection_bpoint(bp);
|
||||
bp++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void CURVE_OT_select_inverse(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Select Inverse";
|
||||
ot->idname= "CURVE_OT_select_inverse";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= select_inverse_exec;
|
||||
ot->poll= ED_operator_editsurfcurve;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/********************** subdivide operator *********************/
|
||||
|
||||
/** Divide the line segments associated with the currently selected
|
||||
|
@@ -3383,34 +3383,6 @@ void EM_select_swap(EditMesh *em) /* exported for UV */
|
||||
|
||||
}
|
||||
|
||||
static int select_inverse_mesh_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
Object *obedit= CTX_data_edit_object(C);
|
||||
EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data));
|
||||
|
||||
EM_select_swap(em);
|
||||
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
|
||||
|
||||
BKE_mesh_end_editmesh(obedit->data, em);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void MESH_OT_select_inverse(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Select Inverse";
|
||||
ot->description= "Select inverse of (un)selected vertices, edges or faces";
|
||||
ot->idname= "MESH_OT_select_inverse";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= select_inverse_mesh_exec;
|
||||
ot->poll= ED_operator_editmesh;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/* ******************** (de)select all operator **************** */
|
||||
|
||||
void EM_toggle_select_all(EditMesh *em) /* exported for UV */
|
||||
|
@@ -144,7 +144,6 @@ void MESH_OT_loop_select(struct wmOperatorType *ot);
|
||||
void MESH_OT_select_all(struct wmOperatorType *ot);
|
||||
void MESH_OT_select_more(struct wmOperatorType *ot);
|
||||
void MESH_OT_select_less(struct wmOperatorType *ot);
|
||||
void MESH_OT_select_inverse(struct wmOperatorType *ot);
|
||||
void MESH_OT_select_non_manifold(struct wmOperatorType *ot);
|
||||
void MESH_OT_select_linked(struct wmOperatorType *ot);
|
||||
void MESH_OT_select_linked_pick(struct wmOperatorType *ot);
|
||||
|
@@ -62,7 +62,6 @@ void ED_operatortypes_mesh(void)
|
||||
WM_operatortype_append(MESH_OT_select_all);
|
||||
WM_operatortype_append(MESH_OT_select_more);
|
||||
WM_operatortype_append(MESH_OT_select_less);
|
||||
WM_operatortype_append(MESH_OT_select_inverse);
|
||||
WM_operatortype_append(MESH_OT_select_non_manifold);
|
||||
WM_operatortype_append(MESH_OT_select_linked);
|
||||
WM_operatortype_append(MESH_OT_select_linked_pick);
|
||||
@@ -256,9 +255,10 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
|
||||
WM_keymap_add_item(keymap, "MESH_OT_select_shortest_path", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "MESH_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "MESH_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "action", SEL_INVERT);
|
||||
|
||||
WM_keymap_add_item(keymap, "MESH_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "MESH_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "MESH_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "MESH_OT_select_non_manifold", MKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "MESH_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
|
||||
|
@@ -181,45 +181,6 @@ void MBALL_OT_select_all(wmOperatorType *ot)
|
||||
WM_operator_properties_select_all(ot);
|
||||
}
|
||||
|
||||
/***************************** Select inverse operator *****************************/
|
||||
|
||||
/* Invert metaball selection */
|
||||
static int select_inverse_metaelems_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
Object *obedit= CTX_data_edit_object(C);
|
||||
MetaBall *mb = (MetaBall*)obedit->data;
|
||||
MetaElem *ml;
|
||||
|
||||
ml= mb->editelems->first;
|
||||
if(ml) {
|
||||
while(ml) {
|
||||
if(ml->flag & SELECT)
|
||||
ml->flag &= ~SELECT;
|
||||
else
|
||||
ml->flag |= SELECT;
|
||||
ml= ml->next;
|
||||
}
|
||||
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb);
|
||||
}
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void MBALL_OT_select_inverse_metaelems(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Inverse";
|
||||
ot->description= "Select inverse of (un)selected metaelements";
|
||||
ot->idname= "MBALL_OT_select_inverse_metaelems";
|
||||
|
||||
/* callback functions */
|
||||
ot->exec= select_inverse_metaelems_exec;
|
||||
ot->poll= ED_operator_editmball;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/***************************** Select random operator *****************************/
|
||||
|
||||
/* Random metaball selection */
|
||||
|
@@ -43,7 +43,6 @@ void MBALL_OT_delete_metaelems(struct wmOperatorType *ot);
|
||||
void MBALL_OT_duplicate_metaelems(struct wmOperatorType *ot);
|
||||
|
||||
void MBALL_OT_select_all(struct wmOperatorType *ot);
|
||||
void MBALL_OT_select_inverse_metaelems(struct wmOperatorType *ot);
|
||||
void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot);
|
||||
|
||||
#endif
|
||||
|
@@ -48,7 +48,6 @@ void ED_operatortypes_metaball(void)
|
||||
WM_operatortype_append(MBALL_OT_reveal_metaelems);
|
||||
|
||||
WM_operatortype_append(MBALL_OT_select_all);
|
||||
WM_operatortype_append(MBALL_OT_select_inverse_metaelems);
|
||||
WM_operatortype_append(MBALL_OT_select_random_metaelems);
|
||||
}
|
||||
|
||||
@@ -70,6 +69,6 @@ void ED_keymap_metaball(wmKeyConfig *keyconf)
|
||||
WM_keymap_add_item(keymap, "MBALL_OT_duplicate_metaelems", DKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "MBALL_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "MBALL_OT_select_inverse_metaelems", IKEY, KM_PRESS, KM_CTRL, 0);
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "MBALL_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "action", SEL_INVERT);
|
||||
}
|
||||
|
||||
|
@@ -96,7 +96,6 @@ void OBJECT_OT_game_physics_copy(struct wmOperatorType *ot);
|
||||
|
||||
/* object_select.c */
|
||||
void OBJECT_OT_select_all(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_select_inverse(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_select_random(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_select_by_type(struct wmOperatorType *ot);
|
||||
void OBJECT_OT_select_by_layer(struct wmOperatorType *ot);
|
||||
|
@@ -94,7 +94,6 @@ void ED_operatortypes_object(void)
|
||||
WM_operatortype_append(OBJECT_OT_make_links_data);
|
||||
WM_operatortype_append(OBJECT_OT_move_to_layer);
|
||||
|
||||
WM_operatortype_append(OBJECT_OT_select_inverse);
|
||||
WM_operatortype_append(OBJECT_OT_select_random);
|
||||
WM_operatortype_append(OBJECT_OT_select_all);
|
||||
WM_operatortype_append(OBJECT_OT_select_same_group);
|
||||
@@ -297,7 +296,8 @@ void ED_keymap_object(wmKeyConfig *keyconf)
|
||||
WM_keymap_add_item(keymap, "VIEW3D_OT_game_start", PKEY, KM_PRESS, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "OBJECT_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "OBJECT_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "OBJECT_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "action", SEL_INVERT);
|
||||
|
||||
WM_keymap_add_item(keymap, "OBJECT_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
WM_keymap_add_item(keymap, "OBJECT_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
WM_keymap_add_item(keymap, "OBJECT_OT_select_mirror", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
|
||||
|
@@ -739,41 +739,6 @@ void OBJECT_OT_select_by_layer(wmOperatorType *ot)
|
||||
RNA_def_int(ot->srna, "layers", 1, 1, 20, "Layer", "", 1, 20);
|
||||
}
|
||||
|
||||
/************************** Select Inverse *************************/
|
||||
|
||||
static int object_select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
CTX_DATA_BEGIN(C, Base*, base, visible_bases) {
|
||||
if (base->flag & SELECT)
|
||||
ED_base_object_select(base, BA_DESELECT);
|
||||
else
|
||||
ED_base_object_select(base, BA_SELECT);
|
||||
}
|
||||
CTX_DATA_END;
|
||||
|
||||
/* undo? */
|
||||
WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void OBJECT_OT_select_inverse(wmOperatorType *ot)
|
||||
{
|
||||
|
||||
/* identifiers */
|
||||
ot->name= "Select Inverse";
|
||||
ot->description = "Invert selection of all visible objects";
|
||||
ot->idname= "OBJECT_OT_select_inverse";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= object_select_inverse_exec;
|
||||
ot->poll= objects_selectable_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
|
||||
}
|
||||
|
||||
/**************************** (De)select All ****************************/
|
||||
|
||||
static int object_select_all_exec(bContext *C, wmOperator *op)
|
||||
|
@@ -1880,43 +1880,6 @@ void PARTICLE_OT_select_more(wmOperatorType *ot)
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
static int select_inverse_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
PEData data;
|
||||
PTCacheEdit *edit;
|
||||
POINT_P; KEY_K;
|
||||
|
||||
PE_set_data(C, &data);
|
||||
|
||||
edit= PE_get_current(data.scene, data.ob);
|
||||
|
||||
LOOP_VISIBLE_POINTS {
|
||||
LOOP_KEYS {
|
||||
key->flag ^= PEK_SELECT;
|
||||
point->flag |= PEP_EDIT_RECALC; /* redraw selection only */
|
||||
}
|
||||
}
|
||||
|
||||
PE_update_selection(data.scene, data.ob, 1);
|
||||
WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, data.ob);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void PARTICLE_OT_select_inverse(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Select Inverse";
|
||||
ot->idname= "PARTICLE_OT_select_inverse";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= select_inverse_exec;
|
||||
ot->poll= PE_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
||||
}
|
||||
|
||||
/************************ rekey operator ************************/
|
||||
|
||||
static void rekey_particle(PEData *data, int pa_index)
|
||||
|
@@ -42,7 +42,6 @@ void PARTICLE_OT_select_tips(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_select_linked(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_select_less(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_select_more(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_select_inverse(struct wmOperatorType *ot);
|
||||
|
||||
void PARTICLE_OT_hide(struct wmOperatorType *ot);
|
||||
void PARTICLE_OT_reveal(struct wmOperatorType *ot);
|
||||
|
@@ -51,7 +51,6 @@ static void operatortypes_particle(void)
|
||||
WM_operatortype_append(PARTICLE_OT_select_linked);
|
||||
WM_operatortype_append(PARTICLE_OT_select_less);
|
||||
WM_operatortype_append(PARTICLE_OT_select_more);
|
||||
WM_operatortype_append(PARTICLE_OT_select_inverse);
|
||||
|
||||
WM_operatortype_append(PARTICLE_OT_hide);
|
||||
WM_operatortype_append(PARTICLE_OT_reveal);
|
||||
@@ -95,11 +94,12 @@ static void keymap_particle(wmKeyConfig *keyconf)
|
||||
keymap->poll= PE_poll;
|
||||
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_select_all", AKEY, KM_PRESS, 0, 0);
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "action", SEL_INVERT);
|
||||
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_select_linked", LKEY, KM_PRESS, 0, 0);
|
||||
RNA_boolean_set(WM_keymap_add_item(keymap, "PARTICLE_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "deselect", 1);
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_delete", XKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "PARTICLE_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
||||
|
Reference in New Issue
Block a user