Depsgraph/Python: ensure datablocks with animation data get tagged as being
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 3 Nov 2011 10:03:08 +0000 (10:03 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 3 Nov 2011 10:03:08 +0000 (10:03 +0000)
updated on frame change.

source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/scene.c

index 981c20d61652f27bfa9d09430e58f5081e5f9137..6d94b42a7ac9adab891138987e28199a8a1a450e 100644 (file)
@@ -51,6 +51,7 @@
 
 #include "BKE_animsys.h"
 #include "BKE_action.h"
+#include "BKE_depsgraph.h"
 #include "BKE_fcurve.h"
 #include "BKE_nla.h"
 #include "BKE_global.h"
@@ -1181,6 +1182,15 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
                                        RNA_property_update_cache_add(&new_ptr, prop);
                        }
 #endif
+
+                       /* as long as we don't do property update, we still tag datablock
+                          as having been updated. this flag does not cause any updates to
+                          be run, it's for e.g. render engines to synchronize data */
+                       if(new_ptr.id.data) {
+                               ID *id= new_ptr.id.data;
+                               id->flag |= LIB_ID_RECALC;
+                               DAG_id_type_tag(G.main, GS(id->name));
+                       }
                }
                
                /* successful */
@@ -2322,7 +2332,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime)
        /* particles */
        EVAL_ANIM_IDS(main->particle.first, ADT_RECALC_ANIM);
        
-       /* lamps */
+       /* speakers */
        EVAL_ANIM_IDS(main->speaker.first, ADT_RECALC_ANIM);
 
        /* objects */
index b25120c0fffdb2bdab4aa61ffa654c16121a6718..7ba0a642cdd7fe64f922d58705c7ad48a42724a5 100644 (file)
@@ -1067,6 +1067,8 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
        /* keep this last */
        BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_SCENE_UPDATE_POST);
        BLI_exec_cb(bmain, (ID *)sce, BLI_CB_EVT_FRAME_CHANGE_POST);
+
+       DAG_ids_clear_recalc(bmain);
 }
 
 /* return default layer, also used to patch old files */