diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-21 19:44:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-21 19:44:05 +0300 |
commit | 6f38938a64178f0a3ed6a4b96e4bf459c9076468 (patch) | |
tree | 8852c14a73eae4a32b68a78bac1086dd7fc15487 /source/blender/editors/sculpt_paint | |
parent | bd1f548d8e4a47b81b03af3d50339b2fa33ff5fb (diff) |
[#19930] Nurb CV select is failing because of view clipping
- the clipping test function was using the rv3d->viewmatob where it needed to use the object matrix.
- added a local clipping member to rv3d, the clipping planes in object-space, avoids many matrix multiplications when testing verts or clipping pixels when projection painting.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index ef036da6d7b..55f7a6a23b9 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -861,8 +861,7 @@ static int project_paint_occlude_ptv_clip( if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w); else interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w); - mul_m4_v3(ps->ob->obmat, wco); - if(!view3d_test_clipping(ps->rv3d, wco)) { + if(!view3d_test_clipping(ps->rv3d, wco, 1)) { return 1; } @@ -2446,8 +2445,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i /* a pitty we need to get the worldspace pixel location here */ if(ps->rv3d->rflag & RV3D_CLIPPING) { interp_v3_v3v3v3(wco, ps->dm_mvert[ (*(&mf->v1 + i1)) ].co, ps->dm_mvert[ (*(&mf->v1 + i2)) ].co, ps->dm_mvert[ (*(&mf->v1 + i3)) ].co, w); - mul_m4_v3(ps->ob->obmat, wco); - if(view3d_test_clipping(ps->rv3d, wco)) { + if(view3d_test_clipping(ps->rv3d, wco, 1)) { continue; /* Watch out that no code below this needs to run */ } } @@ -2663,9 +2661,8 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i if(ps->rv3d->rflag & RV3D_CLIPPING) { if (side) interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, w); else interp_v3_v3v3v3(wco, ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, ps->dm_mvert[mf->v3].co, w); - - mul_m4_v3(ps->ob->obmat, wco); - if(view3d_test_clipping(ps->rv3d, wco)) { + + if(view3d_test_clipping(ps->rv3d, wco, 1)) { continue; /* Watch out that no code below this needs to run */ } } @@ -2934,6 +2931,8 @@ static void project_paint_begin(ProjPaintState *ps) /* ---- end defines ---- */ + ED_view3d_local_clipping(ps->rv3d, ps->ob->obmat); /* faster clipping lookups */ + /* paint onto the derived mesh */ /* Workaround for subsurf selection, try the display mesh first */ |