Page MenuHome

selectconvert.1.18.6.patch

selectconvert.1.18.6.patch

Index: source/blender/src/editmesh_mods.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editmesh_mods.c,v
retrieving revision 1.72.2.5
diff -u -r1.72.2.5 editmesh_mods.c
--- source/blender/src/editmesh_mods.c 9 Jan 2006 00:40:35 -0000 1.72.2.5
+++ source/blender/src/editmesh_mods.c 18 Jan 2006 20:42:56 -0000
@@ -2075,10 +2079,20 @@
else pupmenu_set_active(3);
val= pupmenu("Select Mode%t|Vertices|Edges|Faces");
+
+
if(val>0) {
if(val==1) G.scene->selectmode= SCE_SELECT_VERTEX;
- else if(val==2) G.scene->selectmode= SCE_SELECT_EDGE;
- else G.scene->selectmode= SCE_SELECT_FACE;
+
+ else if(val==2){
+ if((G.qual==LR_CTRLKEY)) EM_convertsel(G.scene->selectmode, SCE_SELECT_EDGE);
+ G.scene->selectmode= SCE_SELECT_EDGE;
+ }
+
+ else{
+ if((G.qual==LR_CTRLKEY)) EM_convertsel(G.scene->selectmode, SCE_SELECT_FACE);
+ G.scene->selectmode= SCE_SELECT_FACE;
+ }
EM_selectmode_set(); // when mode changes
allqueue(REDRAWVIEW3D, 1);
Index: source/blender/src/header_view3d.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/header_view3d.c,v
retrieving revision 1.143.2.6
diff -u -r1.143.2.6 header_view3d.c
--- source/blender/src/header_view3d.c 3 Jan 2006 21:43:30 -0000 1.143.2.6
+++ source/blender/src/header_view3d.c 18 Jan 2006 20:43:02 -0000
@@ -4088,15 +4088,27 @@
EM_selectmode_set();
allqueue(REDRAWVIEW3D, 1);
break;
- case B_SEL_EDGE:
+ case B_SEL_EDGE:
if( (G.qual & LR_SHIFTKEY)==0 || G.scene->selectmode==0)
- G.scene->selectmode= SCE_SELECT_EDGE;
+ {
+ if( (G.scene->selectmode ^ SCE_SELECT_EDGE) == SCE_SELECT_VERTEX) /*if we are moving from vertex select to edge select*/
+ {
+ if(G.qual==LR_CTRLKEY) EM_convertsel(SCE_SELECT_VERTEX,SCE_SELECT_EDGE);
+ }
+ G.scene->selectmode = SCE_SELECT_EDGE;
+ }
EM_selectmode_set();
allqueue(REDRAWVIEW3D, 1);
break;
case B_SEL_FACE:
if( (G.qual & LR_SHIFTKEY)==0 || G.scene->selectmode==0)
- G.scene->selectmode= SCE_SELECT_FACE;
+ {
+ if( ((G.scene->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_VERTEX) || ((G.scene->selectmode ^ SCE_SELECT_FACE) == SCE_SELECT_EDGE))
+ {
+ if(G.qual==LR_CTRLKEY) EM_convertsel((G.scene->selectmode ^ SCE_SELECT_FACE),SCE_SELECT_FACE);
+ }
+ G.scene->selectmode = SCE_SELECT_FACE;
+ }
EM_selectmode_set();
allqueue(REDRAWVIEW3D, 1);
break;
Index: source/blender/src/editmesh_lib.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editmesh_lib.c,v
retrieving revision 1.46.2.2
diff -u -r1.46.2.2 editmesh_lib.c
--- source/blender/src/editmesh_lib.c 3 Jan 2006 17:22:42 -0000 1.46.2.2
+++ source/blender/src/editmesh_lib.c 18 Jan 2006 20:43:03 -0000
@@ -346,6 +346,87 @@
with the calls above
*/
+void EM_convertsel(short oldmode, short selectmode)
+{
+ EditMesh *em = G.editMesh;
+ EditVert *eve;
+ EditEdge *eed;
+ EditFace *efa;
+ /*clear flags*/
+ for(eve= em->verts.first; eve; eve= eve->next) eve->f1 = 0;
+ for(eed= em->edges.first; eed; eed= eed->next) eed->f1 = 0;
+ for(efa= em->faces.first; efa; efa= efa->next) efa->f1 = 0;
+
+
+ if(oldmode == SCE_SELECT_VERTEX) /*have to find out what the selectionmode was previously*/
+ {
+
+ if(selectmode == SCE_SELECT_EDGE)
+ {
+ /*select all edges associated with every selected vertex*/
+ for(eed= em->edges.first; eed; eed= eed->next)
+ {
+ if(eed->v1->f&SELECT) eed->f1 = 1;
+ else if(eed->v2->f&SELECT) eed->f1 = 1;
+ }
+
+ for(eed= em->edges.first; eed; eed= eed->next)
+ {
+ if(eed->f1 == 1) EM_select_edge(eed,1);
+ }
+
+ }
+ else if(selectmode == SCE_SELECT_FACE)
+ {
+ /*select all faces associated with every selected vertex*/
+ for(efa= em->faces.first; efa; efa= efa->next)
+ {
+ if(efa->v1->f&SELECT) efa->f1 = 1;
+ else if(efa->v2->f&SELECT) efa->f1 = 1;
+ else if(efa->v3->f&SELECT) efa->f1 = 1;
+ else
+ {
+ if(efa->v4)
+ {
+ if(efa->v4->f&SELECT) efa->f1 =1;
+ }
+ }
+
+ }
+
+ for(efa= em->faces.first; efa; efa= efa->next)
+ {
+ if(efa->f1 == 1) EM_select_face(efa,1);
+ }
+ check_fgons_selection();
+ countall();
+ }
+ }
+ if(oldmode == SCE_SELECT_EDGE)
+ {
+ if(selectmode == SCE_SELECT_FACE)
+ {
+ for(efa= em->faces.first; efa; efa= efa->next)
+ {
+ if(efa->e1->f&SELECT) efa->f1 = 1;
+ else if(efa->e2->f&SELECT) efa->f1 = 1;
+ else if(efa->e3->f&SELECT) efa->f1 = 1;
+ else if(efa->e4)
+ {
+ if(efa->e4->f&SELECT) efa->f1 = 1;
+ }
+ }
+ for(efa= em->faces.first; efa; efa= efa->next)
+ {
+ if(efa->f1 == 1) EM_select_face(efa,1);
+ }
+ check_fgons_selection();
+ countall();
+ }
+ }
+}
+
+
void EM_selectmode_flush(void)
{
EditMesh *em = G.editMesh;

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
df/20/67cd62052e2fd2d684fff6577b81

Event Timeline