Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2014-06-11 07:48:43 +0400
committerJoshua Leung <aligorith@gmail.com>2014-06-11 07:49:12 +0400
commit6a18b0f6bf4625bb074996f9f4fb588a16b8adad (patch)
tree475d3fcbbe77ae28bbd27ad7ebff6906e72a5733
parentda7bdf1b47d4490c1a6f35740a9392cb9b5dd42e (diff)
Regression Bugfix T40332: Bad driver behaviour on small distances.
!!! ANIMATORS/RIGGERS PLEASE TEST !!! I've reduced the size of the threshold for the keyframe lookup here. This threshold determines the minimum time in frames between keyframes (i.e. "how close" to each other they can get). Making this too small causes problems like T39207, but it seems that the threshold we've been using makes it impossible to get accurate behaviour on driver curves with keyframes, when the driver target only moves 2cm (i.e. 0.02 BU). So far, all of the test cases from T39207 seem to work fine, as well as Caminandes 2 files, and Kenny the Caterpillar. The Kiribati rigs/shots (thanks jpbouza for helping to check on these!) also seem to be fine.
-rw-r--r--source/blender/blenkernel/intern/fcurve.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 65b9d2159df..d7d46427b8c 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -2050,8 +2050,14 @@ static float fcurve_eval_keyframes(FCurve *fcu, BezTriple *bezts, float evaltime
/* evaltime occurs somewhere in the middle of the curve */
bool exact = false;
- /* - use binary search to find appropriate keyframes */
- a = binarysearch_bezt_index_ex(bezts, evaltime, fcu->totvert, 0.001, &exact);
+ /* Use binary search to find appropriate keyframes...
+ *
+ * The threshold here has the following constraints:
+ * - 0.001 is too coarse -> We get artifacts with 2cm driver movements at 1BU = 1m (see T40332)
+ * - 0.00001 is too fine -> Weird errors, like selecting the wrong keyframe range (see T39207), occur.
+ * This lower bound was established in b888a32eee8147b028464336ad2404d8155c64dd
+ */
+ a = binarysearch_bezt_index_ex(bezts, evaltime, fcu->totvert, 0.0001, &exact);
if (G.debug & G_DEBUG) printf("eval fcurve '%s' - %f => %d/%d, %d\n", fcu->rna_path, evaltime, a, fcu->totvert, exact);
if (exact) {