[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26454] trunk/blender/source/blender: Bugfixes:

Joshua Leung aligorith at gmail.com
Sat Jan 30 22:11:48 CET 2010


Revision: 26454
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26454
Author:   aligorith
Date:     2010-01-30 22:11:46 +0100 (Sat, 30 Jan 2010)

Log Message:
-----------
Bugfixes:
* Old files imported to 2.5 with curves that got cycles FModifiers added during version patching, would not have their keyframes shown for editing. 

* #20893: Can't see/show the Properties area in the NLA
I don't know why this worked on a few of my test files several months ago, and yet now fails for many files today.

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/space_graph/graph_draw.c
    trunk/blender/source/blender/editors/space_graph/graph_utils.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2010-01-30 21:04:51 UTC (rev 26453)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2010-01-30 21:11:46 UTC (rev 26454)
@@ -6073,6 +6073,14 @@
 				ar->alignment= RGN_ALIGN_LEFT;
 				ar->v2d.scroll= V2D_SCROLL_BOTTOM;
 				ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
+				
+					// for some reason, some files still don't get this auto
+				ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+				BLI_addtail(lb, ar);
+				ar->regiontype= RGN_TYPE_UI;
+				ar->alignment= RGN_ALIGN_RIGHT;
+				ar->v2d.scroll= V2D_SCROLL_RIGHT;
+				ar->v2d.flag = RGN_FLAG_HIDDEN;
 				break;
 				
 			case SPACE_NODE:

Modified: trunk/blender/source/blender/editors/space_graph/graph_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_draw.c	2010-01-30 21:04:51 UTC (rev 26453)
+++ trunk/blender/source/blender/editors/space_graph/graph_draw.c	2010-01-30 21:11:46 UTC (rev 26454)
@@ -337,15 +337,18 @@
 
 static int draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu)
 {
-	/* don't draw handle lines if handles are not shown */
-	if (	(sipo->flag & SIPO_NOHANDLES) ||
-			(fcu->flag & FCURVE_PROTECTED) ||
-			(fcu->flag & FCURVE_INT_VALUES) ||
-			((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED))
-			/* || (fcu->totvert <= 1) */
-	) {
+	/* don't draw handle lines if handles are not to be shown */
+	if (	(sipo->flag & SIPO_NOHANDLES) || /* handles shouldn't be shown anywhere */
+			(fcu->flag & FCURVE_PROTECTED) || /* keyframes aren't editable */
+			(fcu->flag & FCURVE_INT_VALUES) || /* editing the handles here will cause weird/incorrect interpolation issues */
+			((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) || /* group that curve belongs to is not editable */
+			(fcu->totvert <= 1) /* do not show handles if there is only 1 keyframe, otherwise they all clump together in an ugly ball */
+		) 
+	{
 		return 0;
-	} else {
+	} 
+	else 
+	{
 		return 1;
 	}
 }
@@ -427,7 +430,7 @@
 		}
 	}
 	
-	glEnd(); // GL_LINES
+	glEnd(); // GL_LINES 
 }
 
 /* Samples ---------------- */
@@ -922,14 +925,14 @@
 				
 				if (fcu->bezt) {
 					int do_handles = draw_fcurve_handles_check(sipo, fcu);
-
-					if(do_handles) {
+					
+					if (do_handles) {
 						/* only draw handles/vertices on keyframes */
 						glEnable(GL_BLEND);
 						draw_fcurve_handles(ac, sipo, ar, fcu);
 						glDisable(GL_BLEND);
 					}
-
+					
 					draw_fcurve_vertices(ac, sipo, ar, fcu, do_handles);
 				}
 				else {

Modified: trunk/blender/source/blender/editors/space_graph/graph_utils.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_utils.c	2010-01-30 21:04:51 UTC (rev 26453)
+++ trunk/blender/source/blender/editors/space_graph/graph_utils.c	2010-01-30 21:11:46 UTC (rev 26454)
@@ -115,12 +115,24 @@
 /* check if any FModifiers to draw controls for  - fcm is 'active' modifier 
  * used for the polling callbacks + also for drawing
  */
+// TODO: restructure these tests
+// TODO: maybe for now, just allow editing always for now...
 short fcurve_needs_draw_fmodifier_controls (FCurve *fcu, FModifier *fcm)
 {
 	/* don't draw if there aren't any modifiers at all */
 	if (fcu->modifiers.first == NULL) 
 		return 0;
 	
+	/* if only one modifier 
+	 *	- don't draw if it is muted or disabled 
+	 *	- set it as the active one if no active one is present 
+	 */
+	if (fcu->modifiers.first == fcu->modifiers.last) {
+		fcm= fcu->modifiers.first;
+		if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) 
+			return 0;
+	}
+	
 	/* if there's an active modifier - don't draw if it doesn't drastically
 	 * alter the curve...
 	 */
@@ -136,13 +148,6 @@
 		}
 	}
 	
-	/* if only one modifier - don't draw if it is muted or disabled */
-	if (fcu->modifiers.first == fcu->modifiers.last) {
-		fcm= fcu->modifiers.first;
-		if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) 
-			return 0;
-	}
-	
 	/* if only active modifier - don't draw if it is muted or disabled */
 	if (fcm) {
 		if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) 





More information about the Bf-blender-cvs mailing list