Fix [#22207] Selecting Roots also selects hidden

This commit is contained in:
Matt Ebb
2010-04-30 01:22:21 +00:00
parent 12a7c8f699
commit 53dbc1efdf
4 changed files with 23 additions and 16 deletions
+2 -2
View File
@@ -453,8 +453,8 @@ class VIEW3D_MT_select_particle(bpy.types.Menu):
layout.separator()
layout.operator("particle.select_first", text="Roots")
layout.operator("particle.select_last", text="Tips")
layout.operator("particle.select_roots", text="Roots")
layout.operator("particle.select_tips", text="Tips")
class VIEW3D_MT_select_edit_mesh(bpy.types.Menu):
+17 -10
View File
@@ -1380,11 +1380,14 @@ int PE_mouse_particles(bContext *C, short *mval, int extend)
static void select_root(PEData *data, int point_index)
{
if (data->edit->points[point_index].flag & PEP_HIDE)
return;
data->edit->points[point_index].keys->flag |= PEK_SELECT;
data->edit->points[point_index].flag |= PEP_EDIT_RECALC; /* redraw selection only */
}
static int select_first_exec(bContext *C, wmOperator *op)
static int select_roots_exec(bContext *C, wmOperator *op)
{
PEData data;
@@ -1397,14 +1400,14 @@ static int select_first_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
void PARTICLE_OT_select_first(wmOperatorType *ot)
void PARTICLE_OT_select_roots(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select First";
ot->idname= "PARTICLE_OT_select_first";
ot->name= "Select Roots";
ot->idname= "PARTICLE_OT_select_roots";
/* api callbacks */
ot->exec= select_first_exec;
ot->exec= select_roots_exec;
ot->poll= PE_poll;
/* flags */
@@ -1416,11 +1419,15 @@ void PARTICLE_OT_select_first(wmOperatorType *ot)
static void select_tip(PEData *data, int point_index)
{
PTCacheEditPoint *point = data->edit->points + point_index;
if (point->flag & PEP_HIDE)
return;
point->keys[point->totkey - 1].flag |= PEK_SELECT;
point->flag |= PEP_EDIT_RECALC; /* redraw selection only */
}
static int select_last_exec(bContext *C, wmOperator *op)
static int select_tips_exec(bContext *C, wmOperator *op)
{
PEData data;
@@ -1433,14 +1440,14 @@ static int select_last_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
void PARTICLE_OT_select_last(wmOperatorType *ot)
void PARTICLE_OT_select_tips(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Last";
ot->idname= "PARTICLE_OT_select_last";
ot->name= "Select Tips";
ot->idname= "PARTICLE_OT_select_tips";
/* api callbacks */
ot->exec= select_last_exec;
ot->exec= select_tips_exec;
ot->poll= PE_poll;
/* flags */
@@ -37,8 +37,8 @@ struct wmOperatorType;
/* particle_edit.c */
void PARTICLE_OT_select_all(struct wmOperatorType *ot);
void PARTICLE_OT_select_first(struct wmOperatorType *ot);
void PARTICLE_OT_select_last(struct wmOperatorType *ot);
void PARTICLE_OT_select_roots(struct wmOperatorType *ot);
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);
+2 -2
View File
@@ -43,8 +43,8 @@
static void operatortypes_particle(void)
{
WM_operatortype_append(PARTICLE_OT_select_all);
WM_operatortype_append(PARTICLE_OT_select_first);
WM_operatortype_append(PARTICLE_OT_select_last);
WM_operatortype_append(PARTICLE_OT_select_roots);
WM_operatortype_append(PARTICLE_OT_select_tips);
WM_operatortype_append(PARTICLE_OT_select_linked);
WM_operatortype_append(PARTICLE_OT_select_less);
WM_operatortype_append(PARTICLE_OT_select_more);