diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-09-03 09:12:34 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-09-03 09:12:34 +0400 |
commit | 8d407b7b28242fbccb6f314f02056bcab753a67a (patch) | |
tree | 5e41b14ba39b5adee7aae418df5c5c71b1c2dffb /source/blender/editors/gpencil | |
parent | 6239d18d50911959a8d5a40056ef87e7253cc70e (diff) |
Grease Pencil: Datablock bugfixes
* Grease Pencil datablocks can now be properly browsed/added/unlinked from the UI panels
* Made Grease Pencil use the brush icon for now. A proper icon for this would be nice ;)
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_buttons.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index c3f779b59b8..0d7cd263245 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -238,12 +238,15 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi col= uiLayoutColumn(layout, 0); /* current Grease Pencil block */ // TODO: show some info about who owns this? - //uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_new", "GPENCIL_OT_data_unlink"); // XXX not working - uiItemR(col, NULL, 0, ctx_ptr, "grease_pencil", 0); // XXX this will have to do for now... + uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_add", "GPENCIL_OT_data_unlink"); - /* add new layer button */ + /* add new layer button - can be used even when no data, since it can add a new block too */ uiItemO(col, NULL, 0, "GPENCIL_OT_layer_add"); + /* sanity checks... */ + if (gpd == NULL) + return; + /* draw each layer --------------------------------------------- */ for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { col= uiLayoutColumn(layout, 1); @@ -271,7 +274,7 @@ void gpencil_panel_standard(const bContext *C, Panel *pa) /* get pointer to Grease Pencil Data */ gpd_ptr= gpencil_data_get_pointers((bContext *)C, &ptr); - if (gpd_ptr && *gpd_ptr) + if (gpd_ptr) draw_gpencil_panel((bContext *)C, pa->layout, *gpd_ptr, &ptr); } |