[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21335] branches/soc-2009-aligorith/source /blender: NLA SoC: Toggle for 'Editing in Place'

Joshua Leung aligorith at gmail.com
Fri Jul 3 06:48:44 CEST 2009


Revision: 21335
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21335
Author:   aligorith
Date:     2009-07-03 06:48:44 +0200 (Fri, 03 Jul 2009)

Log Message:
-----------
NLA SoC: Toggle for 'Editing in Place'

The 'pin' icon beside the name of the active Action when tweaking some strip's action can be used to toggle between editing the Action's keyframes in 'mapped' time or in 'un-mapped' time. 

Modified Paths:
--------------
    branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c
    branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_channels.c
    branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c
    branches/soc-2009-aligorith/source/blender/makesdna/DNA_anim_types.h

Modified: branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c	2009-07-03 04:38:55 UTC (rev 21334)
+++ branches/soc-2009-aligorith/source/blender/blenkernel/intern/nla.c	2009-07-03 04:48:44 UTC (rev 21335)
@@ -458,8 +458,9 @@
 	/* sanity checks 
 	 *	- obviously we've got to have some starting data
 	 *	- when not in tweakmode, the active Action does not have any scaling applied :)
+	 *	- when in tweakmode, if the no-mapping flag is set, do not map
 	 */
-	if ((adt == NULL) || (adt->flag & ADT_NLA_EDIT_ON)==0)
+	if ((adt == NULL) || (adt->flag & ADT_NLA_EDIT_ON)==0 || (adt->flag & ADT_NLA_EDIT_NOMAP))
 		return cframe;
 		
 	/* if the active-strip info has been stored already, access this, otherwise look this up

Modified: branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_channels.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_channels.c	2009-07-03 04:38:55 UTC (rev 21334)
+++ branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_channels.c	2009-07-03 04:48:44 UTC (rev 21335)
@@ -264,14 +264,17 @@
 		{
 			AnimData *adt= BKE_animdata_from_id(ale->owner); /* this won't crash, right? */
 			
-			/* for now, only do something if user clicks on the 'push-down' button */
 			if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) {
-				/* activate push-down function - only usable when not in TweakMode */
 				if (nlaedit_is_tweakmode_on(ac) == 0) {
+					/* 'push-down' action - only usable when not in TweakMode */
 					// TODO: make this use the operator instead of calling the function directly
 					// 	however, calling the operator requires that we supply the args, and that works with proper buttons only
 					BKE_nla_action_pushdown(adt);
 				}
+				else {
+					/* when in tweakmode, this button becomes the toggle for mapped editing */
+					adt->flag ^= ADT_NLA_EDIT_NOMAP;
+				}
 			}
 		}
 			break;

Modified: branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c	2009-07-03 04:38:55 UTC (rev 21334)
+++ branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c	2009-07-03 04:48:44 UTC (rev 21335)
@@ -886,7 +886,18 @@
 				
 				/* now draw some indicator icons  */
 				if ((adt) && (adt->flag & ADT_NLA_EDIT_ON)) {
-					/* 'tweaking action' - not a button */
+					/* toggle for tweaking with mapping/no-mapping (i.e. 'in place editing' toggle) */
+					// for now, use pin icon to symbolise this
+					if (adt->flag & ADT_NLA_EDIT_NOMAP)
+						UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, ICON_PINNED);
+					else
+						UI_icon_draw((float)(NLACHANNEL_NAMEWIDTH-offset), ydatac, ICON_UNPINNED);
+					
+					fdrawline((float)(NLACHANNEL_NAMEWIDTH-offset), yminc, 
+							  (float)(NLACHANNEL_NAMEWIDTH-offset), ymaxc);
+					offset += 16;;
+					
+					/* 'tweaking action' indicator - not a button */
 					UI_icon_draw((float)NLACHANNEL_NAMEWIDTH-offset, ydatac, ICON_EDIT); 
 				}
 				else {

Modified: branches/soc-2009-aligorith/source/blender/makesdna/DNA_anim_types.h
===================================================================
--- branches/soc-2009-aligorith/source/blender/makesdna/DNA_anim_types.h	2009-07-03 04:38:55 UTC (rev 21334)
+++ branches/soc-2009-aligorith/source/blender/makesdna/DNA_anim_types.h	2009-07-03 04:48:44 UTC (rev 21335)
@@ -730,6 +730,8 @@
 	ADT_NLA_EVAL_OFF		= (1<<1),
 		/* NLA is being 'tweaked' (i.e. in EditMode) */
 	ADT_NLA_EDIT_ON			= (1<<2),
+		/* active Action for 'tweaking' does not have mapping applied for editing */
+	ADT_NLA_EDIT_NOMAP		= (1<<3),
 	
 		/* drivers expanded in UI */
 	ADT_DRIVERS_COLLAPSED	= (1<<10),





More information about the Bf-blender-cvs mailing list