diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-09-05 11:12:04 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-09-05 11:12:04 +0400 |
commit | e8621cf05e6f54294057e3e68c971abda53fdf9a (patch) | |
tree | 0d567f91b3f678dfe06013e9fa9ba3f83a476039 /source/blender/src/space.c | |
parent | 18fe6c27ff2b4a76ec5c646a3dda0a7bd64d94b4 (diff) |
Grease Pencil - Available in Image Editor:
Grease Pencil is now available in the image editor. It is important to note that the strokes drawn WILL NOT become part of the image visible at the time.
Unfortunately, 'fancy' stroke drawing cannot be enabled for use with the 'Stick to View' setting here, as the scaling is wrong.
Diffstat (limited to 'source/blender/src/space.c')
-rw-r--r-- | source/blender/src/space.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 88a0bf0f9b1..64b3014d8d2 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -5336,7 +5336,15 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt) if(val==0) return; if(uiDoBlocks(&sa->uiblocks, event, 1)!=UI_NOTHING ) event= 0; - + + /* grease-pencil drawing before draw-tool */ + if (event == LEFTMOUSE) { + if (gpencil_do_paint(sa, L_MOUSE)) return; + } + else if (event == RIGHTMOUSE) { + if (gpencil_do_paint(sa, R_MOUSE)) return; + } + if (sima->image && (sima->flag & SI_DRAWTOOL)) { switch(event) { case CKEY: @@ -5359,7 +5367,7 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt) event = LEFTMOUSE; } } - + /* Draw tool is inactive, editmode is enabled and the image is not a render or composite */ if (EM_texFaceCheck() && (G.sima->image==0 || (G.sima->image->type != IMA_TYPE_R_RESULT && G.sima->image->type != IMA_TYPE_COMPOSITE))) { switch(event) { @@ -6340,6 +6348,8 @@ void freespacelist(ScrArea *sa) SpaceImage *sima= (SpaceImage *)sl; if(sima->cumap) curvemapping_free(sima->cumap); + if(sima->gpd) + free_gpencil_data(sima->gpd); } else if(sl->spacetype==SPACE_NODE) { SpaceNode *snode= (SpaceNode *)sl; @@ -6407,6 +6417,10 @@ void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2) SpaceSeq *sseq= (SpaceSeq *)sl; sseq->gpd= gpencil_data_duplicate(sseq->gpd); } + else if(sl->spacetype==SPACE_IMAGE) { + SpaceImage *sima= (SpaceImage *)sl; + sima->gpd= gpencil_data_duplicate(sima->gpd); + } sl= sl->next; } |