[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16664] trunk/blender/source/blender/src: Bugfix - Long Keyframes:

Joshua Leung aligorith at gmail.com
Mon Sep 22 06:30:21 CEST 2008


Revision: 16664
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16664
Author:   aligorith
Date:     2008-09-22 06:30:21 +0200 (Mon, 22 Sep 2008)

Log Message:
-----------
Bugfix - Long Keyframes:

In a A___B|---|B situation created by duplicating the B keyframe, the long keyframe between the 'B' keyframes was not showing up until the A keyframe was already duplicated. Reverting the 'optimisation' applied there (i.e. searching from last block, as that's where most blocks would be added)


Also removed some unused lines from gpencil.c

Modified Paths:
--------------
    trunk/blender/source/blender/src/drawaction.c
    trunk/blender/source/blender/src/gpencil.c

Modified: trunk/blender/source/blender/src/drawaction.c
===================================================================
--- trunk/blender/source/blender/src/drawaction.c	2008-09-22 04:18:17 UTC (rev 16663)
+++ trunk/blender/source/blender/src/drawaction.c	2008-09-22 04:30:21 UTC (rev 16664)
@@ -1455,8 +1455,11 @@
 	if (IS_EQ(beztn->vec[1][1], beztn->vec[0][1])==0) return;
 	if (IS_EQ(prev->vec[1][1], prev->vec[2][1])==0) return;
 	
-	/* try to find a keyblock that starts on the previous beztriple */
-	for (ab= blocks->last; ab; ab= ab->prev) {
+	/* try to find a keyblock that starts on the previous beztriple 
+	 * Note: we can't search from end to try to optimise this as it causes errors there's
+	 * 		an A ___ B |---| B situation
+	 */
+	for (ab= blocks->first; ab; ab= ab->next) {
 		/* check if alter existing block or add new block */
 		if (ab->start == prev->vec[1][0]) {			
 			/* set selection status and 'touched' status */
@@ -1470,7 +1473,7 @@
 	
 	/* add new block */
 	abn= MEM_callocN(sizeof(ActKeyBlock), "ActKeyBlock");
-	if (ab) BLI_insertlinkafter(blocks, ab, abn);
+	if (ab) BLI_insertlinkbefore(blocks, ab, abn);
 	else BLI_addtail(blocks, abn);
 	
 	abn->start= prev->vec[1][0];
@@ -1768,13 +1771,14 @@
 					ak->modified = 0;
 					ak->totcurve += 1;
 				}
+				
+				if (ak == ak2)
+					break;
+				
 				if (ak2->modified) {
 					ak2->modified = 0;
 					ak2->totcurve += 1;
 				}
-				
-				if (ak == ak2)
-					break;
 			}
 		}
 		if (blocks) {
@@ -1783,13 +1787,14 @@
 					ab->modified = 0;
 					ab->totcurve += 1;
 				}
+				
+				if (ab == ab2)
+					break;
+				
 				if (ab2->modified) {
 					ab2->modified = 0;
 					ab2->totcurve += 1;
 				}
-				
-				if (ab == ab2)
-					break;
 			}
 		}
 	}

Modified: trunk/blender/source/blender/src/gpencil.c
===================================================================
--- trunk/blender/source/blender/src/gpencil.c	2008-09-22 04:18:17 UTC (rev 16663)
+++ trunk/blender/source/blender/src/gpencil.c	2008-09-22 04:30:21 UTC (rev 16664)
@@ -993,10 +993,8 @@
 
 /* Hardcoded sensitivity thresholds... */
 	/* minimum number of pixels mouse should move before new point created */
-//#define MIN_MANHATTEN_PX		3	
 #define MIN_MANHATTEN_PX	U.gp_manhattendist
 	/* minimum length of new segment before new point can be added */
-//#define MIN_EUCLIDEAN_PX		20
 #define MIN_EUCLIDEAN_PX	U.gp_euclideandist
 
 /* ------ */





More information about the Bf-blender-cvs mailing list