Commit with fix for ActionStrip "Hold" missed two crucial features;
authorTon Roosendaal <ton@blender.org>
Wed, 14 Dec 2005 14:10:04 +0000 (14:10 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 14 Dec 2005 14:10:04 +0000 (14:10 +0000)
- if repeat is set on exact integer values, it jumped to first position
- code was missing the action start offset

source/blender/blenkernel/intern/action.c

index 253f9fbf326bdf976a17e2d2d1e8b35182ffedd9..38a07f246dcb4b811b31815a818a0891827df0da 100644 (file)
@@ -910,8 +910,10 @@ static void do_nla(Object *ob, int blocktype)
                                else{
                                        if (strip->flag & ACTSTRIP_HOLDLASTFRAME){
                                                /* we want the strip to hold on the exact fraction of the repeat value */
+                                               
                                                frametime = actlength * (strip->repeat-(int)strip->repeat);
-                                               frametime= bsystem_time(ob, 0, frametime, 0.0);
+                                               if(frametime<=0.000001f) frametime= actlength;  /* rounding errors... */
+                                               frametime= bsystem_time(ob, 0, frametime+strip->actstart, 0.0);
                                                
                                                if(blocktype==ID_AR)
                                                        extract_pose_from_action (tpose, strip->act, frametime);