[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21964] branches/blender2.5/blender/source /blender/editors: NLA: Mute/Disable NLA Playback

Joshua Leung aligorith at gmail.com
Tue Jul 28 09:24:25 CEST 2009


Revision: 21964
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21964
Author:   aligorith
Date:     2009-07-28 09:24:25 +0200 (Tue, 28 Jul 2009)

Log Message:
-----------
NLA: Mute/Disable NLA Playback 

Exposed toggles (defined on AnimData) that will mute the evaluation of that AnimData block's NLA stack. It's active action will then be the only thing that gets evaluated.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c
    branches/blender2.5/blender/source/blender/editors/space_nla/nla_channels.c
    branches/blender2.5/blender/source/blender/editors/space_nla/nla_draw.c

Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c	2009-07-28 06:50:30 UTC (rev 21963)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c	2009-07-28 07:24:25 UTC (rev 21964)
@@ -459,6 +459,8 @@
 				
 				ale->key_data= sce;
 				ale->datatype= ALE_SCE;
+				
+				ale->adt= BKE_animdata_from_id(data);
 			}
 				break;
 			case ANIMTYPE_OBJECT:
@@ -470,6 +472,8 @@
 				
 				ale->key_data= ob;
 				ale->datatype= ALE_OB;
+				
+				ale->adt= BKE_animdata_from_id(&ob->id);
 			}
 				break;
 			case ANIMTYPE_FILLACTD:
@@ -523,6 +527,8 @@
 				
 				ale->key_data= (adt) ? adt->action : NULL;
 				ale->datatype= ALE_ACT;
+				
+				ale->adt= BKE_animdata_from_id(data);
 			}
 				break;
 			case ANIMTYPE_DSLAM:
@@ -534,6 +540,8 @@
 				
 				ale->key_data= (adt) ? adt->action : NULL;
 				ale->datatype= ALE_ACT;
+				
+				ale->adt= BKE_animdata_from_id(data);
 			}
 				break;
 			case ANIMTYPE_DSCAM:
@@ -545,6 +553,8 @@
 				
 				ale->key_data= (adt) ? adt->action : NULL;
 				ale->datatype= ALE_ACT;
+				
+				ale->adt= BKE_animdata_from_id(data);
 			}
 				break;
 			case ANIMTYPE_DSCUR:
@@ -556,6 +566,8 @@
 				
 				ale->key_data= (adt) ? adt->action : NULL;
 				ale->datatype= ALE_ACT;
+				
+				ale->adt= BKE_animdata_from_id(data);
 			}
 				break;
 			case ANIMTYPE_DSSKEY:
@@ -567,6 +579,8 @@
 				
 				ale->key_data= (adt) ? adt->action : NULL;
 				ale->datatype= ALE_ACT;
+				
+				ale->adt= BKE_animdata_from_id(data);
 			}
 				break;
 			case ANIMTYPE_DSWOR:
@@ -578,6 +592,8 @@
 				
 				ale->key_data= (adt) ? adt->action : NULL;
 				ale->datatype= ALE_ACT;
+				
+				ale->adt= BKE_animdata_from_id(data);
 			}
 				break;
 			case ANIMTYPE_DSPART:
@@ -589,6 +605,8 @@
 				
 				ale->key_data= (adt) ? adt->action : NULL;
 				ale->datatype= ALE_ACT;
+				
+				ale->adt= BKE_animdata_from_id(data);
 			}
 				break;
 				

