Use original base to see whether it can be ignored from evaluation
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 1 Mar 2019 15:35:11 +0000 (16:35 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 1 Mar 2019 15:35:11 +0000 (16:35 +0100)
Object of evaluated base is not yet copied, so we can not know whether
it has animation on visibility or not.

This issue was reported in T56635#630383.

source/blender/depsgraph/intern/builder/deg_builder.cc
source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc

index 3365cdd..9fe64fd 100644 (file)
@@ -113,7 +113,7 @@ DepsgraphBuilder::DepsgraphBuilder(Main *bmain, Depsgraph *graph)
           graph_(graph) {
 }
 
-bool DepsgraphBuilder::need_pull_base_into_graph(struct Base *base)
+bool DepsgraphBuilder::need_pull_base_into_graph(Base *base)
 {
        return deg_check_base_available_for_build(graph_, base);
 }
index dab403a..a494894 100644 (file)
@@ -373,9 +373,15 @@ void view_layer_remove_disabled_bases(const Depsgraph *depsgraph,
                 *
                 * NOTE: The idea of using id's tag and check whether its copied ot not
                 * is not reliable, since object might be indirectly linked into the
-                * graph. */
+                * graph.
+                *
+                * NOTE: We are using original base since the object which evaluated base
+                * points to is not yet copied. This is dangerous access from evaluated
+                * domain to original one, but this is how the entire copy-on-write works:
+                * it does need to access original for an initial copy.
+                * */
                const bool is_object_enabled =
-                       deg_check_base_available_for_build(depsgraph, base);
+                       deg_check_base_available_for_build(depsgraph, base->base_orig);
                if (is_object_enabled) {
                        BLI_addtail(&enabled_bases, base);
                }