Revision: 21000
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21000
Author:   aligorith
Date:     2009-06-19 06:58:40 +0200 (Fri, 19 Jun 2009)

Log Message:
-----------
NLA SoC: Bugfix for Deleting Keyframes

When an F-Curve doesn't contain any keyframes anymore but it still exists, the 
F-Curve's value is not recalculated and flushed anymore if the F-Curve's value 
will not change. That is, if the F-Curve doesn't have any other data, i.e. 
drivers or generator-modifiers, which would still change its value, it wouldn't 
be recalculated to have a value of zero. 

This solves the problem of deleting all scale keyframes, whereby objects/bones 
would appear to 'vanish'

Modified Paths:
--------------
    branches/soc-2009-aligorith/source/blender/blenkernel/BKE_fcurve.h
    branches/soc-2009-aligorith/source/blender/blenkernel/intern/fcurve.c

Modified: branches/soc-2009-aligorith/source/blender/blenkernel/BKE_fcurve.h
===================================================================
--- branches/soc-2009-aligorith/source/blender/blenkernel/BKE_fcurve.h  
2009-06-19 04:45:56 UTC (rev 20999)
+++ branches/soc-2009-aligorith/source/blender/blenkernel/BKE_fcurve.h  
2009-06-19 04:58:40 UTC (rev 21000)
@@ -112,7 +112,7 @@
 struct FModifier *fcurve_find_active_modifier(struct FCurve *fcu);
 void fcurve_set_active_modifier(struct FCurve *fcu, struct FModifier *fcm);
 
-short fcurve_has_suitable_modifier(FCurve *fcu, int mtype, short acttype);
+short fcurve_has_suitable_modifier(struct FCurve *fcu, int mtype, short 
acttype);
 
 float evaluate_time_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float 
cvalue, float evaltime);
 void evaluate_value_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float 
*cvalue, float evaltime);

Modified: branches/soc-2009-aligorith/source/blender/blenkernel/intern/fcurve.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/blenkernel/intern/fcurve.c       
2009-06-19 04:45:56 UTC (rev 20999)
+++ branches/soc-2009-aligorith/source/blender/blenkernel/intern/fcurve.c       
2009-06-19 04:58:40 UTC (rev 21000)
@@ -2415,10 +2415,16 @@
 }
 
 /* Calculate the value of the given F-Curve at the given frame, and set its 
curval */
-// TODO: will this be necessary?
 void calculate_fcurve (FCurve *fcu, float ctime)
 {
-       /* calculate and set curval (evaluates driver too) */
-       fcu->curval= evaluate_fcurve(fcu, ctime);
+       /* only calculate + set curval (overriding the existing value) if curve 
has 
+        * any data which warrants this...
+        */
+       if ( (fcu->totvert) || (fcu->driver && !(fcu->driver->flag & 
DRIVER_FLAG_INVALID)) ||
+                fcurve_has_suitable_modifier(fcu, 0, FMI_TYPE_GENERATE_CURVE) )
+       {
+               /* calculate and set curval (evaluates driver too if necessary) 
*/
+               fcu->curval= evaluate_fcurve(fcu, ctime);
+       }
 }
 


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

Reply via email to