Modified: branches/blender2.5/blender/source/blender/editors/space_nla/nla_channels.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_nla/nla_channels.c	2009-07-28 06:50:30 UTC (rev 21963)
+++ branches/blender2.5/blender/source/blender/editors/space_nla/nla_channels.c	2009-07-28 07:24:25 UTC (rev 21964)
@@ -117,6 +117,7 @@
 		case ANIMTYPE_SCENE:
 		{
 			Scene *sce= (Scene *)ale->data;
+			AnimData *adt= ale->data;
 			
 			if (x < 16) {
 				/* toggle expand */
@@ -124,6 +125,12 @@
 				
 				notifierFlags |= ND_ANIMCHAN_EDIT;
 			}
+			else if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
+				/* toggle mute */
+				adt->flag ^= ADT_NLA_EVAL_OFF;
+				
+				notifierFlags |= ND_ANIMCHAN_EDIT;
+			}
 			else {
 				/* set selection status */
 				if (selectmode == SELECT_INVERT) {
@@ -144,12 +151,19 @@
 			Scene *sce= (Scene *)ads->source;
 			Base *base= (Base *)ale->data;
 			Object *ob= base->object;
+			AnimData *adt= ale->adt;
 			
 			if (x < 16) {
 				/* toggle expand */
 				ob->nlaflag ^= OB_ADS_COLLAPSED; // XXX
 				notifierFlags |= ND_ANIMCHAN_EDIT;				
 			}
+			else if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
+				/* toggle mute */
+				adt->flag ^= ADT_NLA_EVAL_OFF;
+				
+				notifierFlags |= ND_ANIMCHAN_EDIT;
+			}
 			else if (nlaedit_is_tweakmode_on(ac) == 0) {
 				/* set selection status */
 				if (selectmode == SELECT_INVERT) {
@@ -197,49 +211,112 @@
 		case ANIMTYPE_DSMAT:
 		{
 			Material *ma= (Material *)ale->data;
-			ma->flag ^= MA_DS_EXPAND;
+			AnimData *adt= ale->adt;
+			
+			if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
+				/* toggle mute */
+				adt->flag ^= ADT_NLA_EVAL_OFF;
+			} 
+			else {
+				/* toggle expand */
+				ma->flag ^= MA_DS_EXPAND;
+			}
 			notifierFlags |= ND_ANIMCHAN_EDIT;
 		}
 			break;
 		case ANIMTYPE_DSLAM:
 		{
 			Lamp *la= (Lamp *)ale->data;
-			la->flag ^= LA_DS_EXPAND;
+			AnimData *adt= ale->adt;
+			
+			if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
+				/* toggle mute */
+				adt->flag ^= ADT_NLA_EVAL_OFF;
+			} 
+			else {
+				/* toggle expand */
+				la->flag ^= LA_DS_EXPAND;
+			}
 			notifierFlags |= ND_ANIMCHAN_EDIT;
 		}
 			break;
 		case ANIMTYPE_DSCAM:
 		{
 			Camera *ca= (Camera *)ale->data;
-			ca->flag ^= CAM_DS_EXPAND;
+			AnimData *adt= ale->adt;
+			
+			if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
+				/* toggle mute */
+				adt->flag ^= ADT_NLA_EVAL_OFF;
+			} 
+			else {
+				/* toggle expand */
+				ca->flag ^= CAM_DS_EXPAND;
+			}
 			notifierFlags |= ND_ANIMCHAN_EDIT;
 		}
 			break;
 		case ANIMTYPE_DSCUR:
 		{
 			Curve *cu= (Curve *)ale->data;
-			cu->flag ^= CU_DS_EXPAND;
+			AnimData *adt= ale->adt;
+			
+			if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
+				/* toggle mute */
+				adt->flag ^= ADT_NLA_EVAL_OFF;
+			} 
+			else {
+				/* toggle expand */
+				cu->flag ^= CU_DS_EXPAND;
+			}
 			notifierFlags |= ND_ANIMCHAN_EDIT;
 		}
 			break;
 		case ANIMTYPE_DSSKEY:
 		{
 			Key *key= (Key *)ale->data;
-			key->flag ^= KEYBLOCK_DS_EXPAND;
+			AnimData *adt= ale->adt;
+			
+			if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
+				/* toggle mute */
+				adt->flag ^= ADT_NLA_EVAL_OFF;
+			} 
+			else {
+				/* toggle expand */
+				key->flag ^= KEYBLOCK_DS_EXPAND;
+			}
 			notifierFlags |= ND_ANIMCHAN_EDIT;
 		}
 			break;
 		case ANIMTYPE_DSWOR:
 		{
 			World *wo= (World *)ale->data;
-			wo->flag ^= WO_DS_EXPAND;
+			AnimData *adt= ale->adt;
+			
+			if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
+				/* toggle mute */
+				adt->flag ^= ADT_NLA_EVAL_OFF;
+			} 
+			else {
+				/* toggle expand */
+				wo->flag ^= WO_DS_EXPAND;
+			}
 			notifierFlags |= ND_ANIMCHAN_EDIT;
 		}
 			break;
 		case ANIMTYPE_DSPART:
 		{
 			ParticleSettings *part= (ParticleSettings *)ale->data;
-			part->flag ^= PART_DS_EXPAND;
+			AnimData *adt= ale->adt;
+			
+			if ( (adt) && (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) ) {
+				/* toggle mute */
+				adt->flag ^= ADT_NLA_EVAL_OFF;
+			} 
+			else {
+				/* toggle expand */
+				part->flag ^= PART_DS_EXPAND;
+			}
 			notifierFlags |= ND_ANIMCHAN_EDIT;
 		}
 			break;

