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:
@@ -74,6 +74,8 @@ typedef struct RetopoPaintData {
|
|||||||
|
|
||||||
short seldist;
|
short seldist;
|
||||||
RetopoPaintSel nearest;
|
RetopoPaintSel nearest;
|
||||||
|
|
||||||
|
struct View3D *paint_v3d;
|
||||||
} RetopoPaintData;
|
} RetopoPaintData;
|
||||||
|
|
||||||
RetopoPaintData *get_retopo_paint_data();
|
RetopoPaintData *get_retopo_paint_data();
|
||||||
|
@@ -413,7 +413,7 @@ void retopo_paint_view_update(struct View3D *v3d)
|
|||||||
{
|
{
|
||||||
RetopoPaintData *rpd= get_retopo_paint_data();
|
RetopoPaintData *rpd= get_retopo_paint_data();
|
||||||
|
|
||||||
if(rpd) {
|
if(rpd && rpd->paint_v3d==v3d) {
|
||||||
RetopoPaintLine *l;
|
RetopoPaintLine *l;
|
||||||
RetopoPaintPoint *p;
|
RetopoPaintPoint *p;
|
||||||
double ux, uy, uz;
|
double ux, uy, uz;
|
||||||
@@ -441,6 +441,8 @@ char retopo_paint(const unsigned short event)
|
|||||||
short mouse[2];
|
short mouse[2];
|
||||||
char lbut= get_mbut() & L_MOUSE;
|
char lbut= get_mbut() & L_MOUSE;
|
||||||
|
|
||||||
|
if(rpd->paint_v3d && rpd->paint_v3d!=G.vd) return 1;
|
||||||
|
|
||||||
getmouseco_areawin(mouse);
|
getmouseco_areawin(mouse);
|
||||||
|
|
||||||
if(rpd->in_drag && !lbut) { /* End drag */
|
if(rpd->in_drag && !lbut) { /* End drag */
|
||||||
@@ -538,6 +540,9 @@ char retopo_paint(const unsigned short event)
|
|||||||
if(!rpd->in_drag) { /* Start new drag */
|
if(!rpd->in_drag) { /* Start new drag */
|
||||||
rpd->in_drag= 1;
|
rpd->in_drag= 1;
|
||||||
|
|
||||||
|
if(!rpd->paint_v3d)
|
||||||
|
rpd->paint_v3d= G.vd;
|
||||||
|
|
||||||
/* Location of mouse down */
|
/* Location of mouse down */
|
||||||
rpd->sloc[0]= mouse[0];
|
rpd->sloc[0]= mouse[0];
|
||||||
rpd->sloc[1]= mouse[1];
|
rpd->sloc[1]= mouse[1];
|
||||||
@@ -591,7 +596,7 @@ void retopo_draw_paint_lines()
|
|||||||
{
|
{
|
||||||
RetopoPaintData *rpd= get_retopo_paint_data();
|
RetopoPaintData *rpd= get_retopo_paint_data();
|
||||||
|
|
||||||
if(rpd) {
|
if(rpd && rpd->paint_v3d==G.vd) {
|
||||||
RetopoPaintLine *l;
|
RetopoPaintLine *l;
|
||||||
RetopoPaintPoint *p;
|
RetopoPaintPoint *p;
|
||||||
|
|
||||||
@@ -791,7 +796,8 @@ void retopo_queue_updates(View3D *v3d)
|
|||||||
|
|
||||||
void retopo_matrix_update(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;
|
RetopoViewData *rvd= v3d->retopo_view_data;
|
||||||
if(!rvd) {
|
if(!rvd) {
|
||||||
rvd= MEM_callocN(sizeof(RetopoViewData),"RetopoViewData");
|
rvd= MEM_callocN(sizeof(RetopoViewData),"RetopoViewData");
|
||||||
|
@@ -339,8 +339,11 @@ void persptoetsen(unsigned short event)
|
|||||||
|
|
||||||
if(G.vd->depths) G.vd->depths->damaged= 1;
|
if(G.vd->depths) G.vd->depths->damaged= 1;
|
||||||
retopo_queue_updates(G.vd);
|
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);
|
retopo_paint_view_update(G.vd);
|
||||||
|
}
|
||||||
|
|
||||||
if(preview3d_event)
|
if(preview3d_event)
|
||||||
BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
|
BIF_view3d_previewrender_signal(curarea, PR_DBASE|PR_DISPRECT);
|
||||||
|
Reference in New Issue
Block a user