~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/editors/mesh/editmesh_extrude.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
713
713
        BMEditMesh *em = BKE_editmesh_from_object(obedit);
714
714
        BMesh *bm = em->bm;
715
715
        BMOperator spinop;
716
 
        float cent[3], axis[3], imat[3][3];
 
716
        float cent[3], axis[3];
717
717
        float d[3] = {0.0f, 0.0f, 0.0f};
718
718
        int steps, dupli;
719
719
        float angle;
726
726
        angle = -angle;
727
727
        dupli = RNA_boolean_get(op->ptr, "dupli");
728
728
 
729
 
        /* undo object transformation */
730
 
        copy_m3_m4(imat, obedit->imat);
731
 
        sub_v3_v3(cent, obedit->obmat[3]);
732
 
        mul_m3_v3(imat, cent);
733
 
        mul_m3_v3(imat, axis);
734
 
 
 
729
        /* keep the values in worldspace since we're passing the obmat */
735
730
        if (!EDBM_op_init(em, &spinop, op,
736
 
                          "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f use_duplicate=%b",
737
 
                          BM_ELEM_SELECT, cent, axis, d, steps, angle, dupli))
 
731
                          "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f space=%m4 use_duplicate=%b",
 
732
                          BM_ELEM_SELECT, cent, axis, d, steps, angle, obedit->obmat, dupli))
738
733
        {
739
734
                return OPERATOR_CANCELLED;
740
735
        }
800
795
        BMVert *eve, *v1, *v2;
801
796
        BMIter iter, eiter;
802
797
        BMOperator spinop;
803
 
        float dvec[3], nor[3], cent[3], axis[3];
804
 
        float imat[3][3];
 
798
        float dvec[3], nor[3], cent[3], axis[3], v1_co_global[3], v2_co_global[3];
805
799
        int steps, turns;
806
800
        int valence;
807
801
 
811
805
        RNA_float_get_array(op->ptr, "center", cent);
812
806
        RNA_float_get_array(op->ptr, "axis", axis);
813
807
 
814
 
        /* undo object transformation */
815
 
        copy_m3_m4(imat, obedit->imat);
816
 
        sub_v3_v3(cent, obedit->obmat[3]);
817
 
        mul_m3_v3(imat, cent);
818
 
        mul_m3_v3(imat, axis);
819
 
 
820
 
 
821
808
        /* find two vertices with valence count == 1, more or less is wrong */
822
809
        v1 = NULL;
823
810
        v2 = NULL;
849
836
                return OPERATOR_CANCELLED;
850
837
        }
851
838
 
 
839
        copy_v3_v3(nor, obedit->obmat[2]);
 
840
 
852
841
        /* calculate dvec */
853
 
        sub_v3_v3v3(dvec, v1->co, v2->co);
 
842
        mul_v3_m4v3(v1_co_global, obedit->obmat, v1->co);
 
843
        mul_v3_m4v3(v2_co_global, obedit->obmat, v2->co);
 
844
        sub_v3_v3v3(dvec, v1_co_global, v2_co_global);
854
845
        mul_v3_fl(dvec, 1.0f / steps);
855
846
 
856
 
        if (dot_v3v3(nor, dvec) > 0.000f)
 
847
        if (dot_v3v3(nor, dvec) > 0.0f)
857
848
                negate_v3(dvec);
858
849
 
859
850
        if (!EDBM_op_init(em, &spinop, op,
860
 
                          "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f use_duplicate=%b",
861
 
                          BM_ELEM_SELECT, cent, axis, dvec, turns * steps, DEG2RADF(360.0f * turns), false))
 
851
                          "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f space=%m4 use_duplicate=%b",
 
852
                          BM_ELEM_SELECT, cent, axis, dvec, turns * steps, DEG2RADF(360.0f * turns), obedit->obmat, false))
862
853
        {
863
854
                return OPERATOR_CANCELLED;
864
855
        }