Fixed bug #5402, retopo paint lines don't follow zoom level of 3d viewport. Retopo...
authorNicholas Bishop <nicholasbishop@gmail.com>
Wed, 13 Dec 2006 00:54:16 +0000 (00:54 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Wed, 13 Dec 2006 00:54:16 +0000 (00:54 +0000)
source/blender/include/BIF_retopo.h
source/blender/src/retopo.c
source/blender/src/toets.c

index dad8e6a8a0a742771787eba1ad7b87f1445bc55a..f376caca90ade306c16752426c311cce10f9344d 100644 (file)
@@ -74,6 +74,8 @@ typedef struct RetopoPaintData {
 
        short seldist;
        RetopoPaintSel nearest;
+       
+       struct View3D *paint_v3d;
 } RetopoPaintData;
 
 RetopoPaintData *get_retopo_paint_data();
index 673da1a1ecaf09beb2471c2db0c10715276e7daf..c2f29f443a118bda6751243c2bfc41b5c36cd019 100644 (file)
@@ -413,7 +413,7 @@ void retopo_paint_view_update(struct View3D *v3d)
 {
        RetopoPaintData *rpd= get_retopo_paint_data();
 
-       if(rpd) {
+       if(rpd && rpd->paint_v3d==v3d) {
                RetopoPaintLine *l;
                RetopoPaintPoint *p;
                double ux, uy, uz;
@@ -440,6 +440,8 @@ char retopo_paint(const unsigned short event)
                RetopoPaintLine *l;
                short mouse[2];
                char lbut= get_mbut() & L_MOUSE;
+               
+               if(rpd->paint_v3d && rpd->paint_v3d!=G.vd) return 1;
        
                getmouseco_areawin(mouse);
 
@@ -538,6 +540,9 @@ char retopo_paint(const unsigned short event)
                        if(!rpd->in_drag) { /* Start new drag */
                                rpd->in_drag= 1;
                                
+                               if(!rpd->paint_v3d)
+                                       rpd->paint_v3d= G.vd;
+                               
                                /* Location of mouse down */
                                rpd->sloc[0]= mouse[0];
                                rpd->sloc[1]= mouse[1];
@@ -591,7 +596,7 @@ void retopo_draw_paint_lines()
 {
        RetopoPaintData *rpd= get_retopo_paint_data();
 
-       if(rpd) {
+       if(rpd && rpd->paint_v3d==G.vd) {
                RetopoPaintLine *l;
                RetopoPaintPoint *p;
 
@@ -791,7 +796,8 @@ void retopo_queue_updates(View3D *v3d)
 
 void retopo_matrix_update(View3D *v3d)
 {
-       if(retopo_mesh_check() || retopo_curve_check()) {
+       RetopoPaintData *rpd= get_retopo_paint_data();
+       if((retopo_mesh_check() || retopo_curve_check()) && (!rpd || rpd->paint_v3d==v3d)) {
                RetopoViewData *rvd= v3d->retopo_view_data;
                if(!rvd) {
                        rvd= MEM_callocN(sizeof(RetopoViewData),"RetopoViewData");
index 9157ed7c0f05ebca06290beb2df98b3999f38975..f5b9ccf3f81d3a93cfd0eb333af50213337d4731 100644 (file)
@@ -339,8 +339,11 @@ void persptoetsen(unsigned short event)
 
        if(G.vd->depths) G.vd->depths->damaged= 1;
        retopo_queue_updates(G.vd);
-       if(retopo_mesh_paint_check() && G.vd->retopo_view_data)
+       if(retopo_mesh_paint_check() && G.vd->retopo_view_data) {
+               /* Force redraw */
+               drawview3dspace(G.vd->area, G.vd);
                retopo_paint_view_update(G.vd);
+       }
        
        if(preview3d_event) 
                BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);