[Bf-blender-cvs] [68fc2e2] master: GPencil: Initial support for Grease Pencil in the Outliner

Joshua Leung noreply at git.blender.org
Sat Feb 7 00:50:45 CET 2015


Commit: 68fc2e210ec0a3712540bc535bd9c82b939861ce
Author: Joshua Leung
Date:   Sat Feb 7 12:28:17 2015 +1300
Branches: master
https://developer.blender.org/rB68fc2e210ec0a3712540bc535bd9c82b939861ce

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.

===================================================================

M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_tree.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 1aa3fc2..f604679 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -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;
 		}
 	}
 }
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index c7cd4fa..8a4b6f1 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -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"
@@ -430,6 +431,8 @@ static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *s
 	// TODO: move this to the front?
 	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);
 
@@ -451,6 +454,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);
 	
@@ -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++;
+			}
+		}
 	}
 }




More information about the Bf-blender-cvs mailing list