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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2006-02-09 00:01:00 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2006-02-09 00:01:00 +0300
commit3753d817abf1041af435c1ae32b8ff03e945bcde (patch)
tree312046ecc686c8d0022d984295ee3313b265c16d /source/blender/src/editmesh_mods.c
parenteb42008067d76906b7b5d2088e86b1a43356ea47 (diff)
Seam Cutting in Faceselect Mode:
- Mark Border Seam: mark edges on the border of face selection as seam. - Clear Seam: clears seams in selected faces. Hotkey: Ctrl+E - Alt+RMB Click: mark/clear edge as seam - Alt+Shift+RMB Click: mark/clear seams along the shortest/straightest path from last marked seam. The cost of the path also includes some measure of 'straightness' next to the typical distance to make things work more predicatble and edgeloop friendly. Note that this cuts a path from edge to edge, not vertex to vertex. That gives some nice control over the direction of the seam. Also includes: - Removed old LSCM code. - Fix updates glitches with DerivedMesh/Subsurf drawing in FaceSelect mode. Now there's a drawMappedFacesTex instead of drawFacesTex. - Minimize Stretch menu entry called Limit Stitch. - Removed the lasttface global, was being set before it was used anyway, so might as wel return from a function. - Moved some backbuf sampling code to drawview.c from editmesh, so it can be used by Faceselect and VPaint. - Use BLI_heap in parametrizer.c.
Diffstat (limited to 'source/blender/src/editmesh_mods.c')
-rw-r--r--source/blender/src/editmesh_mods.c139
1 files changed, 0 insertions, 139 deletions
diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c
index 8c8315f23fa..aa3353046a8 100644
--- a/source/blender/src/editmesh_mods.c
+++ b/source/blender/src/editmesh_mods.c
@@ -123,145 +123,6 @@ void EM_select_mirrored(void)
unsigned int em_solidoffs=0, em_wireoffs=0, em_vertoffs=0; // set in drawobject.c ... for colorindices
-static void check_backbuf(void)
-{
- if(G.vd->flag & V3D_NEEDBACKBUFDRAW) {
- backdrawview3d(0);
- }
-}
-
-/* samples a single pixel (copied from vpaint) */
-static unsigned int sample_backbuf(int x, int y)
-{
- unsigned int col;
-
- if(x>=curarea->winx || y>=curarea->winy) return 0;
- x+= curarea->winrct.xmin;
- y+= curarea->winrct.ymin;
-
- check_backbuf(); // actually not needed for apple
-
-#ifdef __APPLE__
- glReadBuffer(GL_AUX0);
-#endif
- glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col);
- glReadBuffer(GL_BACK);
-
- if(G.order==B_ENDIAN) SWITCH_INT(col);
-
- return framebuffer_to_index(col);
-}
-
-/* reads full rect, converts indices */
-struct ImBuf *read_backbuf(short xmin, short ymin, short xmax, short ymax)
-{
- unsigned int *dr, *rd;
- struct ImBuf *ibuf, *ibuf1;
- int a;
- short xminc, yminc, xmaxc, ymaxc, xs, ys;
-
- /* clip */
- if(xmin<0) xminc= 0; else xminc= xmin;
- if(xmax>=curarea->winx) xmaxc= curarea->winx-1; else xmaxc= xmax;
- if(xminc > xmaxc) return NULL;
-
- if(ymin<0) yminc= 0; else yminc= ymin;
- if(ymax>=curarea->winy) ymaxc= curarea->winy-1; else ymaxc= ymax;
- if(yminc > ymaxc) return NULL;
-
- ibuf= IMB_allocImBuf((xmaxc-xminc+1),(ymaxc-yminc+1),32,IB_rect,0);
-
- check_backbuf(); // actually not needed for apple
-
-#ifdef __APPLE__
- glReadBuffer(GL_AUX0);
-#endif
- glReadPixels(curarea->winrct.xmin+xminc, curarea->winrct.ymin+yminc, (xmaxc-xminc+1), (ymaxc-yminc+1), GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
- glReadBuffer(GL_BACK);
-
- if(G.order==B_ENDIAN) IMB_convert_rgba_to_abgr(ibuf);
-
- a= (xmaxc-xminc+1)*(ymaxc-yminc+1);
- dr= ibuf->rect;
- while(a--) {
- if(*dr) *dr= framebuffer_to_index(*dr);
- dr++;
- }
-
- /* put clipped result back, if needed */
- if(xminc==xmin && xmaxc==xmax && yminc==ymin && ymaxc==ymax) return ibuf;
- ibuf1= IMB_allocImBuf( (xmax-xmin+1),(ymax-ymin+1),32,IB_rect,0);
- rd= ibuf->rect;
- dr= ibuf1->rect;
-
- for(ys= ymin; ys<=ymax; ys++) {
- for(xs= xmin; xs<=xmax; xs++, dr++) {
- if( xs>=xminc && xs<=xmaxc && ys>=yminc && ys<=ymaxc) {
- *dr= *rd;
- rd++;
- }
- }
- }
- IMB_freeImBuf(ibuf);
- return ibuf1;
-}
-
-
-/* smart function to sample a rect spiralling outside, nice for backbuf selection */
-static unsigned int sample_backbuf_rect(short mval[2], int size, unsigned int min, unsigned int max, short *dist)
-{
- struct ImBuf *buf;
- unsigned int *bufmin, *bufmax, *tbuf;
- int minx, miny;
- int a, b, rc, nr, amount, dirvec[4][2];
- short distance=0;
- unsigned int index = 0;
-
- amount= (size-1)/2;
-
- minx = mval[0]-(amount+1);
- miny = mval[1]-(amount+1);
- buf = read_backbuf(minx, miny, minx+size-1, miny+size-1);
- if (!buf) return 0;
-
- rc= 0;
-
- dirvec[0][0]= 1; dirvec[0][1]= 0;
- dirvec[1][0]= 0; dirvec[1][1]= -size;
- dirvec[2][0]= -1; dirvec[2][1]= 0;
- dirvec[3][0]= 0; dirvec[3][1]= size;
-
- bufmin = buf->rect;
- tbuf = buf->rect;
- bufmax = buf->rect + size*size;
- tbuf+= amount*size+ amount;
-
- for(nr=1; nr<=size; nr++) {
-
- for(a=0; a<2; a++) {
- for(b=0; b<nr; b++, distance++) {
- if (*tbuf && *tbuf>=min && *tbuf<max) {
- *dist= (short) sqrt( (float)distance ); // XXX, this distance is wrong - zr
- index = *tbuf - min+1; // messy yah, but indices start at 1
- goto exit;
- }
-
- tbuf+= (dirvec[rc][0]+dirvec[rc][1]);
-
- if(tbuf<bufmin || tbuf>=bufmax) {
- goto exit;
- }
- }
- rc++;
- rc &= 3;
- }
- }
-
-exit:
- IMB_freeImBuf(buf);
- return index;
-}
-
/* facilities for border select and circle select */
static char *selbuf= NULL;