Curve/Nurbs/Font Animation Bugfixes:
authorJoshua Leung <aligorith@gmail.com>
Sun, 27 Dec 2009 23:37:13 +0000 (23:37 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sun, 27 Dec 2009 23:37:13 +0000 (23:37 +0000)
* NURBS and Font animation data now appear in the animation editors.

* Fixed depsgraph tagging code for determining if the AnimData attached to object data blocks (i.e. animation for curve or lamp data) needs to be tagged for updates on frame changes. This means that animating curve settings now works.

source/blender/blenkernel/intern/depsgraph.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframes_edit.c

index 8535bfc6d0c5fe6f051029485100c026b0c42a23..aaaf54b322582f0447b0d4d508d2607eea146657 100644 (file)
@@ -65,6 +65,7 @@
 
 #include "BLI_ghash.h"
 
+#include "BKE_animsys.h"
 #include "BKE_action.h"
 #include "BKE_effect.h"
 #include "BKE_global.h"
@@ -2027,6 +2028,7 @@ static void dag_object_time_update_flags(Object *ob)
        if((ob->pose) && (ob->pose->flag & POSE_CONSTRAINTS_TIMEDEPEND)) ob->recalc |= OB_RECALC_DATA;
        
        {
+               AnimData *adt= BKE_animdata_from_id((ID *)ob->data);
                Mesh *me;
                Curve *cu;
                Lattice *lt;
@@ -2068,6 +2070,11 @@ static void dag_object_time_update_flags(Object *ob)
                                if(ob->transflag & OB_DUPLI) ob->recalc |= OB_RECALC_DATA;
                                break;
                }
+               
+               if(animdata_use_time(adt)) {
+                       ob->recalc |= OB_RECALC_DATA;
+                       adt->recalc |= ADT_RECALC_ANIM;
+               }
 
                if(ob->particlesystem.first) {
                        ParticleSystem *psys= ob->particlesystem.first;
index 0a71f79f13249b935335ffdb9c971305ad7da75f..5398238a43bc319fb285f4a37b667c2a2ed37d7a 100644 (file)
@@ -66,6 +66,7 @@
 
 #include "BKE_animsys.h"
 #include "BKE_action.h"
+#include "BKE_curve.h"
 #include "BKE_depsgraph.h"
 #include "BKE_fcurve.h"
 #include "BKE_key.h"
@@ -1303,7 +1304,17 @@ static bAnimChannelType ACF_DSCAM=
 // TODO: just get this from RNA?
 static int acf_dscur_icon(bAnimListElem *ale)
 {
-       return ICON_CURVE_DATA;
+       Curve *cu= (Curve *)ale->data;
+       short obtype= curve_type(cu);
+       
+       switch (obtype) {
+               case OB_FONT:
+                       return ICON_FONT_DATA;
+               case OB_SURF:
+                       return ICON_SURFACE_DATA;
+               default:
+                       return ICON_CURVE_DATA;
+       }
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
index 89f9511688f1d88ceb890eb75843801457580185..392f435d017ff523360192cf738d41957256a93c 100644 (file)
@@ -1323,6 +1323,8 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad
                }
                        break;
                case OB_CURVE: /* ------- Curve ---------- */
+               case OB_SURF: /* ------- Nurbs Surface ---------- */
+               case OB_FONT: /* ------- Text Curve ---------- */
                {
                        Curve *cu= (Curve *)ob->data;
                        
@@ -1540,6 +1542,8 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
                }
                        break;
                case OB_CURVE: /* ------- Curve ---------- */
+               case OB_SURF: /* ------- Nurbs Surface ---------- */
+               case OB_FONT: /* ------- Text Curve ---------- */
                {
                        Curve *cu= (Curve *)ob->data;
                        
@@ -1962,6 +1966,8 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bAnimContext *ac, bDo
                                        }
                                                break;
                                        case OB_CURVE: /* ------- Curve ---------- */
+                                       case OB_SURF: /* ------- Nurbs Surface ---------- */
+                                       case OB_FONT: /* ------- Text Curve ---------- */
                                        {
                                                Curve *cu= (Curve *)ob->data;
                                                dataOk= 0;
@@ -2082,7 +2088,9 @@ static int animdata_filter_dopesheet (ListBase *anim_data, bAnimContext *ac, bDo
                                                dataOk= ANIMDATA_HAS_KEYS(la);  
                                        }
                                                break;
-                                       case OB_CURVE: /* -------- Curve ---------- */
+                                       case OB_CURVE: /* ------- Curve ---------- */
+                                       case OB_SURF: /* ------- Nurbs Surface ---------- */
+                                       case OB_FONT: /* ------- Text Curve ---------- */
                                        {
                                                Curve *cu= (Curve *)ob->data;
                                                dataOk= ANIMDATA_HAS_KEYS(cu);  
index b19ee5d1dab5150b3484644616a26227503e578b..631cec87c967ad324da20ee3f6166ab93bf296a1 100644 (file)
@@ -797,6 +797,8 @@ void ob_to_keylist(bDopeSheet *ads, Object *ob, DLRBT_Tree *keys, DLRBT_Tree *bl
                }
                        break;
                case OB_CURVE: /* ------- Curve ---------- */
+               case OB_SURF: /* ------- Nurbs Surface ---------- */
+               case OB_FONT: /* ------- Text Curve ---------- */
                {
                        Curve *cu= (Curve *)ob->data;
                        
index 413f01590edb5b4721fbac22693a4d6c80201d73..039041d1efdd69abe7656457839254afc27cb692 100644 (file)
@@ -254,6 +254,8 @@ static short ob_keys_bezier_loop(BeztEditData *bed, Object *ob, BeztEditFunc bez
                }
                        break;
                case OB_CURVE: /* ------- Curve ---------- */
+               case OB_SURF: /* ------- Nurbs Surface ---------- */
+               case OB_FONT: /* ------- Text Curve ---------- */
                {
                        Curve *cu= (Curve *)ob->data;