diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-08-30 15:37:29 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-08-30 15:37:29 +0400 |
commit | d4d520c9a2312e1b03872f92b1e9be1150d167d5 (patch) | |
tree | 56cf674b0c6f93c03d38b39cce5617657bd28903 /source/blender/editors/gpencil/gpencil_buttons.c | |
parent | b9b30e2032a7f5ebcf87a22ad4ab8d66194d6125 (diff) |
Grease Pencil: Various Drawing Fixes
* Restored option to have strokes aligned to screen space. By default, this is not enabled (the setting for view-space is the default instead).
* Fixed bugs related to drawing/erasing in screen space.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_buttons.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_buttons.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index f29d37311fb..774f7b7162b 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -226,9 +226,13 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) /* Draw the contents for a grease-pencil panel*/ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, PointerRNA *ctx_ptr) { + PointerRNA gpd_ptr; bGPDlayer *gpl; uiLayout *col; + /* make new PointerRNA for Grease Pencil block */ + RNA_id_pointer_create((ID *)gpd, &gpd_ptr); + /* draw gpd settings first ------------------------------------- */ col= uiLayoutColumn(layout, 0); /* current Grease Pencil block */ @@ -238,19 +242,19 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi /* add new layer button */ uiItemO(col, NULL, 0, "GPENCIL_OT_layer_add"); - /* 'view align' button (naming depends on context) */ -#if 0 // XXX for now, this is enabled by default anyways - if (sa->spacetype == SPACE_VIEW3D) - uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Sketch in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space"); - else - uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Stick to View", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added on 2d-canvas"); -#endif - /* draw each layer --------------------------------------------- */ for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { col= uiLayoutColumn(layout, 1); gp_drawui_layer(col, gpd, gpl); } + + /* draw gpd drawing settings first ------------------------------------- */ + col= uiLayoutColumn(layout, 0); + /* label */ + uiItemL(col, "Drawing Settings:", 0); + + /* 'stick to view' option */ + uiItemR(col, NULL, 0, &gpd_ptr, "view_space_draw", 0); } |