[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26331] trunk/blender/source/blender: DopeSheet and NLA Editor Scrollbar/View Bugs:

Joshua Leung aligorith at gmail.com
Wed Jan 27 12:43:34 CET 2010


Revision: 26331
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26331
Author:   aligorith
Date:     2010-01-27 12:43:34 +0100 (Wed, 27 Jan 2010)

Log Message:
-----------
DopeSheet and NLA Editor Scrollbar/View Bugs:

Fixed some long-standing bugs with DopeSheet and NLA Editor main views not being properly lined up with their channels, and/or showing an incorrect scrollbar. 

This fixes #20759, and probably a few other reports about similar issues that might've cropped up.

NOTE: 
- probably a version bump might be needed after this, to avoid problems on durian animation files?
- the default .b.blend needs updating again, since the saved config there doesn't get updated (or doesn't here, when using load factory settings)

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/space_action/space_action.c
    trunk/blender/source/blender/editors/space_nla/space_nla.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2010-01-27 11:18:55 UTC (rev 26330)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2010-01-27 11:43:34 UTC (rev 26331)
@@ -6226,6 +6226,9 @@
 				SpaceNla *snla= (SpaceNla *)sl;
 				memcpy(&ar->v2d, &snla->v2d, sizeof(View2D));
 				
+				ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
+				ar->v2d.tot.ymax= 0.0f;
+				
 				ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
 				ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
 				ar->v2d.align = V2D_ALIGN_NO_POS_Y;
@@ -6236,7 +6239,7 @@
 			{
 				/* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */
 				ar->v2d.tot.xmin= -20.0f;
-				ar->v2d.tot.ymin= (float)(-sa->winy);
+				ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
 				ar->v2d.tot.xmax= (float)((sa->winx > 120)? (sa->winx) : 120);
 				ar->v2d.tot.ymax= 0.0f;
 				
@@ -6246,7 +6249,7 @@
  				ar->v2d.min[1]= 0.0f;
 				
 				ar->v2d.max[0]= MAXFRAMEF;
- 				ar->v2d.max[1]= 10000.0f;
+ 				ar->v2d.max[1]= FLT_MAX;
 			 	
 				ar->v2d.minzoom= 0.01f;
 				ar->v2d.maxzoom= 50;
@@ -10568,8 +10571,34 @@
 	}
 	
 	/* put 2.50 compatibility code here until next subversion bump */
-	if (1) {
-	
+	{
+		/* fix for bad View2D extents for Animation Editors */
+		bScreen *screen;
+		ScrArea *sa;
+		SpaceLink *sl;
+		
+		for (screen= main->screen.first; screen; screen= screen->id.next) {
+			for (sa= screen->areabase.first; sa; sa= sa->next) {
+				for (sl= sa->spacedata.first; sl; sl= sl->next) {
+					ListBase *regionbase;
+					ARegion *ar;
+					
+					if (sl == sa->spacedata.first)
+						regionbase = &sa->regionbase;
+					else
+						regionbase = &sl->regionbase;
+						
+					if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_NLA)) {
+						for (ar = (ARegion*)regionbase->first; ar; ar = ar->next) {
+							if (ar->regiontype == RGN_TYPE_WINDOW) {
+								ar->v2d.cur.ymax= ar->v2d.tot.ymax= 0.0f;
+								ar->v2d.cur.ymin= ar->v2d.tot.ymin= (float)(-sa->winy) / 3.0f;
+							}
+						}
+					}
+				}
+			}
+		}
 	}
 
 	/* WATCH IT!!!: pointers from libdata have not been converted yet here! */

Modified: trunk/blender/source/blender/editors/space_action/space_action.c
===================================================================
--- trunk/blender/source/blender/editors/space_action/space_action.c	2010-01-27 11:18:55 UTC (rev 26330)
+++ trunk/blender/source/blender/editors/space_action/space_action.c	2010-01-27 11:43:34 UTC (rev 26331)
@@ -103,7 +103,7 @@
 	ar->regiontype= RGN_TYPE_WINDOW;
 	
 	ar->v2d.tot.xmin= -10.0f;
-	ar->v2d.tot.ymin= (float)(-sa->winy);
+	ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
 	ar->v2d.tot.xmax= (float)(sa->winx);
 	ar->v2d.tot.ymax= 0.0f;
 	
@@ -113,7 +113,7 @@
  	ar->v2d.min[1]= 0.0f;
 	
 	ar->v2d.max[0]= MAXFRAMEF;
- 	ar->v2d.max[1]= 10000.0f;
+ 	ar->v2d.max[1]= FLT_MAX;
  	
 	ar->v2d.minzoom= 0.01f;
 	ar->v2d.maxzoom= 50;

Modified: trunk/blender/source/blender/editors/space_nla/space_nla.c
===================================================================
--- trunk/blender/source/blender/editors/space_nla/space_nla.c	2010-01-27 11:18:55 UTC (rev 26330)
+++ trunk/blender/source/blender/editors/space_nla/space_nla.c	2010-01-27 11:43:34 UTC (rev 26331)
@@ -106,6 +106,7 @@
 static SpaceLink *nla_new(const bContext *C)
 {
 	Scene *scene= CTX_data_scene(C);
+	ScrArea *sa= CTX_wm_area(C);
 	ARegion *ar;
 	SpaceNla *snla;
 	
@@ -151,7 +152,7 @@
 	ar->regiontype= RGN_TYPE_WINDOW;
 	
 	ar->v2d.tot.xmin= (float)(SFRA-10);
-	ar->v2d.tot.ymin= -500.0f;
+	ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
 	ar->v2d.tot.xmax= (float)(EFRA+10);
 	ar->v2d.tot.ymax= 0.0f;
 	





More information about the Bf-blender-cvs mailing list