Revision: 25394
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25394
Author:   campbellbarton
Date:     2009-12-15 01:53:34 +0100 (Tue, 15 Dec 2009)

Log Message:
-----------
solidify would only work as expecyed if all faces were selected, added an 
override to extrude that means it runs without removing selected faces first, 
even on a partial selection

Modified Paths:
--------------
    trunk/blender/source/blender/editors/mesh/editmesh_add.c
    trunk/blender/source/blender/editors/mesh/editmesh_lib.c
    trunk/blender/source/blender/editors/mesh/editmesh_mods.c
    trunk/blender/source/blender/editors/mesh/editmesh_tools.c
    trunk/blender/source/blender/editors/mesh/mesh_intern.h

Modified: trunk/blender/source/blender/editors/mesh/editmesh_add.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_add.c    2009-12-15 
00:24:30 UTC (rev 25393)
+++ trunk/blender/source/blender/editors/mesh/editmesh_add.c    2009-12-15 
00:53:34 UTC (rev 25394)
@@ -192,7 +192,7 @@
                        }
                }
                
-               extrudeflag(vc.obedit, vc.em, SELECT, nor);
+               extrudeflag(vc.obedit, vc.em, SELECT, nor, 0);
                rotateflag(vc.em, SELECT, cent, mat);
                translateflag(vc.em, SELECT, min);
                
@@ -1025,7 +1025,7 @@
                mul_mat3_m4_v3(mat, vec);
                
                for(a=0;a<seg-1;a++) {
-                       extrudeflag_vert(obedit, em, 2, nor);   // nor unused
+                       extrudeflag_vert(obedit, em, 2, nor, 0);        // nor 
unused
                        translateflag(em, 2, vec);
                }
                break;
@@ -1060,7 +1060,7 @@
                quat_to_mat3( cmat,q);
                
                for(a=0; a<seg; a++) {
-                       extrudeflag_vert(obedit, em, 2, nor); // nor unused
+                       extrudeflag_vert(obedit, em, 2, nor, 0); // nor unused
                        rotateflag(em, 2, v1->co, cmat);
                }
 

