Fix [#22207] Selecting Roots also selects hidden
authorMatt Ebb <matt@mke3.net>
Fri, 30 Apr 2010 01:22:21 +0000 (01:22 +0000)
committerMatt Ebb <matt@mke3.net>
Fri, 30 Apr 2010 01:22:21 +0000 (01:22 +0000)
release/scripts/ui/space_view3d.py
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/physics_intern.h
source/blender/editors/physics/physics_ops.c

index f5ccfe4e43e6e51c6241e4ac620717d74763960d..16e4141e2ffcdd8f604b1321210625c8e7434a90 100644 (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):
index c298ccc2f5c70ad31d4317a24045d077b7336271..6ec744ad0274a8312d923885f3dffc1ebadd249b 100644 (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 */
index aa3a2e22e3130b34ce1dea759dc49d77252ec826..b3d11810c43eb90c14db6d23a2c78f637e5e7763 100644 (file)
@@ -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);
index 4bdac8ff3e885ad5583648abc50fb21208f9ba61..5a51c36cd09d8002b6b00c3ad8c084ad09e15003 100644 (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);