Wednesday merger of Orange branch and bf-blender
authorTon Roosendaal <ton@blender.org>
Wed, 14 Dec 2005 14:24:23 +0000 (14:24 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 14 Dec 2005 14:24:23 +0000 (14:24 +0000)
1  2 
source/blender/blenkernel/intern/action.c

index c21a9463767290c9abb61990d2980e69f0357761,38a07f246dcb4b811b31815a818a0891827df0da..d6bca577013e609949527973e40a742e07bb4fad
@@@ -204,7 -204,7 +204,7 @@@ bPoseChannel *verify_pose_channel(bPose
        /* If not, create it and add it */
        chan = MEM_callocN(sizeof(bPoseChannel), "verifyPoseChannel");
        
 -      strcpy (chan->name, name);
 +      strncpy (chan->name, name, 31);
        /* init vars to prevent mat errors */
        chan->quat[0] = 1.0F;
        chan->size[0] = chan->size[1] = chan->size[2] = 1.0F;
@@@ -346,7 -346,7 +346,7 @@@ bActionChannel *verify_action_channel(b
        if(chan==NULL) {
                if (!chan) {
                        chan = MEM_callocN (sizeof(bActionChannel), "actionChannel");
 -                      strcpy (chan->name, name);
 +                      strncpy (chan->name, name, 31);
                        BLI_addtail (&act->chanbase, chan);
                }
        }
@@@ -831,7 -831,7 +831,7 @@@ static void do_nla(Object *ob, int bloc
                        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) 
                                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);
@@@ -996,7 -998,6 +998,7 @@@ void do_all_pose_actions(Object *ob
  void do_all_object_actions(Object *ob)
  {
        if(ob==NULL) return;
 +      if(ob->dup_group) return;       /* prevent conflicts, might add smarter check later */
        
        /* Do local action */
        if(ob->action && ((ob->nlaflag & OB_NLA_OVERRIDE)==0 || ob->nlastrips.first==NULL) ) {