diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-11 15:40:36 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-11 15:40:36 +0400 |
commit | 6674106d30a010c590aec1e7ab0b929155bde2bd (patch) | |
tree | e6f2ae52fae3b01ee94166849f42758880316254 | |
parent | 2a4a8fd43e83d4961ca25ad16b965217c274e1c1 (diff) |
Fixed issue with disappearing Clip/Track menu from GP panel in Clip Editor
caused by switching to Track GP without having active track.
-rw-r--r-- | source/blender/editors/gpencil/gpencil_buttons.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index c8d03bcbf2f..4c125ebe013 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -231,6 +231,23 @@ typedef enum eGP_Stroke_Ops { STROKE_OPTS_V3D_ON, } eGP_Stroke_Ops; +static void draw_gpencil_space_specials(const bContext *C, uiLayout *layout) +{ + uiLayout *col, *row; + SpaceClip *sc = CTX_wm_space_clip(C); + + col = uiLayoutColumn(layout, 0); + + if (sc) { + bScreen *screen = CTX_wm_screen(C); + PointerRNA sc_ptr; + + RNA_pointer_create(&screen->id, &RNA_SpaceClipEditor, sc, &sc_ptr); + row = uiLayoutRow(col, 1); + uiItemR(row, &sc_ptr, "grease_pencil_source", UI_ITEM_R_EXPAND, NULL, ICON_NONE); + } +} + /* Draw the contents for a grease-pencil panel*/ static void draw_gpencil_panel(bContext *C, uiLayout *layout, bGPdata *gpd, PointerRNA *ctx_ptr) { @@ -247,15 +264,6 @@ static void draw_gpencil_panel(bContext *C, uiLayout *layout, bGPdata *gpd, Poin /* draw gpd settings first ------------------------------------- */ col = uiLayoutColumn(layout, 0); - if (sc) { - bScreen *screen = CTX_wm_screen(C); - PointerRNA sc_ptr; - - RNA_pointer_create(&screen->id, &RNA_SpaceClipEditor, sc, &sc_ptr); - row = uiLayoutRow(col, 1); - uiItemR(row, &sc_ptr, "grease_pencil_source", UI_ITEM_R_EXPAND, NULL, ICON_NONE); - } - /* current Grease Pencil block */ /* TODO: show some info about who owns this? */ uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_add", NULL, "GPENCIL_OT_data_unlink"); @@ -315,6 +323,8 @@ void gpencil_panel_standard(const bContext *C, Panel *pa) /* if (v3d->flag2 & V3D_DISPGP)... etc. */ + draw_gpencil_space_specials(C, pa->layout); + /* get pointer to Grease Pencil Data */ gpd_ptr = gpencil_data_get_pointers((bContext *)C, &ptr); |