diff options
-rw-r--r-- | release/scripts/ui/space_view3d.py | 4 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 27 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_intern.h | 4 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_ops.c | 4 |
4 files changed, 23 insertions, 16 deletions
diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index f5ccfe4e43e..16e4141e2ff 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -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): diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index c298ccc2f5c..6ec744ad027 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -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 */ diff --git a/source/blender/editors/physics/physics_intern.h b/source/blender/editors/physics/physics_intern.h index aa3a2e22e31..b3d11810c43 100644 --- a/source/blender/editors/physics/physics_intern.h +++ b/source/blender/editors/physics/physics_intern.h @@ -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); diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index 4bdac8ff3e8..5a51c36cd09 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -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); |