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;
+ 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);
+ 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;
- }
+ 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;
- }
+ 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);
+ if(efa->f1 == 1) EM_select_face(efa,1);
}
- check_fgons_selection();
- countall();
}
}
+
+ check_fgons_selection();
}
/* when switching select mode, makes sure selection is consistant for editing */
if(eed->f2) EM_select_edge(eed, select);
}
}
+
+static void loop_multiselect(int looptype)
+{
+ EditEdge *eed;
+ EditEdge **edarray;
+ int edindex, edfirstcount;
+
+ /*edarray = MEM_mallocN(sizeof(*edarray)*G.totedgesel,"edge array");*/
+ edarray = MEM_mallocN(sizeof(EditEdge*)*G.totedgesel,"edge array");
+ edindex = 0;
+ edfirstcount = G.totedgesel;
+
+ for(eed=G.editMesh->edges.first; eed; eed=eed->next){
+ if(eed->f&SELECT){
+ edarray[edindex] = eed;
+ edindex += 1;
+ }
+ }
+
+ if(looptype){
+ for(edindex = 0; edindex < edfirstcount; edindex +=1){
+ eed = edarray[edindex];
+ edgering_select(eed,SELECT);
+ }
+ countall();
+ EM_select_flush();
+ BIF_undo_push("Edge Ring Multi-Select");
+ }
+ else{
+ for(edindex = 0; edindex < edfirstcount; edindex +=1){
+ eed = edarray[edindex];
+ edgeloop_select(eed,SELECT);
+ }
+ countall();
+ EM_select_flush();
+ BIF_undo_push("Edge Loop Multi-Select");
+ }
+ MEM_freeN(edarray);
+ allqueue(REDRAWVIEW3D,0);
+}
+
/* ***************** MAIN MOUSE SELECTION ************** */
// just to have the functions nice together
}
countall();
+ BIF_undo_push("Select Less");
allqueue(REDRAWVIEW3D, 0);
}
if(val>0) {
if(val==1){
- G.scene->selectmode= SCE_SELECT_VERTEX;
+ G.scene->selectmode= SCE_SELECT_VERTEX;
+ EM_selectmode_set();
+ countall();
BIF_undo_push("Selectmode Set: Vertex");
}
else if(val==2){
if((G.qual==LR_CTRLKEY)) EM_convertsel(G.scene->selectmode, SCE_SELECT_EDGE);
G.scene->selectmode= SCE_SELECT_EDGE;
+ EM_selectmode_set();
+ countall();
BIF_undo_push("Selectmode Set: Edge");
}
else{
if((G.qual==LR_CTRLKEY)) EM_convertsel(G.scene->selectmode, SCE_SELECT_FACE);
G.scene->selectmode= SCE_SELECT_FACE;
+ EM_selectmode_set();
+ countall();
BIF_undo_push("Selectmode Set: Vertex");
}
-
- EM_selectmode_set(); // when mode changes
+
allqueue(REDRAWVIEW3D, 1);
}
}
void Edge_Menu() {
short ret;
- ret= pupmenu("Edge Specials%t|Mark Seam %x1|Clear Seam %x2|Rotate Edge CW%x3|Rotate Edge CCW%x4|Loopcut%x6|Edge Slide%x5");
+ ret= pupmenu("Edge Specials%t|Mark Seam %x1|Clear Seam %x2|Rotate Edge CW%x3|Rotate Edge CCW%x4|Loopcut%x6|Edge Slide%x5|Edge Loop Select%x7|Edge Ring Select%x8");
switch(ret)
{
CutEdgeloop(1);
BIF_undo_push("Loopcut New");
break;
+ case 7:
+ loop_multiselect(0);
+ break;
+ case 8:
+ loop_multiselect(1);
+ break;
}
}
if( (G.qual & LR_SHIFTKEY)==0 || G.scene->selectmode==0)
G.scene->selectmode= SCE_SELECT_VERTEX;
EM_selectmode_set();
+ countall();
BIF_undo_push("Selectmode Set: Vertex");
allqueue(REDRAWVIEW3D, 1);
break;
G.scene->selectmode = SCE_SELECT_EDGE;
}
EM_selectmode_set();
+ countall();
BIF_undo_push("Selectmode Set: Edge");
allqueue(REDRAWVIEW3D, 1);
break;
G.scene->selectmode = SCE_SELECT_FACE;
}
EM_selectmode_set();
+ countall();
BIF_undo_push("Selectmode Set: Face");
allqueue(REDRAWVIEW3D, 1);
break;