Modified: branches/blender2.5/blender/source/blender/editors/space_nla/nla_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_nla/nla_draw.c	2009-07-28 06:50:30 UTC (rev 21963)
+++ branches/blender2.5/blender/source/blender/editors/space_nla/nla_draw.c	2009-07-28 07:24:25 UTC (rev 21964)
@@ -638,6 +638,7 @@
 				case ANIMTYPE_SCENE: /* scene */
 				{
 					Scene *sce= (Scene *)ale->data;
+					AnimData *adt= ale->adt;
 					
 					group= 4;
 					indent= 0;
@@ -649,6 +650,14 @@
 						expand= ICON_TRIA_DOWN;
 					else
 						expand= ICON_TRIA_RIGHT;
+						
+					/* NLA evaluation on/off button */
+					if (adt) {
+						if (adt->flag & ADT_NLA_EVAL_OFF)
+							mute = ICON_MUTE_IPO_ON;
+						else	
+							mute = ICON_MUTE_IPO_OFF;
+					}
 					
 					sel = SEL_SCEC(sce);
 					strcpy(name, sce->id.name+2);
@@ -658,6 +667,7 @@
 				{
 					Base *base= (Base *)ale->data;
 					Object *ob= base->object;
+					AnimData *adt= ale->adt;
 					
 					group= 4;
 					indent= 0;
@@ -674,6 +684,14 @@
 					else
 						expand= ICON_TRIA_RIGHT;
 					
+					/* NLA evaluation on/off button */
+					if (adt) {
+						if (adt->flag & ADT_NLA_EVAL_OFF)
+							mute = ICON_MUTE_IPO_ON;
+						else	
+							mute = ICON_MUTE_IPO_OFF;
+					}
+					
 					sel = SEL_OBJC(base);
 					strcpy(name, ob->id.name+2);
 				}
@@ -706,7 +724,7 @@
 						expand = ICON_TRIA_DOWN;
 					else
 						expand = ICON_TRIA_RIGHT;
-						
+					
 					strcpy(name, "Particles");
 				}
 					break;
@@ -715,6 +733,7 @@
 				case ANIMTYPE_DSMAT: /* single material (dopesheet) expand widget */
 				{
 					Material *ma = (Material *)ale->data;
+					AnimData *adt= ale->adt;
 					
 					group = 0;
 					indent = 0;
@@ -725,6 +744,14 @@
 						expand = ICON_TRIA_DOWN;
 					else
 						expand = ICON_TRIA_RIGHT;
+						
+					/* NLA evaluation on/off button */
+					if (adt) {
+						if (adt->flag & ADT_NLA_EVAL_OFF)
+							mute = ICON_MUTE_IPO_ON;
+						else	
+							mute = ICON_MUTE_IPO_OFF;
+					}
 					
 					strcpy(name, ma->id.name+2);
 				}
@@ -732,6 +759,7 @@
 				case ANIMTYPE_DSLAM: /* lamp (dopesheet) expand widget */
 				{
 					Lamp *la = (Lamp *)ale->data;
+					AnimData *adt= ale->adt;
 					
 					group = 4;
 					indent = 1;
@@ -741,6 +769,14 @@
 						expand = ICON_TRIA_DOWN;
 					else
 						expand = ICON_TRIA_RIGHT;
+						
+					/* NLA evaluation on/off button */
+					if (adt) {
+						if (adt->flag & ADT_NLA_EVAL_OFF)
+							mute = ICON_MUTE_IPO_ON;
+						else	
+							mute = ICON_MUTE_IPO_OFF;
+					}
 					
 					strcpy(name, la->id.name+2);
 				}
@@ -748,6 +784,7 @@
 				case ANIMTYPE_DSCAM: /* camera (dopesheet) expand widget */
 				{
 					Camera *ca = (Camera *)ale->data;
+					AnimData *adt= ale->adt;
 					
 					group = 4;
 					indent = 1;
@@ -757,6 +794,14 @@
 						expand = ICON_TRIA_DOWN;
 					else
 						expand = ICON_TRIA_RIGHT;
+						
+					/* NLA evaluation on/off button */
+					if (adt) {
+						if (adt->flag & ADT_NLA_EVAL_OFF)
+							mute = ICON_MUTE_IPO_ON;
+						else	
+							mute = ICON_MUTE_IPO_OFF;
+					}
 					
 					strcpy(name, ca->id.name+2);
 				}
@@ -764,6 +809,7 @@
 				case ANIMTYPE_DSCUR: /* curve (dopesheet) expand widget */
 				{
 					Curve *cu = (Curve *)ale->data;
+					AnimData *adt= ale->adt;
 					
 					group = 4;
 					indent = 1;
@@ -773,6 +819,14 @@
 						expand = ICON_TRIA_DOWN;
 					else
 						expand = ICON_TRIA_RIGHT;
+						
+					/* NLA evaluation on/off button */
+					if (adt) {
+						if (adt->flag & ADT_NLA_EVAL_OFF)
+							mute = ICON_MUTE_IPO_ON;
+						else	
+							mute = ICON_MUTE_IPO_OFF;
+					}
 					
 					strcpy(name, cu->id.name+2);
 				}
@@ -780,16 +834,25 @@
 				case ANIMTYPE_DSSKEY: /* shapekeys (dopesheet) expand widget */
 				{
 					Key *key= (Key *)ale->data;
+					AnimData *adt= ale->adt;
 					
 					group = 4;
 					indent = 1;
-					special = ICON_SHAPEKEY_DATA; // XXX 
+					special = ICON_SHAPEKEY_DATA; 
 					
 					if (FILTER_SKE_OBJD(key))	
 						expand = ICON_TRIA_DOWN;
 					else
 						expand = ICON_TRIA_RIGHT;
 						

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list