[#28595] Select similar edges by face angles ignores z component of normal angles
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 9 Sep 2011 14:04:33 +0000 (14:04 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 9 Sep 2011 14:04:33 +0000 (14:04 +0000)
Patch provided by Andrew Wiggin (ender79). Thanks!

source/blender/editors/mesh/editmesh_mods.c

index 612d1b18426680f3015e88d83bc41230fb6f321f..57b31b1c84f4e37878332875f97bd177db9b2423 100644 (file)
@@ -959,7 +959,7 @@ static int similar_edge_select__internal(EditMesh *em, int mode, float thresh)
                                        else if (eed->f2==0) /* first access, assign the face */
                                                eed->tmp.f= efa;
                                        else if (eed->f2==1) /* second, we assign the angle*/
-                                               eed->tmp.fp= RAD2DEGF(angle_v2v2(eed->tmp.f->n, efa->n))/180;
+                                               eed->tmp.fp= RAD2DEGF(angle_v3v3(eed->tmp.f->n, efa->n))/180;
                                        eed->f2++; /* f2==0 no face assigned. f2==1 one face found. f2==2 angle calculated.*/
                                }
                                j++;
@@ -1086,7 +1086,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
        Mesh *me= obedit->data;
        EditMesh *em= BKE_mesh_get_editmesh(me); 
 
-       int selcount = similar_edge_select__internal(em, RNA_int_get(op->ptr, "type"), RNA_float_get(op->ptr, "threshold"));
+       int selcount = similar_edge_select__internal(em, RNA_enum_get(op->ptr, "type"), RNA_float_get(op->ptr, "threshold"));
        
        if (selcount) {
                /* here was an edge-mode only select flush case, has to be generalized */