Fix [#22207] Selecting Roots also selects hidden
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user