Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-11-11 11:12:54 +0300
committerJoshua Leung <aligorith@gmail.com>2009-11-11 11:12:54 +0300
commit1dfc7942d3f35cbb8bb0e94fec57828da0eb756c (patch)
tree4b3c51a8c36725c31de241ee8e81637d5b61d80f /source/blender/editors/space_node/node_draw.c
parent7206437c7247040c7b3f00d7b76c715103282c4c (diff)
Grease Pencil for Nodes Editor:
This commit restores Grease Pencil functionality for the Nodes Editor. Grease Pencil data is now stored at the NodeTree level, which means that annotations remain with the NodeTree they were made for. Possible TODO's: * In future, it may be worth investigating attaching Grease Pencil data to individual nodes, to allow annotations to stay attached to nodes as they are moved * Include the settings for the 'active node' in a panel in the new NKEY region where the Grease Pencil buttons appear.
Diffstat (limited to 'source/blender/editors/space_node/node_draw.c')
-rw-r--r--source/blender/editors/space_node/node_draw.c37
1 files changed, 7 insertions, 30 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 1ebb7e13193..4ac6fbebea1 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -66,14 +66,13 @@
#include "BKE_text.h"
#include "BKE_utildefines.h"
-/* #include "BDR_gpencil.h" XXX */
-
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "WM_api.h"
#include "WM_types.h"
+#include "ED_gpencil.h"
#include "ED_screen.h"
#include "ED_util.h"
#include "ED_types.h"
@@ -1102,38 +1101,16 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
}
/* draw grease-pencil ('canvas' strokes) */
- /*if ((snode->flag & SNODE_DISPGP) && (snode->nodetree))
- draw_gpencil_2dview(sa, 1);*/
-
- /* restore viewport (not needed yet) */
- /*mywinset(sa->win);*/
-
- /* ortho at pixel level curarea */
- /*myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);*/
-
- /* draw grease-pencil (screen strokes) */
- /*if ((snode->flag & SNODE_DISPGP) && (snode->nodetree))
- draw_gpencil_2dview(sa, 0);*/
-
- //draw_area_emboss(sa);
-
- /* it is important to end a view in a transform compatible with buttons */
- /*bwin_scalematrix(sa->win, snode->blockscale, snode->blockscale, snode->blockscale);
- nodes_blockhandlers(sa);*/
-
- //curarea->win_swap= WIN_BACK_OK;
-
- /* in the end, this is a delayed previewrender test, to allow buttons to be first */
- /*if(snode->flag & SNODE_DO_PREVIEW) {
- addafterqueue(sa->win, RENDERPREVIEW, 1);
- snode->flag &= ~SNODE_DO_PREVIEW;
- }*/
-
-
+ if (/*(snode->flag & SNODE_DISPGP) &&*/ (snode->nodetree))
+ draw_gpencil_2dview((bContext*)C, 1);
/* reset view matrix */
UI_view2d_view_restore(C);
+ /* draw grease-pencil (screen strokes, and also paintbuffer) */
+ if (/*(snode->flag & SNODE_DISPGP) && */(snode->nodetree))
+ draw_gpencil_2dview((bContext*)C, 0);
+
/* scrollers */
scrollers= UI_view2d_scrollers_calc(C, v2d, 10, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
UI_view2d_scrollers_draw(C, v2d, scrollers);