[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18584] branches/blender2.5/blender/source /blender: Animato - Restoring most of Action Editor

Joshua Leung aligorith at gmail.com
Tue Jan 20 12:07:42 CET 2009


Revision: 18584
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18584
Author:   aligorith
Date:     2009-01-20 12:07:42 +0100 (Tue, 20 Jan 2009)

Log Message:
-----------
Animato - Restoring most of Action Editor 

* Streamlined the filtering code to remove a few redundant options, which required tweaking the code for most tools 

* F-Curves are simply displayed using their full paths right now. This should eventually be the UI-string stored in RNA, but right now there are still a few missing things.

* There are a few tools which are not available yet which were available in 2.5 before Animato was added:
- Copy/Paste
- Rearrange channels

Also, the DopeSheet is not totally functional (in terms of displaying animation data for sub-object data yet). That will be added tomorrow.

* Added 'Action Group' pointer to F-Curves, as it will be handy for allowing Bone channels to still remain grouped as they were before with the Action Channels. However, reintroducing such a structure to the data-storage is not anticipated...

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/blenkernel/BKE_ipo.h
    branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
    branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c
    branches/blender2.5/blender/source/blender/editors/animation/anim_draw.c
    branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c
    branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c
    branches/blender2.5/blender/source/blender/editors/animation/keyframes_edit.c
    branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h
    branches/blender2.5/blender/source/blender/editors/include/ED_keyframes_draw.h
    branches/blender2.5/blender/source/blender/editors/include/ED_keyframes_edit.h
    branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c
    branches/blender2.5/blender/source/blender/editors/space_action/action_edit.c
    branches/blender2.5/blender/source/blender/editors/space_action/action_header.c
    branches/blender2.5/blender/source/blender/editors/space_action/action_select.c
    branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
    branches/blender2.5/blender/source/blender/makesdna/DNA_action_types.h
    branches/blender2.5/blender/source/blender/makesdna/DNA_anim_types.h

Modified: branches/blender2.5/blender/source/blender/blenkernel/BKE_ipo.h
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/BKE_ipo.h	2009-01-20 11:03:53 UTC (rev 18583)
+++ branches/blender2.5/blender/source/blender/blenkernel/BKE_ipo.h	2009-01-20 11:07:42 UTC (rev 18584)
@@ -38,9 +38,11 @@
 	
 /* -------- IPO-Curve (Bezier) Calculations ---------- */
 
+// xxx perhaps this should be in curve api not in anim api
 void correct_bezpart(float *v1, float *v2, float *v3, float *v4);
 	
-	
+
+// XXX this file will soon be depreceated...
 #if 0 // XXX old animation system
 
 typedef struct CfraElem {

Modified: branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c	2009-01-20 11:03:53 UTC (rev 18583)
+++ branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c	2009-01-20 11:07:42 UTC (rev 18584)
@@ -1837,6 +1837,9 @@
 		/* rna path */
 		fcu->rna_path= newdataadr(fd, fcu->rna_path);
 		
+		/* group */
+		fcu->grp= newdataadr(fd, fcu->grp);
+		
 		/* driver */
 		fcu->driver= newdataadr(fd, fcu->driver);
 		if (fcu->driver) {
@@ -1917,10 +1920,8 @@
 	direct_link_fcurves(fd, &act->curves);
 	
 	for (agrp = act->groups.first; agrp; agrp= agrp->next) {
-		if (agrp->channels.first) {
-			agrp->channels.first= newdataadr(fd, agrp->channels.first);
-			agrp->channels.last= newdataadr(fd, agrp->channels.last);
-		}
+		agrp->channels.first= newdataadr(fd, agrp->channels.first);
+		agrp->channels.last= newdataadr(fd, agrp->channels.last);
 	}
 }
 

Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c	2009-01-20 11:03:53 UTC (rev 18583)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c	2009-01-20 11:07:42 UTC (rev 18584)
@@ -42,11 +42,11 @@
 #include "BLI_arithb.h"
 
 #include "DNA_listBase.h"
+#include "DNA_anim_types.h"
 #include "DNA_action_types.h"
 #include "DNA_armature_types.h"
 #include "DNA_camera_types.h"
 #include "DNA_curve_types.h"
-#include "DNA_ipo_types.h"
 #include "DNA_object_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_scene_types.h"
@@ -102,24 +102,6 @@
 
 /* -------------------------- Internal Tools -------------------------------- */
 
-/* set the given Action Channel to be the 'active' one in its Action */
-static void action_set_active_achan (bAction *act, bActionChannel *achan)
-{
-	bActionChannel *chan;
-	
-	/* sanity check */
-	if (act == NULL)
-		return;
-	
-	/* clear active flag on all others */
-	for (chan= act->chanbase.first; chan; chan= chan->next)
-		chan->flag &= ~ACHAN_HILIGHTED;
-		
-	/* set the given Action Channel to be the active one */
-	if (achan)
-		achan->flag |= ACHAN_HILIGHTED;
-}
-
 /* set the given Action Group to be the 'active' one in its Action */
 static void action_set_active_agrp (bAction *act, bActionGroup *agrp)
 {
@@ -153,9 +135,6 @@
 		return;
 		
 	switch (channel_type) {
-		case ANIMTYPE_ACHAN:
-			action_set_active_achan((bAction *)data, (bActionChannel *)channel_data);
-			break;
 		case ANIMTYPE_GROUP:
 			action_set_active_agrp((bAction *)data, (bActionGroup *)channel_data);
 			break;
@@ -190,25 +169,17 @@
 						sel= ACHANNEL_SETFLAG_CLEAR;
 					break;
 				case ANIMTYPE_FILLACTD:
-					if (ale->flag & ACTC_SELECTED)
+					if (ale->flag & ACT_SELECTED)
 						sel= ACHANNEL_SETFLAG_CLEAR;
 					break;
 				case ANIMTYPE_GROUP:
 					if (ale->flag & AGRP_SELECTED)
 						sel= ACHANNEL_SETFLAG_CLEAR;
 					break;
-				case ANIMTYPE_ACHAN:
-					if (ale->flag & ACHAN_SELECTED) 
+				case ANIMTYPE_FCURVE:
+					if (ale->flag & FCURVE_SELECTED)
 						sel= ACHANNEL_SETFLAG_CLEAR;
 					break;
-				case ANIMTYPE_CONCHAN:
-					if (ale->flag & CONSTRAINT_CHANNEL_SELECT) 
-						sel= ACHANNEL_SETFLAG_CLEAR;
-					break;
-				case ANIMTYPE_ICU:
-					if (ale->flag & IPO_SELECT)
-						sel= ACHANNEL_SETFLAG_CLEAR;
-					break;
 			}
 		}
 	}
@@ -229,7 +200,7 @@
 			{
 				bAction *act= (bAction *)ale->data;
 				
-				ACHANNEL_SET_FLAG(act, sel, ACTC_SELECTED);
+				ACHANNEL_SET_FLAG(act, sel, ACT_SELECTED);
 			}
 				break;
 			case ANIMTYPE_GROUP:
@@ -240,31 +211,14 @@
 				agrp->flag &= ~AGRP_ACTIVE;
 			}
 				break;
-			case ANIMTYPE_ACHAN:
+			case ANIMTYPE_FCURVE:
 			{
-				bActionChannel *achan= (bActionChannel *)ale->data;
+				FCurve *fcu= (FCurve *)ale->data;
 				
-				ACHANNEL_SET_FLAG(achan, sel, ACHAN_SELECTED);
-				
-				//select_poseelement_by_name(achan->name, sel); // XXX
-				achan->flag &= ~ACHAN_HILIGHTED;
+				ACHANNEL_SET_FLAG(fcu, sel, FCURVE_SELECTED);
+				fcu->flag &= ~FCURVE_ACTIVE;
 			}
 				break;
