From 487b147235a0965580659ea4e6d3c43dcea99a9e Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Wed, 13 Dec 2006 00:54:16 +0000 Subject: [PATCH] Fixed bug #5402, retopo paint lines don't follow zoom level of 3d viewport. Retopo paint is now specific to one view (the first view you click in after activating retopo paint.) --- source/blender/include/BIF_retopo.h | 2 ++ source/blender/src/retopo.c | 12 +++++++++--- source/blender/src/toets.c | 5 ++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/source/blender/include/BIF_retopo.h b/source/blender/include/BIF_retopo.h index dad8e6a8a0a..f376caca90a 100644 --- a/source/blender/include/BIF_retopo.h +++ b/source/blender/include/BIF_retopo.h @@ -74,6 +74,8 @@ typedef struct RetopoPaintData { short seldist; RetopoPaintSel nearest; + + struct View3D *paint_v3d; } RetopoPaintData; RetopoPaintData *get_retopo_paint_data(); diff --git a/source/blender/src/retopo.c b/source/blender/src/retopo.c index 673da1a1eca..c2f29f443a1 100644 --- a/source/blender/src/retopo.c +++ b/source/blender/src/retopo.c @@ -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"); diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index 9157ed7c0f0..f5b9ccf3f81 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -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);