[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11004] trunk/blender/source/blender/src: == NLA/IPO Muting ==

Joshua Leung aligorith at gmail.com
Fri Jun 22 13:55:00 CEST 2007


Revision: 11004
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11004
Author:   aligorith
Date:     2007-06-22 13:55:00 +0200 (Fri, 22 Jun 2007)

Log Message:
-----------
== NLA/IPO Muting ==

This commit adds a few open/closed 'eye' icons to the NLA editor to toggle IPO-block muting on Object (IPO) channels, and Action Strip muting on Action Strips, like in the Action Editor.

Modified Paths:
--------------
    trunk/blender/source/blender/src/drawnla.c
    trunk/blender/source/blender/src/editnla.c

Modified: trunk/blender/source/blender/src/drawnla.c
===================================================================
--- trunk/blender/source/blender/src/drawnla.c	2007-06-22 11:09:31 UTC (rev 11003)
+++ trunk/blender/source/blender/src/drawnla.c	2007-06-22 11:55:00 UTC (rev 11004)
@@ -148,6 +148,15 @@
 				else
 					BIF_icon_draw(x+17, y-8, ICON_ACTION);
 			}	
+			
+			/* icon to indicate if ipo-channel muted */
+			if (ob->ipo) {
+				if (ob->ipo->muteipo) 
+					BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_RESTRICT_VIEW_ON);
+				else 
+					BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_RESTRICT_VIEW_OFF);
+			}
+			
 			glDisable(GL_BLEND);
 			y-=NLACHANNELHEIGHT+NLACHANNELSKIP;
 			
@@ -192,16 +201,20 @@
 						glRasterPos2f(x+48,  y-4);
 						BMF_DrawString(G.font, strip->act->id.name+2);
 						
-						if(strip->flag & ACTSTRIP_ACTIVE) {
-							glEnable(GL_BLEND);
+						glEnable(GL_BLEND);
+						
+						if(strip->flag & ACTSTRIP_ACTIVE)
 							BIF_icon_draw(x+16, y-8, ICON_DOT);
-							glDisable(GL_BLEND);
-						}
-						if(strip->modifiers.first) {
-							glEnable(GL_BLEND);
+							
+						if(strip->modifiers.first)
 							BIF_icon_draw(x+34, y-8, ICON_MODIFIER);
-							glDisable(GL_BLEND);
-						}
+						
+						if(strip->flag & ACTSTRIP_MUTE)
+							BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_RESTRICT_VIEW_ON);
+						else
+							BIF_icon_draw(NLAWIDTH-16, y-NLACHANNELHEIGHT/2, ICON_RESTRICT_VIEW_OFF);
+						
+						glDisable(GL_BLEND);
 					}
 					
 					y-=(NLACHANNELHEIGHT+NLACHANNELSKIP);

Modified: trunk/blender/source/blender/src/editnla.c
===================================================================
--- trunk/blender/source/blender/src/editnla.c	2007-06-22 11:09:31 UTC (rev 11003)
+++ trunk/blender/source/blender/src/editnla.c	2007-06-22 11:55:00 UTC (rev 11004)
@@ -825,8 +825,12 @@
 	
 	if(actclick) /* de-activate all strips */
 		set_active_strip(ob, NULL);
-	else if(strip) /* set action */
-		set_active_strip(ob, strip);
+	else if(strip) {
+		if(mval[0] >= (NLAWIDTH-16)) /* toggle strip muting */
+			strip->flag ^= ACTSTRIP_MUTE;
+		else /* set action */
+			set_active_strip(ob, strip);
+	}
 
 	/* icon toggles beside strip */
 	if (obclick && mval[0]<20) {
@@ -837,6 +841,10 @@
 		/* override option for NLA */
 		ob->nlaflag ^= OB_NLA_OVERRIDE;
 	}
+	else if((obclick) && (ob->ipo) && (mval[0] >= (NLAWIDTH-16))) {
+		/* mute Object IPO-block */
+		ob->ipo->muteipo = (ob->ipo->muteipo)? 0: 1;
+	}
 	
 	ob->ctime= -1234567.0f;	// eveil! 
 	DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);





More information about the Bf-blender-cvs mailing list