Sculpt:
[blender.git] / source / blender / editors / sculpt_paint / paint_image.c
index a411b0b..1f0d158 100644 (file)
@@ -746,8 +746,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;
        }
        
@@ -2331,8 +2330,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 */
                                                        }
                                                }
@@ -2548,9 +2546,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 */
                                                                                                }
                                                                                        }
@@ -2819,6 +2816,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 */