Modified: trunk/blender/source/blender/editors/mesh/editmesh_lib.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_lib.c    2009-12-15 
00:24:30 UTC (rev 25393)
+++ trunk/blender/source/blender/editors/mesh/editmesh_lib.c    2009-12-15 
00:53:34 UTC (rev 25394)
@@ -1143,7 +1143,7 @@
 
 /* this is actually a recode of extrudeflag(), using proper edge/face select */
 /* hurms, doesnt use 'flag' yet, but its not called by primitive making stuff 
anyway */
-static short extrudeflag_edge(Object *obedit, EditMesh *em, short flag, float 
*nor)
+static short extrudeflag_edge(Object *obedit, EditMesh *em, short flag, float 
*nor, int all)
 {
        /* all select edges/faces: extrude */
        /* old select is cleared, in new ones it is set */
@@ -1256,11 +1256,13 @@
        set_edge_directions_f2(em, 2);
        
        /* step 1.5: if *one* selected face has edge with unselected face; 
remove old selected faces */
-       for(efa= em->faces.last; efa; efa= efa->prev) {
-               if(efa->f & SELECT) {
-                       if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1 || 
(efa->e4 && efa->e4->f1)) {
-                               del_old= 1;
-                               break;
+       if(all == 0) {
+               for(efa= em->faces.last; efa; efa= efa->prev) {
+                       if(efa->f & SELECT) {
+                               if(efa->e1->f1 || efa->e2->f1 || efa->e3->f1 || 
(efa->e4 && efa->e4->f1)) {
+                                       del_old= 1;
+                                       break;
+                               }
                        }
                }
        }
@@ -1398,7 +1400,7 @@
        return 'n'; // normal constraint 
 }
 
-short extrudeflag_vert(Object *obedit, EditMesh *em, short flag, float *nor)
+short extrudeflag_vert(Object *obedit, EditMesh *em, short flag, float *nor, 
int all)
 {
        /* all verts/edges/faces with (f & 'flag'): extrude */
        /* from old verts, 'flag' is cleared, in new ones it is set */
@@ -1569,7 +1571,7 @@
        */
        
         /* find if we delete old faces */
-       if(is_face_sel) {
+       if(is_face_sel && all==0) {
                for(eed= em->edges.first; eed; eed= eed->next) {
                        if( (eed->f2==1 || eed->f2==2) ) {
                                if(eed->f1==2) {
@@ -1685,12 +1687,12 @@
 }
 
 /* generic extrude */
-short extrudeflag(Object *obedit, EditMesh *em, short flag, float *nor)
+short extrudeflag(Object *obedit, EditMesh *em, short flag, float *nor, int 
all)
 {
        if(em->selectmode & SCE_SELECT_VERTEX)
-               return extrudeflag_vert(obedit, em, flag, nor);
+               return extrudeflag_vert(obedit, em, flag, nor, all);
        else 
-               return extrudeflag_edge(obedit, em, flag, nor);
+               return extrudeflag_edge(obedit, em, flag, nor, all);
                
 }
 

Modified: trunk/blender/source/blender/editors/mesh/editmesh_mods.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_mods.c   2009-12-15 
00:24:30 UTC (rev 25393)
+++ trunk/blender/source/blender/editors/mesh/editmesh_mods.c   2009-12-15 
00:53:34 UTC (rev 25394)
@@ -4545,14 +4545,13 @@
 
 static int solidify_exec(bContext *C, wmOperator *op)
 {
-       Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
        EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data));
        float nor[3] = {0,0,1};
 
        float thickness= RNA_float_get(op->ptr, "thickness");
 
-       extrudeflag(obedit, em, SELECT, nor);
+       extrudeflag(obedit, em, SELECT, nor, 1);
        EM_make_hq_normals(em);
        EM_solidify(em, thickness);
 

Modified: trunk/blender/source/blender/editors/mesh/editmesh_tools.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_tools.c  2009-12-15 
00:24:30 UTC (rev 25393)
+++ trunk/blender/source/blender/editors/mesh/editmesh_tools.c  2009-12-15 
00:53:34 UTC (rev 25394)
@@ -660,7 +660,7 @@
 
        if(nr<1) return;
 
-       if(nr==1)  transmode= extrudeflag(obedit, em, SELECT, nor);
+       if(nr==1)  transmode= extrudeflag(obedit, em, SELECT, nor, 0);
        else if(nr==4) transmode= extrudeflag_verts_indiv(em, SELECT, nor);
        else if(nr==3) transmode= extrudeflag_edges_indiv(em, SELECT, nor);
        else transmode= extrudeflag_face_indiv(em, SELECT, nor);
@@ -816,7 +816,7 @@
        mul_m3_v3(tmat, dvec);
 
        for(a=0; a<steps; a++) {
-               extrudeflag(obedit, em, SELECT, nor);
+               extrudeflag(obedit, em, SELECT, nor, 0);
                translateflag(em, SELECT, dvec);
        }
 
@@ -898,7 +898,7 @@
                        adduplicateflag(em, 1);
 
        for(a=0; a<steps; a++) {
-               if(dupli==0) ok= extrudeflag(obedit, em, SELECT, nor);
+               if(dupli==0) ok= extrudeflag(obedit, em, SELECT, nor, 0);
                else adduplicateflag(em, SELECT);
 
                if(ok==0)

Modified: trunk/blender/source/blender/editors/mesh/mesh_intern.h
===================================================================
--- trunk/blender/source/blender/editors/mesh/mesh_intern.h     2009-12-15 
00:24:30 UTC (rev 25393)
+++ trunk/blender/source/blender/editors/mesh/mesh_intern.h     2009-12-15 
00:53:34 UTC (rev 25394)
@@ -116,8 +116,8 @@
 extern short extrudeflag_face_indiv(EditMesh *em, short flag, float *nor);
 extern short extrudeflag_verts_indiv(EditMesh *em, short flag, float *nor);
 extern short extrudeflag_edges_indiv(EditMesh *em, short flag, float *nor);
-extern short extrudeflag_vert(Object *obedit, EditMesh *em, short flag, float 
*nor);
-extern short extrudeflag(Object *obedit, EditMesh *em, short flag, float *nor);
+extern short extrudeflag_vert(Object *obedit, EditMesh *em, short flag, float 
*nor, int all);
+extern short extrudeflag(Object *obedit, EditMesh *em, short flag, float *nor, 
int all);
 
 extern void adduplicateflag(EditMesh *em, int flag);
 extern void delfaceflag(EditMesh *em, int flag);


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to