diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index f36719a1c9c..dfbe17179a4 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -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; } } } diff --git a/source/blender/src/gpencil.c b/source/blender/src/gpencil.c index e51636b6748..9245d2f95f3 100644 --- a/source/blender/src/gpencil.c +++ b/source/blender/src/gpencil.c @@ -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 /* ------ */