Depsgraph: Make data allocation dependency more robust
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 7 Dec 2018 10:17:34 +0000 (11:17 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 7 Dec 2018 10:37:44 +0000 (11:37 +0100)
This fix aims to fix crash/assert failure related on wrong
evaluation order which happens when there is a cyclic
dependency involved.

The rationality of this change is that we can allow use
of uninitialized scalar value, but memory is better be
allocated.

This might not be ideal still, but worth a try.

source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc

index 8003fd5d313478ca7850eef9a9910e2eeb1ab84d..ef021c098241a1ef0e37b2c014e877790829fa2a 100644 (file)
@@ -518,7 +518,8 @@ void DepsgraphRelationBuilder::build_rig(Object *object)
                        /* Pose requires the B-Bone shape. */
                        add_relation(bone_segments_key,
                                     pose_done_key,
-                                    "PoseEval Result-Bone Link");
+                                    "PoseEval Result-Bone Link",
+                                                DEPSREL_FLAG_GODMODE);
                        add_relation(bone_segments_key,
                                     pose_cleanup_key,
                                     "Cleanup dependency");
@@ -575,7 +576,10 @@ void DepsgraphRelationBuilder::build_proxy_rig(Object *object)
                add_relation(bone_ready_key, bone_done_key, "Ready -> Done");
                add_relation(
                        bone_done_key, pose_cleanup_key, "Bone Done -> Pose Cleanup");
-               add_relation(bone_done_key, pose_done_key, "Bone Done -> Pose Done");
+               add_relation(bone_done_key,
+                           pose_done_key,
+                           "Bone Done -> Pose Done",
+                           DEPSREL_FLAG_GODMODE);
 
                /* Make sure bone in the proxy is not done before it's FROM is done. */
                if (pchan->bone && pchan->bone->segments > 1) {
@@ -585,7 +589,8 @@ void DepsgraphRelationBuilder::build_proxy_rig(Object *object)
                                                            DEG_OPCODE_BONE_SEGMENTS);
                        add_relation(from_bone_segments_key,
                                     bone_done_key,
-                                    "Bone Segments -> Bone Done");
+                                    "Bone Segments -> Bone Done",
+                                    DEPSREL_FLAG_GODMODE);
                }
                else {
                        add_relation(from_bone_done_key,