-			case ANIMTYPE_CONCHAN:
-			{
-				bConstraintChannel *conchan= (bConstraintChannel *)ale->data;
-				
-				ACHANNEL_SET_FLAG(conchan, sel, CONSTRAINT_CHANNEL_SELECT);
-			}
-				break;
-			case ANIMTYPE_ICU:
-			{
-				IpoCurve *icu= (IpoCurve *)ale->data;
-				
-				ACHANNEL_SET_FLAG(icu, sel, IPO_SELECT);
-				icu->flag &= ~IPO_ACTIVE;
-			}
-				break;
 		}
 	}
 	
@@ -278,6 +232,8 @@
 /* ****************** Rearrange Channels Operator ******************* */
 /* This operator only works for Action Editor mode for now, as having it elsewhere makes things difficult */
 
+#if 0 // XXX old animation system - needs to be updated for new system...
+
 /* constants for channel rearranging */
 /* WARNING: don't change exising ones without modifying rearrange func accordingly */
 enum {
@@ -650,6 +606,7 @@
 	RNA_def_enum(ot->srna, "direction", NULL /* XXX add enum for this */, REARRANGE_ACTCHAN_BOTTOM, "Direction", "");
 }
 
+#endif // XXX old animation system - needs to be updated for new system...
 
 /* ********************** Set Flags Operator *********************** */
 
@@ -704,60 +661,16 @@
 				}
 			}
 				break;
-			case ANIMTYPE_ACHAN:
+			case ANIMTYPE_FCURVE:
 			{
-				bActionChannel *achan= (bActionChannel *)ale->data;
+				FCurve *fcu= (FCurve *)ale->data;
 				
-				/* 'protect' and 'mute' */
-				if ((setting == ACHANNEL_SETTING_MUTE) && (achan->ipo)) {
-					Ipo *ipo= achan->ipo;
-					
-					/* mute */
-					if (mode == 0)
-						ipo->muteipo= 0;
-					else if (mode == 1)
-						ipo->muteipo= 1;
-					else if (mode == 2) 
-						ipo->muteipo= (ipo->muteipo) ? 0 : 1;
-				}
-				else if (setting == ACHANNEL_SETTING_PROTECT) {
-					/* protected */
-					ACHANNEL_SET_FLAG(achan, mode, ACHAN_PROTECTED);
-				}
-			}
-				break;
-			case ANIMTYPE_CONCHAN:
-			{
-				bConstraintChannel *conchan= (bConstraintChannel *)ale->data;
-				
-				/* 'protect' and 'mute' */
-				if ((setting == ACHANNEL_SETTING_MUTE) && (conchan->ipo)) {
-					Ipo *ipo= conchan->ipo;
-					
-					/* mute */
-					if (mode == 0)
-						ipo->muteipo= 0;
-					else if (mode == 1)
-						ipo->muteipo= 1;
-					else if (mode == 2) 
-						ipo->muteipo= (ipo->muteipo) ? 0 : 1;
-				}
-				else if (setting == ACHANNEL_SETTING_PROTECT) {
-					/* protect */
-					ACHANNEL_SET_FLAG(conchan, mode, CONSTRAINT_CHANNEL_PROTECTED);
-				}
-			}
-				break;
-			case ANIMTYPE_ICU:
-			{
-				IpoCurve *icu= (IpoCurve *)ale->data;
-				
 				/* mute */
 				if (setting == ACHANNEL_SETTING_MUTE) {
-					ACHANNEL_SET_FLAG(icu, mode, IPO_MUTE);
+					ACHANNEL_SET_FLAG(fcu, mode, FCURVE_MUTED);
 				}
 				else if (setting == ACHANNEL_SETTING_PROTECT) {
-					ACHANNEL_SET_FLAG(icu, mode, IPO_PROTECT);
+					ACHANNEL_SET_FLAG(fcu, mode, FCURVE_PROTECTED);
 				}
 			}
 				break;
@@ -954,30 +867,13 @@
 					agrp->flag &= ~AGRP_ACTIVE;
 				}
 					break;
