- remove unneeded len_v3v3 in bevel code
authorCampbell Barton <ideasman42@gmail.com>
Tue, 24 Apr 2012 04:44:51 +0000 (04:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 24 Apr 2012 04:44:51 +0000 (04:44 +0000)
- remove dead assignments from vgroup-blend

source/blender/bmesh/tools/BME_bevel.c
source/blender/editors/object/object_vgroup.c

index 925bd48026a2ac613da078f03158db5a1de83afe..0a38b50afae571da4b618dfe359f77b2583463ad 100644 (file)
@@ -360,8 +360,7 @@ static BMVert *BME_bevel_split_edge(BMesh *bm, BMVert *v, BMVert *v1, BMLoop *l,
 
        is_edge = BME_bevel_get_vec(vec1, v, v1, td); /* get the vector we will be projecting onto */
        BME_bevel_get_vec(vec2, v, v2, td); /* get the vector we will be projecting parallel to */
 
        is_edge = BME_bevel_get_vec(vec1, v, v1, td); /* get the vector we will be projecting onto */
        BME_bevel_get_vec(vec2, v, v2, td); /* get the vector we will be projecting parallel to */
-       len = len_v3(vec1);
-       normalize_v3(vec1);
+       len = normalize_v3(vec1);
 
        vtd = BME_get_transdata(td, sv);
        vtd1 = BME_get_transdata(td, v);
 
        vtd = BME_get_transdata(td, sv);
        vtd1 = BME_get_transdata(td, v);
@@ -399,8 +398,7 @@ static BMVert *BME_bevel_split_edge(BMesh *bm, BMVert *v, BMVert *v1, BMLoop *l,
        }
        madd_v3_v3v3fl(sv->co, v->co, vec1, dis);
        sub_v3_v3v3(vec1, sv->co, vtd1->org);
        }
        madd_v3_v3v3fl(sv->co, v->co, vec1, dis);
        sub_v3_v3v3(vec1, sv->co, vtd1->org);
-       dis = len_v3(vec1);
-       normalize_v3(vec1);
+       dis = normalize_v3(vec1);
        BME_assign_transdata(td, bm, sv, vtd1->org, vtd1->org, vec1, sv->co, dis, scale, maxfactor, vtd->max);
 
        return sv;
        BME_assign_transdata(td, bm, sv, vtd1->org, vtd1->org, vec1, sv->co, dis, scale, maxfactor, vtd->max);
 
        return sv;
index eb380700a61fdd5d468b3ed497b940867de6fd99..b5c34f1c750e2683e01699527b228fc49cefabbc 100644 (file)
@@ -1264,7 +1264,6 @@ static void vgroup_blend(Object *ob, const float fac)
 
        if (BLI_findlink(&ob->defbase, def_nr)) {
                const float ifac = 1.0f - fac;
 
        if (BLI_findlink(&ob->defbase, def_nr)) {
                const float ifac = 1.0f - fac;
-               int i1, i2;
 
                BMEditMesh *em = BMEdit_FromObject(ob);
                BMesh *bm = em ? em->bm : NULL;
 
                BMEditMesh *em = BMEdit_FromObject(ob);
                BMesh *bm = em ? em->bm : NULL;
@@ -1301,14 +1300,15 @@ static void vgroup_blend(Object *ob, const float fac)
                                sel2 = BM_elem_flag_test(eed->v2, BM_ELEM_SELECT);
 
                                if (sel1 != sel2) {
                                sel2 = BM_elem_flag_test(eed->v2, BM_ELEM_SELECT);
 
                                if (sel1 != sel2) {
+                                       int i1 /* , i2 */;
                                        /* i1 is always the selected one */
                                        if (sel1) {
                                                i1= BM_elem_index_get(eed->v1);
                                        /* i1 is always the selected one */
                                        if (sel1) {
                                                i1= BM_elem_index_get(eed->v1);
-                                               i2= BM_elem_index_get(eed->v2);
+                                               /* i2= BM_elem_index_get(eed->v2); */ /* UNUSED */
                                                eve= eed->v2;
                                        }
                                        else {
                                                eve= eed->v2;
                                        }
                                        else {
-                                               i2= BM_elem_index_get(eed->v1);
+                                               /* i2= BM_elem_index_get(eed->v1); */ /* UNUSED */
                                                i1= BM_elem_index_get(eed->v2);
                                                eve= eed->v1;
                                        }
                                                i1= BM_elem_index_get(eed->v2);
                                                eve= eed->v1;
                                        }
@@ -1342,6 +1342,7 @@ static void vgroup_blend(Object *ob, const float fac)
                                sel2 = me->mvert[ed->v2].flag & SELECT;
 
                                if (sel1 != sel2) {
                                sel2 = me->mvert[ed->v2].flag & SELECT;
 
                                if (sel1 != sel2) {
+                                       int i1, i2;
                                        /* i1 is always the selected one */
                                        if (sel1) {
                                                i1 = ed->v1;
                                        /* i1 is always the selected one */
                                        if (sel1) {
                                                i1 = ed->v1;