Bugfixes for: [#28525] [#28690] [#28774] [#28777]
authorJoshua Leung <aligorith@gmail.com>
Sat, 1 Oct 2011 01:27:44 +0000 (01:27 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sat, 1 Oct 2011 01:27:44 +0000 (01:27 +0000)
This commit basically disables the RNA update caches for now, and
introduces a workaround/hack to ensure that modifier properties still
work when animated/driven. The whole way that updates currently get
handled needs reviewing in future.

Fix provided by Brecht.

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

index 5d01db87422b1199ae109a31088a7ab9211a2df9..13abf18e20c1971c692813873c626f0e6099e2db 100644 (file)
@@ -1160,6 +1160,8 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
                                        return 0;
                        }
                        
+                       /* RNA property update disabled for now - [#28525] [#28690] [#28774] [#28777] */
+#if 0
                        /* buffer property update for later flushing */
                        if (RNA_property_update_check(prop)) {
                                short skip_updates_hack = 0;
@@ -1176,6 +1178,7 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i
                                if (skip_updates_hack == 0)
                                        RNA_property_update_cache_add(&new_ptr, prop);
                        }
+#endif
                }
                
                /* successful */
index 6f27a104144e31cc42cf7ba5aba7a8dfb1aa180b..80a40c0a3a3a72cc05804b56c02f43d99ab0e54e 100644 (file)
@@ -2028,17 +2028,27 @@ static int object_modifiers_use_time(Object *ob)
        /* check whether any modifiers are animated */
        if (ob->adt) {
                AnimData *adt = ob->adt;
+               FCurve *fcu;
                
                /* action - check for F-Curves with paths containing 'modifiers[' */
                if (adt->action) {
-                       FCurve *fcu;
-                       
                        for (fcu = adt->action->curves.first; fcu; fcu = fcu->next) {
                                if (fcu->rna_path && strstr(fcu->rna_path, "modifiers["))
                                        return 1;
                        }
                }
                
+               /* This here allows modifier properties to get driven and still update properly
+                *
+                * Workaround to get [#26764] (e.g. subsurf levels not updating when animated/driven)
+                * working, without the updating problems ([#28525] [#28690] [#28774] [#28777]) caused
+                * by the RNA updates cache introduced in r.38649
+                */
+               for (fcu = adt->drivers.first; fcu; fcu = fcu->next) {
+                       if (fcu->rna_path && strstr(fcu->rna_path, "modifiers["))
+                               return 1;
+               }
+               
                // XXX: also, should check NLA strips, though for now assume that nobody uses
                // that and we can omit that for performance reasons...
        }