-				case ANIMTYPE_ACHAN: /* action channel */
-				case ANIMTYPE_FILLIPO: /* expand ipo curves = action channel */
-				case ANIMTYPE_FILLCON: /* expand constraint channels = action channel */
+				case ANIMTYPE_FCURVE: /* F-Curve channel */
 				{
-					bActionChannel *achan= (bActionChannel *)ale->data;
+					FCurve *fcu = (FCurve *)ale->data;
 					
-					ACHANNEL_SET_FLAG(achan, selectmode, ACHAN_SELECTED);
-					achan->flag &= ~ACHAN_HILIGHTED;
+					ACHANNEL_SET_FLAG(fcu, selectmode, FCURVE_SELECTED);
 				}
 					break;
-				case ANIMTYPE_CONCHAN: /* constraint channel */
-				{
-					bConstraintChannel *conchan = (bConstraintChannel *)ale->data;
-					
-					ACHANNEL_SET_FLAG(conchan, selectmode, CONSTRAINT_CHANNEL_SELECT);
-				}
-					break;
-				case ANIMTYPE_ICU: /* ipo-curve channel */
-				{
-					IpoCurve *icu = (IpoCurve *)ale->data;
-					
-					ACHANNEL_SET_FLAG(icu, selectmode, IPO_SELECT);
-				}
-					break;
 				case ANIMTYPE_GPLAYER: /* grease-pencil layer */
 				{
 					bGPDlayer *gpl = (bGPDlayer *)ale->data;
@@ -986,14 +882,6 @@
 				}
 					break;
 			}
-			
-			/* select action-channel 'owner' */
-			if ((ale->owner) && (ale->ownertype == ANIMTYPE_ACHAN)) {
-				bActionChannel *achano= (bActionChannel *)ale->owner;
-				
-				ACHANNEL_SET_FLAG(achano, selectmode, ACHAN_SELECTED);
-				achano->flag &= ~ACHAN_HILIGHTED;
-			}
 		}
 		
 		/* set minimum extent to be the maximum of the next channel */
@@ -1074,7 +962,7 @@
 	
 	/* get the channel that was clicked on */
 		/* filter channels */
-	filter= (ANIMFILTER_FORDRAWING | ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS);
+	filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CHANNELS);
 	filter= ANIM_animdata_filter(&anim_data, filter, ac->data, ac->datatype);
 	
 		/* get channel from index */
@@ -1106,7 +994,7 @@
 			
 			if (x < 16) {
 				/* toggle expand */
-				ob->nlaflag ^= OB_ADS_COLLAPSED;
+				ob->nlaflag ^= OB_ADS_COLLAPSED; // XXX 
 			}
 			else {
 				/* set selection status */
@@ -1134,28 +1022,16 @@
 			}
 		}
 			break;
-		case ANIMTYPE_FILLIPOD:
-		{
-			Object *ob= (Object *)ale->data;
-			ob->nlaflag ^= OB_ADS_SHOWIPO;
-		}
-			break;
 		case ANIMTYPE_FILLACTD:
 		{
 			bAction *act= (bAction *)ale->data;
-			act->flag ^= ACTC_EXPANDED;
+			act->flag ^= ACT_EXPANDED;
 		}
 			break;
-		case ANIMTYPE_FILLCOND:
-		{
-			Object *ob= (Object *)ale->data;
-			ob->nlaflag ^= OB_ADS_SHOWCONS;
-		}
-			break;
 		case ANIMTYPE_FILLMATD:
 		{
 			Object *ob= (Object *)ale->data;
-			ob->nlaflag ^= OB_ADS_SHOWMATS;
+			ob->nlaflag ^= OB_ADS_SHOWMATS;	// XXX 
 		}
 			break;
 				
@@ -1235,152 +1111,59 @@
 			}
 		}
 			break;
-		case ANIMTYPE_ACHAN:
-			{
-				bActionChannel *achan= (bActionChannel *)ale->data;
-				short offset= (ac->datatype == ANIMCONT_DOPESHEET)? 21 : 0;
-				

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list