[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18211] branches/blender2.5/blender/source /blender: 2.5 - Assorted bugfixes

Joshua Leung aligorith at gmail.com
Thu Jan 1 09:08:55 CET 2009


Revision: 18211
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18211
Author:   aligorith
Date:     2009-01-01 09:08:55 +0100 (Thu, 01 Jan 2009)

Log Message:
-----------
2.5 - Assorted bugfixes

* Dopesheet - clicking on keyframes in Object channels (if they came from Object-Data such as Lamps, etc.) would crash. I noticed this error in AnimSys2 yesterday

* Action Editor - do versions code now totally reinitialises the Action Editor View2D data (for the timespace), since I found a few files where there appeared to be some weird settings set.

* RNA Browser (Outliner->Datablocks) would crash when the Area was ripped (using Alt-R hotkey) as seen in mfoxdogg's 2.5 Tour 2

Modified Paths:
--------------
    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/keyframes_draw.c
    branches/blender2.5/blender/source/blender/editors/animation/keyframes_edit.c
    branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c
    branches/blender2.5/blender/source/blender/editors/space_action/action_intern.h
    branches/blender2.5/blender/source/blender/editors/space_action/action_select.c
    branches/blender2.5/blender/source/blender/editors/space_action/space_action.c
    branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c

Modified: branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c	2009-01-01 03:40:02 UTC (rev 18210)
+++ branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c	2009-01-01 08:08:55 UTC (rev 18211)
@@ -5266,10 +5266,26 @@
 				SpaceAction *saction= (SpaceAction *)sl;
 				memcpy(&ar->v2d, &saction->v2d, sizeof(View2D));
 				
-				ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
+				ar->v2d.tot.xmin= -10.0f;
+				ar->v2d.tot.ymin= (float)(-sa->winy);
+				ar->v2d.tot.xmax= (float)(sa->winx);
+				ar->v2d.tot.ymax= 0.0f;
+				
+				ar->v2d.cur= ar->v2d.tot;
+				
+				ar->v2d.min[0]= 0.0f;
+ 				ar->v2d.min[1]= 0.0f;
+				
+				ar->v2d.max[0]= MAXFRAMEF;
+ 				ar->v2d.max[1]= 10000.0f;
+			 	
+				ar->v2d.minzoom= 0.01f;
+				ar->v2d.maxzoom= 50;
+				ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
 				ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
-				ar->v2d.align = V2D_ALIGN_NO_POS_Y;
-				ar->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
+				ar->v2d.keepzoom= V2D_LOCKZOOM_Y;
+				ar->v2d.align= V2D_ALIGN_NO_POS_Y;
+				ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
 				//ar->v2d.flag |= V2D_IS_INITIALISED;
 				break;
 			}

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-01 03:40:02 UTC (rev 18210)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c	2009-01-01 08:08:55 UTC (rev 18211)
@@ -84,16 +84,21 @@
 #include "WM_types.h"
 
 /* ************************************************************************** */
-/* Channels API */
+/* CHANNELS API */
 
 /* -------------------------- Internal Tools -------------------------------- */
 
+
+
 /* -------------------------- Exposed API ----------------------------------- */
 
 /* ************************************************************************** */
-/* Operators */
+/* OPERATORS */
 
+/* ********************** Select All Operator *********************** */
 
+
+
 /* ******************** Mouse-Click Operator *********************** */
 /* Depending on the channel that was clicked on, the mouse click will activate whichever
  * part of the channel is relevant.
@@ -117,6 +122,7 @@
 	if (ale == NULL) {
 		/* channel not found */
 		printf("Error: animation channel not found in mouse_anim_channels() \n");
+			// XXX remove me..
 		printf("\t channel index = %d, channels = %d\n", channel_index, filter);
 		
 		BLI_freelistN(&anim_data);
