[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56354] trunk/blender/source/blender/ editors/space_outliner/outliner_tree.c: Bug fix #35124

Ton Roosendaal ton at blender.org
Sun Apr 28 11:16:11 CEST 2013


Revision: 56354
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56354
Author:   ton
Date:     2013-04-28 09:16:10 +0000 (Sun, 28 Apr 2013)
Log Message:
-----------
Bug fix #35124

Outliner was drawing "Animation" category even when no actions/strips/drivers existed.
Would happen after adding Action and unlinking it.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_outliner/outliner_tree.c

Modified: trunk/blender/source/blender/editors/space_outliner/outliner_tree.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_tree.c	2013-04-28 06:13:24 UTC (rev 56353)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_tree.c	2013-04-28 09:16:10 UTC (rev 56354)
@@ -403,6 +403,13 @@
 
 #undef LOG2I
 
+static int outliner_animdata_test(AnimData *adt)
+{
+	if (adt)
+		return (adt->action || adt->drivers.first || adt->nla_tracks.first);
+	return 0;
+}
+
 static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *sce, TreeElement *te)
 {
 	SceneRenderLayer *srl;
@@ -424,7 +431,7 @@
 	}
 	
 	// TODO: move this to the front?
-	if (sce->adt)
+	if (outliner_animdata_test(sce->adt))
 		outliner_add_element(soops, lb, sce, te, TSE_ANIM_DATA, 0);
 	
 	outliner_add_element(soops,  lb, sce->world, te, 0, 0);
@@ -435,7 +442,7 @@
 {
 	int a = 0;
 	
-	if (ob->adt)
+	if (outliner_animdata_test(ob->adt))
 		outliner_add_element(soops, &te->subtree, ob, te, TSE_ANIM_DATA, 0);
 	
 	outliner_add_element(soops, &te->subtree, ob->poselib, te, 0, 0); // XXX FIXME.. add a special type for this
@@ -626,7 +633,7 @@
 			Mesh *me = (Mesh *)id;
 			int a;
 			
-			if (me->adt)
+			if (outliner_animdata_test(me->adt))
 				outliner_add_element(soops, &te->subtree, me, te, TSE_ANIM_DATA, 0);
 			
 			outliner_add_element(soops, &te->subtree, me->key, te, 0, 0);
@@ -641,7 +648,7 @@
 			Curve *cu = (Curve *)id;
 			int a;
 			
-			if (cu->adt)
+			if (outliner_animdata_test(cu->adt))
 				outliner_add_element(soops, &te->subtree, cu, te, TSE_ANIM_DATA, 0);
 			
 			for (a = 0; a < cu->totcol; a++)
@@ -653,7 +660,7 @@
 			MetaBall *mb = (MetaBall *)id;
 			int a;
 			
-			if (mb->adt)
+			if (outliner_animdata_test(mb->adt))
 				outliner_add_element(soops, &te->subtree, mb, te, TSE_ANIM_DATA, 0);
 			
 			for (a = 0; a < mb->totcol; a++)
@@ -665,7 +672,7 @@
 			Material *ma = (Material *)id;
 			int a;
 			
-			if (ma->adt)
+			if (outliner_animdata_test(ma->adt))
 				outliner_add_element(soops, &te->subtree, ma, te, TSE_ANIM_DATA, 0);
 			
 			for (a = 0; a < MAX_MTEX; a++) {
@@ -677,7 +684,7 @@
 		{
 			Tex *tex = (Tex *)id;
 			
-			if (tex->adt)
+			if (outliner_animdata_test(tex->adt))
 				outliner_add_element(soops, &te->subtree, tex, te, TSE_ANIM_DATA, 0);
 			
 			outliner_add_element(soops, &te->subtree, tex->ima, te, 0, 0);
@@ -687,7 +694,7 @@
 		{
 			Camera *ca = (Camera *)id;
 			
-			if (ca->adt)
+			if (outliner_animdata_test(ca->adt))
 				outliner_add_element(soops, &te->subtree, ca, te, TSE_ANIM_DATA, 0);
 		}
 		break;
@@ -696,7 +703,7 @@
 			Lamp *la = (Lamp *)id;
 			int a;
 			
-			if (la->adt)
+			if (outliner_animdata_test(la->adt))
 				outliner_add_element(soops, &te->subtree, la, te, TSE_ANIM_DATA, 0);
 			
 			for (a = 0; a < MAX_MTEX; a++) {
@@ -708,7 +715,7 @@
 		{
 			Speaker *spk = (Speaker *)id;
 
-			if (spk->adt)
+			if (outliner_animdata_test(spk->adt))
 				outliner_add_element(soops, &te->subtree, spk, te, TSE_ANIM_DATA, 0);
 		}
 		break;
@@ -717,7 +724,7 @@
 			World *wrld = (World *)id;
 			int a;
 			
-			if (wrld->adt)
+			if (outliner_animdata_test(wrld->adt))
 				outliner_add_element(soops, &te->subtree, wrld, te, TSE_ANIM_DATA, 0);
 			
 			for (a = 0; a < MAX_MTEX; a++) {
@@ -729,7 +736,7 @@
 		{
 			Key *key = (Key *)id;
 			
-			if (key->adt)
+			if (outliner_animdata_test(key->adt))
 				outliner_add_element(soops, &te->subtree, key, te, TSE_ANIM_DATA, 0);
 		}
 		break;
@@ -744,7 +751,7 @@
 			bArmature *arm = (bArmature *)id;
 			int a = 0;
 			
-			if (arm->adt)
+			if (outliner_animdata_test(arm->adt))
 				outliner_add_element(soops, &te->subtree, arm, te, TSE_ANIM_DATA, 0);
 			
 			if (arm->edbo) {




More information about the Bf-blender-cvs mailing list