Revision: 32508
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32508
Author:   aligorith
Date:     2010-10-16 06:14:26 +0200 (Sat, 16 Oct 2010)

Log Message:
-----------
Bugfix #24143: Edit NLA Strips

When editing an action used by a NLA strip and editing it 'in place' 
(controlled by pin icon on green 'tweaking' channel), the animation would only 
get played back in the action's original frame range while the keyframes were 
still displayed in the strip-altered positions. 

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/anim_sys.c

Modified: trunk/blender/source/blender/blenkernel/intern/anim_sys.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/anim_sys.c   2010-10-16 
03:13:40 UTC (rev 32507)
+++ trunk/blender/source/blender/blenkernel/intern/anim_sys.c   2010-10-16 
04:14:26 UTC (rev 32508)
@@ -1607,7 +1607,7 @@
        
        /* 1. get the stack of strips to evaluate at current time (influence 
calculated here) */
        for (nlt=adt->nla_tracks.first; nlt; nlt=nlt->next, track_index++) { 
-               /* if tweaking is on and this strip is the tweaking track, stop 
on this one */
+               /* stop here if tweaking is on and this strip is the tweaking 
track (it will be the first one that's 'disabled')... */
                if ((adt->flag & ADT_NLA_EDIT_ON) && (nlt->flag & 
NLATRACK_DISABLED))
                        break;
                        
@@ -1634,23 +1634,31 @@
         */
        if ((adt->action) && !(adt->flag & ADT_NLA_SOLO_TRACK)) {
                /* if there are strips, evaluate action as per NLA rules */
-               if (has_strips) {
+               if ((has_strips) || (adt->actstrip)) {
                        /* make dummy NLA strip, and add that to the stack */
                        memset(&dummy_strip, 0, sizeof(NlaStrip));
                        dummy_trackslist.first= dummy_trackslist.last= 
&dummy_strip;
                        
-                       dummy_strip.act= adt->action;
-                       dummy_strip.remap= adt->remap;
+                       if ((nlt) && !(adt->flag & ADT_NLA_EDIT_NOMAP)) {
+                               /* edit active action in-place according to its 
active strip, so copy the data  */
+                               memcpy(&dummy_strip, adt->actstrip, 
sizeof(NlaStrip));
+                               dummy_strip.next = dummy_strip.prev = NULL;
+                       }
+                       else {
+                               /* set settings of dummy NLA strip from 
AnimData settings */
+                               dummy_strip.act= adt->action;
+                               dummy_strip.remap= adt->remap;
+                               
+                               /* action range is calculated taking 
F-Modifiers into account (which making new strips doesn't do due to the 
troublesome nature of that) */
+                               calc_action_range(dummy_strip.act, 
&dummy_strip.actstart, &dummy_strip.actend, 1);
+                               dummy_strip.start = dummy_strip.actstart;
+                               dummy_strip.end = (IS_EQ(dummy_strip.actstart, 
dummy_strip.actend)) ?  (dummy_strip.actstart + 1.0f): (dummy_strip.actend);
+                               
+                               dummy_strip.blendmode= adt->act_blendmode;
+                               dummy_strip.extendmode= adt->act_extendmode;
+                               dummy_strip.influence= adt->act_influence;
+                       }
                        
-                       /* action range is calculated taking F-Modifiers into 
account (which making new strips doesn't do due to the troublesome nature of 
that) */
-                       calc_action_range(dummy_strip.act, 
&dummy_strip.actstart, &dummy_strip.actend, 1);
-                       dummy_strip.start = dummy_strip.actstart;
-                       dummy_strip.end = (IS_EQ(dummy_strip.actstart, 
dummy_strip.actend)) ?  (dummy_strip.actstart + 1.0f): (dummy_strip.actend);
-                       
-                       dummy_strip.blendmode= adt->act_blendmode;
-                       dummy_strip.extendmode= adt->act_extendmode;
-                       dummy_strip.influence= adt->act_influence;
-                       
                        /* add this to our list of evaluation strips */
                        nlastrips_ctime_get_strip(&estrips, &dummy_trackslist, 
-1, ctime);
                }


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to