@@ -139,7 +145,7 @@
 				else {
 					/* set selection status */
 					// FIXME: this needs to use the new stuff...
-					if (selectmode) {
+					if (selectmode == SELECT_INVERT) {
 						/* swap select */
 						base->flag ^= SELECT;
 						ob->flag= base->flag;

Modified: branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c	2009-01-01 03:40:02 UTC (rev 18210)
+++ branches/blender2.5/blender/source/blender/editors/animation/keyframes_draw.c	2009-01-01 08:08:55 UTC (rev 18211)
@@ -470,21 +470,21 @@
 			case OB_CAMERA: /* ------- Camera ------------ */
 			{
 				Camera *ca= (Camera *)ob->data;
-				if ((ca->ipo) && !(ads->filterflag & ADS_FILTER_NOCAM))
+				if ((ca->ipo) && !(filterflag & ADS_FILTER_NOCAM))
 					ipo_to_keylist(ca->ipo, keys, blocks, aki);
 			}
 				break;
 			case OB_LAMP: /* ---------- Lamp ----------- */
 			{
 				Lamp *la= (Lamp *)ob->data;
-				if ((la->ipo) && !(ads->filterflag & ADS_FILTER_NOLAM))
+				if ((la->ipo) && !(filterflag & ADS_FILTER_NOLAM))
 					ipo_to_keylist(la->ipo, keys, blocks, aki);
 			}
 				break;
 			case OB_CURVE: /* ------- Curve ---------- */
 			{
 				Curve *cu= (Curve *)ob->data;
-				if ((cu->ipo) && !(ads->filterflag & ADS_FILTER_NOCUR))
+				if ((cu->ipo) && !(filterflag & ADS_FILTER_NOCUR))
 					ipo_to_keylist(cu->ipo, keys, blocks, aki);
 			}
 				break;
@@ -666,9 +666,9 @@
 			 */
 			for (conchan= achan->constraintChannels.first; conchan; conchan= conchan->next) {
 				if (conchan->ipo) {
-					//actstrip_map_ipo_keys(ob, conchan->ipo, 0, 1); // XXX
+					ANIM_nla_mapping_apply(ob, conchan->ipo, 0, 1);
 					ipo_to_keylist(conchan->ipo, keys, blocks, aki);
-					//actstrip_map_ipo_keys(ob, conchan->ipo, 1, 1); // XXX
+					ANIM_nla_mapping_apply(ob, conchan->ipo, 1, 1);
 				}
 			}
 		}

Modified: branches/blender2.5/blender/source/blender/editors/animation/keyframes_edit.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/keyframes_edit.c	2009-01-01 03:40:02 UTC (rev 18210)
+++ branches/blender2.5/blender/source/blender/editors/animation/keyframes_edit.c	2009-01-01 08:08:55 UTC (rev 18211)
@@ -139,6 +139,22 @@
 /* This function is used to apply operation to all keyframes, regardless of the type */
 short animchannel_keys_bezier_loop(BeztEditData *bed, bAnimListElem *ale, BeztEditFunc bezt_ok, BeztEditFunc bezt_cb, IcuEditFunc icu_cb)
 {
+	/* sanity checks */
+	if (ale == NULL)
+		return 0;
+	
+	/* method to use depends on the type of keyframe data */
+	switch (ale->datatype) {
+		case ALE_ICU: /* ipo-curve */
+			return icu_keys_bezier_loop(bed, ale->key_data, bezt_ok, bezt_cb, icu_cb);
+		case ALE_IPO: /* ipo */
+			return ipo_keys_bezier_loop(bed, ale->key_data, bezt_ok, bezt_cb, icu_cb);
+		
+		case ALE_GROUP: /* action group */
+			//return group_keys_bezier_loop(bed, ale->data, bezt_ok, bezt_cb, icu_cb);
+			break;
+	}
+	
 	return 0;
 }
 

Modified: branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c	2009-01-01 03:40:02 UTC (rev 18210)
+++ branches/blender2.5/blender/source/blender/editors/space_action/action_draw.c	2009-01-01 08:08:55 UTC (rev 18211)
@@ -1062,7 +1062,7 @@
 /* ************************************************************************* */
 /* Keyframes */
 
-static ActKeysInc *init_aki_data(bAnimContext *ac, bAnimListElem *ale)
+ActKeysInc *init_aki_data(bAnimContext *ac, bAnimListElem *ale)
 {
 	static ActKeysInc aki;
 	

Modified: branches/blender2.5/blender/source/blender/editors/space_action/action_intern.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_action/action_intern.h	2009-01-01 03:40:02 UTC (rev 18210)
+++ branches/blender2.5/blender/source/blender/editors/space_action/action_intern.h	2009-01-01 08:08:55 UTC (rev 18211)
@@ -34,6 +34,8 @@
 struct ARegion;
 struct wmWindowManager;
 struct wmOperatorType;
+struct ActKeysInc;
+struct bAnimListElem;
 
 /* internal exports only */
 
@@ -42,6 +44,8 @@
 void draw_channel_names(struct bAnimContext *ac, struct SpaceAction *saction, struct ARegion *ar); 
 void draw_channel_strips(struct bAnimContext *ac, struct SpaceAction *saction, struct ARegion *ar);
 
+struct ActKeysInc *init_aki_data(struct bAnimContext *ac, struct bAnimListElem *ale);
+
 /* ***************************************** */
 /* action_header.c */
 void action_header_buttons(const struct bContext *C, struct ARegion *ar);

Modified: branches/blender2.5/blender/source/blender/editors/space_action/action_select.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_action/action_select.c	2009-01-01 03:40:02 UTC (rev 18210)
+++ branches/blender2.5/blender/source/blender/editors/space_action/action_select.c	2009-01-01 08:08:55 UTC (rev 18211)
@@ -133,6 +133,7 @@
 		if (clickmin <= 0) {
 			/* found match - must return here... */
 			Object *nob= ANIM_nla_mapping_get(ac, ale);
+			ActKeysInc *aki= init_aki_data(ac, ale);
 			
 			/* apply NLA-scaling correction? */
 			if (nob) {
@@ -150,32 +151,32 @@
 					case ALE_OB:
 					{
 						Object *ob= (Object *)ale->key_data;
-						ob_to_keylist(ob, &anim_keys, NULL, NULL);
+						ob_to_keylist(ob, &anim_keys, NULL, aki);
 					}
 						break;
 					case ALE_ACT:
 					{
 						bAction *act= (bAction *)ale->key_data;
-						action_to_keylist(act, &anim_keys, NULL, NULL);
+						action_to_keylist(act, &anim_keys, NULL, aki);
 					}
 						break;
 					case ALE_IPO:
 					{
 						Ipo *ipo= (Ipo *)ale->key_data;
-						ipo_to_keylist(ipo, &anim_keys, NULL, NULL);
+						ipo_to_keylist(ipo, &anim_keys, NULL, aki);
 					}
 						break;
 					case ALE_ICU:
 					{
 						IpoCurve *icu= (IpoCurve *)ale->key_data;
-						icu_to_keylist(icu, &anim_keys, NULL, NULL);
+						icu_to_keylist(icu, &anim_keys, NULL, aki);
 					}
 						break;
 				}
 			}
 			else if (ale->type == ANIMTYPE_GROUP) {
 				bActionGroup *agrp= (bActionGroup *)ale->data;
-				agroup_to_keylist(agrp, &anim_keys, NULL, NULL);
+				agroup_to_keylist(agrp, &anim_keys, NULL, aki);
 			}
 			else if (ale->type == ANIMTYPE_GPDATABLOCK) {
 				/* cleanup */
@@ -187,7 +188,7 @@
 			}
 			else if (ale->type == ANIMTYPE_GPLAYER) {
 				bGPDlayer *gpl= (bGPDlayer *)ale->data;
-				gpl_to_keylist(gpl, &anim_keys, NULL, NULL);
+				gpl_to_keylist(gpl, &anim_keys, NULL, aki);
 			}
 			
 			/* loop through keyframes, finding one that was clicked on */
@@ -934,6 +935,8 @@
 			for (conchan=ob->constraintChannels.first; conchan; conchan=conchan->next)
 				ipo_keys_bezier_loop(&bed, conchan->ipo, ok_cb, select_cb, NULL);
 		}
+		
+		// FIXME: add data ipos too...
 	}
 	//else if (gpl)
 	//	select_gpencil_frame(gpl, (int)selx, selectmode);

Modified: branches/blender2.5/blender/source/blender/editors/space_action/space_action.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_action/space_action.c	2009-01-01 03:40:02 UTC (rev 18210)
+++ branches/blender2.5/blender/source/blender/editors/space_action/space_action.c	2009-01-01 08:08:55 UTC (rev 18211)
@@ -100,21 +100,18 @@
 	BLI_addtail(&saction->regionbase, ar);
 	ar->regiontype= RGN_TYPE_WINDOW;
 	
-	ar->v2d.tot.xmin= -2.0f;
+	ar->v2d.tot.xmin= -10.0f;
 	ar->v2d.tot.ymin= (float)(-sa->winy);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list