From 6c619b235cb640a350694ec0902ce19c9f9fad0b Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 22 Nov 2005 17:58:10 +0000 Subject: [PATCH] Another bugreport, this time Basse: in NLA a position could sometimes be set whilst the actual time was 1 frame after the strip. Appeared to be a rounding error that didnt show in OSX. Previously I added a threshold, to make sure strips are included when the current frame is exactly on the end. That threshold now is smaller, and I also made the fmod() to be done only on repeating strips. --- source/blender/blenkernel/intern/action.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index a9a369a116f..d5fa6958dff 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -816,7 +816,7 @@ static void do_nla(Object *ob, int blocktype) actlength = strip->actend-strip->actstart; striptime = (G.scene->r.cfra-(strip->start)) / length; stripframe = (G.scene->r.cfra-(strip->start)) ; - + if (striptime>=0.0){ if(blocktype==ID_AR) @@ -870,13 +870,15 @@ static void do_nla(Object *ob, int blocktype) } } } - /* Handle repeat, we add 1 frame extra to make sure the last frame is included */ - else if (striptime < 1.0f + 1.0f/length) { + /* Handle repeat, we add 0.1 frame extra to make sure the last frame is included */ + else if (striptime < 1.0f + 0.1f/length) { /* Mod to repeat */ - striptime*= strip->repeat; - striptime = (float)fmod (striptime, 1.0f + 1.0f/length); - + if(strip->repeat!=1.0f) { + striptime*= strip->repeat; + striptime = (float)fmod (striptime, 1.0f + 0.1f/length); + } + frametime = (striptime * actlength) + strip->actstart; frametime= nla_time(frametime, (float)strip->repeat);