diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-04-01 15:55:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-04-01 15:55:21 +0400 |
commit | 94ec34fb044a4f66da3cda7af9e98930e9cfc999 (patch) | |
tree | 4d56babd80c7e64258a26bce1346484830a78c38 /source/blender/editors/gpencil/gpencil_buttons.c | |
parent | 3556da255a53de6dc1ab4bf3859b5780390063a2 (diff) |
xray option for grease pencil (on by default), sometimes its nicer not to have lines draw through the mesh.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_buttons.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_buttons.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 47a9c007951..8df89a29f28 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -91,7 +91,7 @@ static void gp_ui_dellayer_cb (bContext *C, void *gpd, void *gpl) /* ------- Drawing Code ------- */ /* draw the controls for a given layer */ -static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) +static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, const short is_v3d) { uiLayout *box=NULL, *split=NULL; uiLayout *col=NULL, *subcol=NULL; @@ -214,6 +214,10 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) subcol= uiLayoutColumn(col, 1); uiItemR(subcol, &ptr, "use_onion_skinning", 0, "Onion Skinning", ICON_NONE); uiItemR(subcol, &ptr, "ghost_range_max", 0, "Frames", ICON_NONE); // XXX shorter name here? i.e. GStep + + if(is_v3d) { + uiItemR(subcol, &ptr, "show_x_ray", 0, "X-Ray", ICON_NONE); + } } } @@ -232,6 +236,7 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi bGPDlayer *gpl; uiLayout *col, *row; short v3d_stroke_opts = STROKE_OPTS_NORMAL; + const short is_v3d= CTX_wm_view3d(C) != NULL; /* make new PointerRNA for Grease Pencil block */ RNA_id_pointer_create((ID *)gpd, &gpd_ptr); @@ -255,7 +260,7 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi /* draw each layer --------------------------------------------- */ for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { col= uiLayoutColumn(layout, 1); - gp_drawui_layer(col, gpd, gpl); + gp_drawui_layer(col, gpd, gpl, is_v3d); } /* draw gpd drawing settings first ------------------------------------- */ @@ -264,7 +269,7 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi uiItemL(col, "Drawing Settings:", ICON_NONE); /* check whether advanced 3D-View drawing space options can be used */ - if (CTX_wm_view3d(C)) { + if (is_v3d) { if (gpd->flag & (GP_DATA_DEPTH_STROKE|GP_DATA_DEPTH_VIEW)) v3d_stroke_opts = STROKE_OPTS_V3D_ON; else |