Three new selection techniques in mesh edit mode, two of which are
controversial: * "Select non-manifold geometry" via ctrl-alt-shift-M, or through the menu or toolbox. Great for troubleshooting weirdness on a subsurf, or for preparing a mesh for decimation or for rapid prototyping. * "Select more" via ctrl-PADPLUS, or through the menu or toolbox. If a selected vert shares an edge with an unselected vert, the unselected one gets selected too. Similar to PADPLUS in wings3d. This is controversial because maybe it would be more useful to select all of the verts that share a face (instead of just an edge) with a selected vert -- what do *you* think? * "Select less" via ctrl-PADMINUS, or through the menu or toolbox. If a selected vert shares an edge with an unselected vert, the selected one gets unselected too. Similar to PADMINUS in wings3d. Also, selected non-manifold geometry becomes unselected. This is controversial because of the non-manifold stuff ... is it needed? What do *you* think?
This commit is contained in:
@@ -8532,3 +8532,180 @@ void bevel_menu()
|
||||
righthandfaces(1);
|
||||
}
|
||||
}
|
||||
|
||||
void select_non_manifold(void)
|
||||
{
|
||||
EditVert *eve;
|
||||
EditEdge *eed;
|
||||
EditVlak *evl;
|
||||
|
||||
/* Selects isolated verts, and edges that do not have 2 neighboring
|
||||
* faces
|
||||
*/
|
||||
|
||||
|
||||
eve= G.edve.first;
|
||||
while(eve) {
|
||||
/* this will count how many edges are connected
|
||||
* to this vert */
|
||||
eve->f1= 0;
|
||||
eve= eve->next;
|
||||
}
|
||||
|
||||
eed= G.eded.first;
|
||||
while(eed) {
|
||||
/* this will count how many faces are connected to
|
||||
* this edge */
|
||||
eed->f1= 0;
|
||||
/* increase edge count for verts */
|
||||
++eed->v1->f1;
|
||||
++eed->v2->f1;
|
||||
eed= eed->next;
|
||||
}
|
||||
|
||||
evl= G.edvl.first;
|
||||
while(evl) {
|
||||
/* increase face count for edges */
|
||||
++evl->e1->f1;
|
||||
++evl->e2->f1;
|
||||
++evl->e3->f1;
|
||||
if (evl->e4)
|
||||
++evl->e4->f1;
|
||||
evl= evl->next;
|
||||
}
|
||||
|
||||
/* select verts that are attached to an edge that does not
|
||||
* have 2 neighboring faces */
|
||||
eed= G.eded.first;
|
||||
while(eed) {
|
||||
if (eed->f1 != 2) {
|
||||
eed->v1->f |= 1;
|
||||
eed->v2->f |= 1;
|
||||
}
|
||||
eed= eed->next;
|
||||
}
|
||||
|
||||
/* select isolated verts */
|
||||
eve= G.edve.first;
|
||||
while(eve) {
|
||||
if (eve->f1 == 0) {
|
||||
eve->f |= 1;
|
||||
}
|
||||
eve= eve->next;
|
||||
}
|
||||
addqueue(curarea->win, REDRAW, 0);
|
||||
|
||||
}
|
||||
|
||||
void select_more(void)
|
||||
{
|
||||
EditVert *eve;
|
||||
EditEdge *eed;
|
||||
|
||||
eve= G.edve.first;
|
||||
while(eve) {
|
||||
eve->f1 = 0;
|
||||
eve= eve->next;
|
||||
}
|
||||
|
||||
eed= G.eded.first;
|
||||
while(eed) {
|
||||
if (eed->v1->f & 1)
|
||||
eed->v2->f1 = 1;
|
||||
if (eed->v2->f & 1)
|
||||
eed->v1->f1 = 1;
|
||||
|
||||
eed= eed->next;
|
||||
}
|
||||
|
||||
eve= G.edve.first;
|
||||
while(eve) {
|
||||
if (eve->f1 == 1)
|
||||
eve->f |= 1;
|
||||
|
||||
eve= eve->next;
|
||||
}
|
||||
|
||||
addqueue(curarea->win, REDRAW, 0);
|
||||
}
|
||||
|
||||
void select_less(void)
|
||||
{
|
||||
EditVert *eve;
|
||||
EditEdge *eed;
|
||||
EditVlak *evl;
|
||||
|
||||
/* eve->f1 & 1 => isolated */
|
||||
/* eve->f1 & 2 => on an edge */
|
||||
/* eve->f1 & 4 => shares edge with a deselected vert */
|
||||
/* eve->f1 & 8 => at most one neighbor */
|
||||
|
||||
eve= G.edve.first;
|
||||
while(eve) {
|
||||
/* assume vert is isolated unless proven otherwise, */
|
||||
/* assume at most one neighbor too */
|
||||
eve->f1 = 1 | 8;
|
||||
|
||||
eve= eve->next;
|
||||
}
|
||||
|
||||
eed= G.eded.first;
|
||||
while(eed) {
|
||||
/* this will count how many faces are connected to
|
||||
* this edge */
|
||||
eed->f1= 0;
|
||||
|
||||
/* if vert wasn't isolated, it now has more than one neighbor */
|
||||
if (~eed->v1->f1 & 1) eed->v1->f1 &= ~8;
|
||||
if (~eed->v2->f1 & 1) eed->v2->f1 &= ~8;
|
||||
|
||||
/* verts on edge are clearly not isolated */
|
||||
eed->v1->f1 &= ~1;
|
||||
eed->v2->f1 &= ~1;
|
||||
|
||||
/* if one of the verts on the edge is deselected,
|
||||
* deselect the other */
|
||||
if (~eed->v1->f & 1)
|
||||
eed->v2->f1 |= 4;
|
||||
if (~eed->v2->f & 1)
|
||||
eed->v1->f1 |= 4;
|
||||
|
||||
eed= eed->next;
|
||||
}
|
||||
|
||||
evl= G.edvl.first;
|
||||
while(evl) {
|
||||
/* increase face count for edges */
|
||||
++evl->e1->f1;
|
||||
++evl->e2->f1;
|
||||
++evl->e3->f1;
|
||||
if (evl->e4)
|
||||
++evl->e4->f1;
|
||||
|
||||
evl= evl->next;
|
||||
}
|
||||
|
||||
eed= G.eded.first;
|
||||
while(eed) {
|
||||
/* if the edge has only one neighboring face, then
|
||||
* deselect attached verts */
|
||||
if (eed->f1 == 1) {
|
||||
eed->v1->f1 |= 2;
|
||||
eed->v2->f1 |= 2;
|
||||
}
|
||||
|
||||
eed= eed->next;
|
||||
}
|
||||
|
||||
/* deselect verts */
|
||||
eve= G.edve.first;
|
||||
while(eve) {
|
||||
if (eve->f1) {
|
||||
eve->f &= ~1;
|
||||
}
|
||||
|
||||
eve= eve->next;
|
||||
}
|
||||
|
||||
allqueue(REDRAWVIEW3D, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user