diff options
author | Arno Mayrhofer <azrael3000> | 2019-04-09 00:54:37 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-09 00:54:37 +0300 |
commit | 2a79e34631303edbf1853c5cdf81a04333d094a0 (patch) | |
tree | 6fd7215c1566f2d2b3c04ac7825f709eb54579c0 | |
parent | 7655b32999a0720ea9fcba6610bc9f4fbb56de25 (diff) |
Fix T63326: absolute shape keys inserted from Python in wrong order.
-rw-r--r-- | source/blender/blenkernel/intern/key.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index f85964f76bc..de1c3976b7b 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -1497,7 +1497,9 @@ KeyBlock *BKE_keyblock_add_ctime(Key *key, const char *name, const bool do_force if (!do_force && (key->type != KEY_RELATIVE)) { KeyBlock *it_kb; for (it_kb = key->block.first; it_kb; it_kb = it_kb->next) { - if (it_kb->pos == cpos) { + /* Use epsilon to avoid floating point precision issues. + * 1e-3 because the position is stored as frame * 1e-2. */ + if (compare_ff(it_kb->pos, cpos, 1e-3f)) { return kb; } } |