GPencil: Initial support for Grease Pencil in the Outliner

This commit just adds entries for the Grease Pencil datablocks in the Outliner.
Currently, there's not much more to see here, but the following commits will see
to that.
This commit is contained in:
Joshua Leung 2015-02-07 12:28:17 +13:00
parent ca06c3343e
commit 68fc2e210e
2 changed files with 21 additions and 0 deletions

@ -1167,6 +1167,8 @@ static void tselem_draw_icon(uiBlock *block, int xmax, float x, float y, TreeSto
tselem_draw_icon_uibut(&arg, ICON_LIBRARY_DATA_DIRECT); break;
case ID_LS:
tselem_draw_icon_uibut(&arg, ICON_LINE_DATA); break;
case ID_GD:
tselem_draw_icon_uibut(&arg, ICON_GREASEPENCIL); break;
}
}
}

@ -38,6 +38,7 @@
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_camera_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_group_types.h"
#include "DNA_key_types.h"
#include "DNA_lamp_types.h"
@ -431,6 +432,8 @@ static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *s
if (outliner_animdata_test(sce->adt))
outliner_add_element(soops, lb, sce, te, TSE_ANIM_DATA, 0);
outliner_add_element(soops, lb, sce->gpd, te, 0, 0);
outliner_add_element(soops, lb, sce->world, te, 0, 0);
#ifdef WITH_FREESTYLE
@ -452,6 +455,8 @@ static void outliner_add_object_contents(SpaceOops *soops, TreeElement *te, Tree
if (ob->proxy && ob->id.lib == NULL)
outliner_add_element(soops, &te->subtree, ob->proxy, te, TSE_PROXY, 0);
outliner_add_element(soops, &te->subtree, ob->gpd, te, 0, 0);
outliner_add_element(soops, &te->subtree, ob->data, te, 0, 0);
if (ob->pose) {
@ -809,6 +814,20 @@ static void outliner_add_id_contents(SpaceOops *soops, TreeElement *te, TreeStor
}
break;
}
case ID_GD:
{
bGPdata *gpd = (bGPdata *)id;
bGPDlayer *gpl;
int a = 0;
if (outliner_animdata_test(gpd->adt))
outliner_add_element(soops, &te->subtree, gpd, te, TSE_ANIM_DATA, 0);
for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
// TODO
a++;
}
}
}
}