Fix T63326: absolute shape keys inserted from Python in wrong order.

This commit is contained in:
Arno Mayrhofer 2019-04-08 23:54:37 +02:00 committed by Brecht Van Lommel
parent 7655b32999
commit 2a79e34631
Notes: blender-bot 2023-02-14 06:25:25 +01:00
Referenced by issue #63997, Weird z-fight during weight paint
Referenced by issue #63443, tool 'builtin_brush.draw' not found for space 'IMAGE_EDITOR'
Referenced by issue #63435, Incorrect fresnel and normals for hair strands on EEVEE
Referenced by issue #63326, Shape key 008 has wrong frame time when created from python script
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}
}