Merging r39251 through r39311 from trunk into soc-2011-tomato
[blender-staging.git] / source / blender / editors / gpencil / gpencil_paint.c
index 169443d855fc89800f8ce056bbb77d8881470a69..01a0c81d736ab248ecceaef8eb8415d359c2fecb 100644 (file)
@@ -1026,7 +1026,28 @@ static tGPsdata *gp_session_initpaint (bContext *C)
 #endif
                }
                        break;
-
+               case SPACE_CLIP:
+               {
+                       //SpaceClip *sc= curarea->spacedata.first;
+                       
+                       /* set the current area */
+                       p->sa= curarea;
+                       p->ar= ar;
+                       p->v2d= &ar->v2d;
+                       //p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser);
+                       
+#if 0 // XXX disabled for now
+                       /* check that gpencil data is allowed to be drawn */
+                       if ((sc->flag & SC_DISPGP)==0) {
+                               p->status= GP_STATUS_ERROR;
+                               if (G.f & G_DEBUG)
+                                       printf("Error: In active view, Grease Pencil not shown \n");
+                               return p;
+                       }
+#endif
+               }
+                       break;
+                       
                /* unsupported views */
                default:
                {
@@ -1211,6 +1232,12 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode)
                                        p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
                        }
                                break;
+                               
+                       case SPACE_CLIP:
+                       {
+                               p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE;
+                       }
+                               break;
                }
        }
 }