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.)

This commit is contained in:
Nicholas Bishop 2006-12-13 00:54:16 +00:00
parent 080a5d5664
commit 487b147235
3 changed files with 15 additions and 4 deletions

@ -74,6 +74,8 @@ typedef struct RetopoPaintData {
short seldist;
RetopoPaintSel nearest;
struct View3D *paint_v3d;
} RetopoPaintData;
RetopoPaintData *get_retopo_paint_data();

@ -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");

@ -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);