Revision: 17145
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17145
Author: aligorith
Date: 2008-10-21 10:30:02 +0200 (Tue, 21 Oct 2008)
Log Message:
-----------
Bugfix:
"Warning: binarysearch_bezt_index encountered invalid array" errors were being
displayed in the console. Was caused by 3d-view show-keyframe for infostring
stuff, when an IPO being checked had no keyframes.
Modified Paths:
--------------
trunk/blender/source/blender/src/keyframing.c
Modified: trunk/blender/source/blender/src/keyframing.c
===================================================================
--- trunk/blender/source/blender/src/keyframing.c 2008-10-21 08:27:38 UTC
(rev 17144)
+++ trunk/blender/source/blender/src/keyframing.c 2008-10-21 08:30:02 UTC
(rev 17145)
@@ -1920,18 +1920,21 @@
* - this assumes that keyframes are only beztriples
*/
for (icu= ipo->curve.first; icu; icu= icu->next) {
- /* we either include all regardless of muting, or only
non-muted */
- if ((filter & ANIMFILTER_MUTED) || (icu->flag & IPO_MUTE)==0) {
- short replace = -1;
- int i = binarysearch_bezt_index(icu->bezt, frame,
icu->totvert, &replace);
-
- /* binarysearch_bezt_index will set replace to be 0 or 1
- * - obviously, 1 represents a match
- */
- if (replace) {
- /* sanity check: 'i' may in rare cases exceed
arraylen */
- if ((i >= 0) && (i < icu->totvert))
- return 1;
+ /* only check if there are keyframes (currently only of type
BezTriple) */
+ if (icu->bezt) {
+ /* we either include all regardless of muting, or only
non-muted */
+ if ((filter & ANIMFILTER_MUTED) || (icu->flag &
IPO_MUTE)==0) {
+ short replace = -1;
+ int i = binarysearch_bezt_index(icu->bezt,
frame, icu->totvert, &replace);
+
+ /* binarysearch_bezt_index will set replace to
be 0 or 1
+ * - obviously, 1 represents a match
+ */
+ if (replace) {
+ /* sanity check: 'i' may in rare cases
exceed arraylen */
+ if ((i >= 0) && (i < icu->totvert))
+ return 1;
+ }
}
}
}
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs