Bugfix - Long Keyframes:
authorJoshua Leung <aligorith@gmail.com>
Mon, 22 Sep 2008 04:30:21 +0000 (04:30 +0000)
committerJoshua Leung <aligorith@gmail.com>
Mon, 22 Sep 2008 04:30:21 +0000 (04:30 +0000)
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

source/blender/src/drawaction.c
source/blender/src/gpencil.c

index f36719a1c9ce8c1f1593289d5d6112a613ab5956..dfbe17179a4df87f451196032d9a4d3aee83242b 100644 (file)
@@ -1455,8 +1455,11 @@ static void add_bezt_to_keyblockslist(ListBase *blocks, IpoCurve *icu, int index
        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 @@ static void add_bezt_to_keyblockslist(ListBase *blocks, IpoCurve *icu, int index
        
        /* 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 @@ void icu_to_keylist(IpoCurve *icu, ListBase *keys, ListBase *blocks, ActKeysInc
                                        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 @@ void icu_to_keylist(IpoCurve *icu, ListBase *keys, ListBase *blocks, ActKeysInc
                                        ab->modified = 0;
                                        ab->totcurve += 1;
                                }
+                               
+                               if (ab == ab2)
+                                       break;
+                               
                                if (ab2->modified) {
                                        ab2->modified = 0;
                                        ab2->totcurve += 1;
                                }
-                               
-                               if (ab == ab2)
-                                       break;
                        }
                }
        }
index e51636b6748b8348e145eb089092788033e9cd52..9245d2f95f369b9c4bde944233b8ca67448bce3b 100644 (file)
@@ -993,10 +993,8 @@ void gpencil_convert_menu (void)
 
 /* 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
 
 /* ------ */