=== Transform Snap ===
[ #6131 ] Vertex snapping broken in shaded face + edge select mode The problem was trying to use the OGL optimisation when vertex selection was turned off. Added a check for that in all the find_nearest functions (vert, edge, face) so nobody falls in that trap again. The offshot is that snapping in shaded view without vertex select on can snap to occluded vertice.
This commit is contained in:
parent
185ede21ce
commit
09a587ea51
@ -381,7 +381,11 @@ EditVert *findnearestvert(int *dist, short sel, short strict)
|
||||
short mval[2];
|
||||
|
||||
getmouseco_areawin(mval);
|
||||
if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)){
|
||||
/* If possible, use OGL buffer selection
|
||||
* This optimisation is possible only when draw mode is better than wire
|
||||
* when ZBuffer Selection is on and when vertex select is on (otherwise, they aren't drawn)
|
||||
*/
|
||||
if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT) && (G.scene->selectmode & SCE_SELECT_VERTEX)){
|
||||
int distance;
|
||||
unsigned int index;
|
||||
EditVert *eve;
|
||||
@ -490,7 +494,11 @@ EditEdge *findnearestedge(int *dist)
|
||||
|
||||
getmouseco_areawin(mval);
|
||||
|
||||
if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) {
|
||||
/* If possible, use OGL buffer selection
|
||||
* This optimisation is possible only when draw mode is better than wire
|
||||
* when ZBuffer Selection is on and when edge select is on (otherwise, they aren't drawn)
|
||||
*/
|
||||
if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT) && (G.scene->selectmode & SCE_SELECT_EDGE)) {
|
||||
int 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);
|
||||
@ -556,7 +564,11 @@ static EditFace *findnearestface(int *dist)
|
||||
|
||||
getmouseco_areawin(mval);
|
||||
|
||||
if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT)) {
|
||||
/* If possible, use OGL buffer selection
|
||||
* This optimisation is possible only when draw mode is better than wire
|
||||
* when ZBuffer Selection is on and when face select is on (otherwise, they aren't drawn)
|
||||
*/
|
||||
if(G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT) && (G.scene->selectmode & SCE_SELECT_FACE)) {
|
||||
unsigned int index = sample_backbuf(mval[0], mval[1]);
|
||||
EditFace *efa = BLI_findlink(&G.editMesh->faces, index-1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user