Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Bantle <hairbat@yahoo.com>2007-01-01 12:41:10 +0300
committerGeoffrey Bantle <hairbat@yahoo.com>2007-01-01 12:41:10 +0300
commitd48a472fe5f77ed63dc33e2c6f1104af107baef3 (patch)
tree827dbeae6a8f99839bba2abcd45cb10c534c1677 /source/blender/src/editmesh_mods.c
parentc96e3e6e7d3c9a9005dea86db635d602bdc383c8 (diff)
-> Fix for bug #5472
Vertex snapping now works with backbuffered selection modes. Previously backbuffer sampling had no way to check whether or not the indices that it retrieved were selected or not. To resolve this I added two optional arguments to sample_backbuf_rect in drawview.c. The first argument tells the function that some additional testing of the retrieved index values needs to be done and the second argument is a pointer to a function to do the testing. findnearestvert() in editmesh_mods.c now makes use of this and passes sample_backbuf_rect() the appropriate argument when being used for vertex snapping.
Diffstat (limited to 'source/blender/src/editmesh_mods.c')
-rw-r--r--source/blender/src/editmesh_mods.c41
1 files changed, 30 insertions, 11 deletions
diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c
index c7b34068b3e..762a9e4fcbd 100644
--- a/source/blender/src/editmesh_mods.c
+++ b/source/blender/src/editmesh_mods.c
@@ -358,6 +358,14 @@ static void findnearestvert__doClosest(void *userData, EditVert *eve, int x, int
}
}
+
+
+
+static unsigned int findnearestvert__backbufIndextest(unsigned int index){
+ EditVert *eve = BLI_findlink(&G.editMesh->verts, index-1);
+ if(eve && (eve->f & SELECT)) return 0;
+ return 1;
+}
/**
* findnearestvert
*
@@ -372,23 +380,22 @@ EditVert *findnearestvert(int *dist, short sel, short strict)
short mval[2];
getmouseco_areawin(mval);
-
- /**
- * FIXME
- * Strict bypasses the openGL select buffer
- * someone with more knowledge of this should fix it -- theeth
- */
- if(strict == 0 && G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) {
+ if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)){
int distance;
- unsigned int index = sample_backbuf_rect(mval, 50, em_wireoffs, 0xFFFFFF, &distance);
+ unsigned int index;
+
+ if(strict) index = sample_backbuf_rect(mval, 50, em_wireoffs, 0xFFFFFF, &distance, strict, findnearestvert__backbufIndextest);
+ else index = sample_backbuf_rect(mval, 50, em_wireoffs, 0xFFFFFF, &distance, 0, NULL);
+
EditVert *eve = BLI_findlink(&G.editMesh->verts, index-1);
-
- if (eve && distance < *dist) {
+
+ if(eve && distance < *dist) {
*dist = distance;
return eve;
} else {
return NULL;
}
+
}
else {
struct { short mval[2], pass, select, strict; int dist, lastIndex, closestIndex; EditVert *closest; } data;
@@ -483,7 +490,7 @@ EditEdge *findnearestedge(int *dist)
if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) {
int distance;
- unsigned int index = sample_backbuf_rect(mval, 50, em_solidoffs, em_wireoffs, &distance);
+ unsigned int index = sample_backbuf_rect(mval, 50, em_solidoffs, em_wireoffs, &distance,0, NULL);
EditEdge *eed = BLI_findlink(&G.editMesh->edges, index-1);
if (eed && distance<*dist) {
@@ -2643,6 +2650,18 @@ void editmesh_mark_sharp(int set)
allqueue(REDRAWVIEW3D, 0);
}
+void BME_Menu() {
+ short ret;
+ ret= pupmenu("BME modeller%t|Select Edges of Vert%x1");
+
+ switch(ret)
+ {
+ case 1:
+ //BME_edges_of_vert();
+ break;
+ }
+}
+
void Edge_Menu() {
short ret;