Merging r39717 through r39983 from trunk into soc-2011-tomato
[blender.git] / source / blender / blenkernel / intern / depsgraph.c
index 0585400..8415d6a 100644 (file)
@@ -2094,6 +2094,23 @@ static short animdata_use_time(AnimData *adt)
                        return 1;
        }
        
+       /* If we have drivers, more likely than not, on a frame change
+        * they'll need updating because their owner changed
+        * 
+        * This is kindof a hack to get around a whole host of problems
+        * involving drivers using non-object datablock data (which the 
+        * depsgraph currently has no way of representing let alone correctly
+        * dependency sort+tagging). By doing this, at least we ensure that 
+        * some commonly attempted drivers (such as scene -> current frame;
+        * see "Driver updates fail" thread on Bf-committers dated July 2)
+        * will work correctly, and that other non-object datablocks will have
+        * their drivers update at least on frame change.
+        *
+        * -- Aligorith, July 4 2011
+        */
+       if (adt->drivers.first)
+               return 1;
+       
        return 0;
 }
 
@@ -2417,7 +2434,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
        if(id) {
                idtype= GS(id->name);
 
-               if(ELEM7(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR)) {
+               if(ELEM8(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR, ID_SPK)) {
                        for(obt=bmain->object.first; obt; obt= obt->id.next) {
                                if(!(ob && obt == ob) && obt->data == id) {
                                        obt->recalc |= OB_RECALC_DATA;