Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-11-07 17:04:08 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-11-07 17:06:39 +0300
commit7b271d5fc11ada5d5dbd066f0e4523c33933ef51 (patch)
tree83c73fea29ec392656b6b898d09e873d76c3a0cc /source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
parent4610ca599a778a33b958d196a7782cebd5758072 (diff)
Depsgraph: Ensure dependency cycle does not clear runtime memory
If there was a dependency cycle involved, it was possible that pchan array will be freed before all bones are evaluated. Now clear is done in a dedicated node, which is never a part of dependency cycle.
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
index 202b3951417..88e5ca9346c 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
@@ -220,12 +220,17 @@ void DepsgraphNodeBuilder::build_rig(Object *object, bool is_object_visible)
object_cow),
DEG_OPCODE_POSE_INIT_IK);
+ add_operation_node(&object->id,
+ DEG_NODE_TYPE_EVAL_POSE,
+ function_bind(BKE_pose_eval_cleanup,
+ _1,
+ scene_cow,
+ object_cow),
+ DEG_OPCODE_POSE_CLEANUP);
+
op_node = add_operation_node(&object->id,
DEG_NODE_TYPE_EVAL_POSE,
- function_bind(BKE_pose_eval_flush,
- _1,
- scene_cow,
- object_cow),
+ NULL,
DEG_OPCODE_POSE_DONE);
op_node->set_as_exit();
/* Bones. */
@@ -323,7 +328,7 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object)
}
op_node = add_operation_node(&object->id,
DEG_NODE_TYPE_EVAL_POSE,
- function_bind(BKE_pose_eval_proxy_pose_init,
+ function_bind(BKE_pose_eval_proxy_init,
_1,
object_cow),
DEG_OPCODE_POSE_INIT);
@@ -368,9 +373,13 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object)
}
op_node = add_operation_node(&object->id,
DEG_NODE_TYPE_EVAL_POSE,
- function_bind(BKE_pose_eval_proxy_pose_done,
+ function_bind(BKE_pose_eval_proxy_cleanup,
_1,
object_cow),
+ DEG_OPCODE_POSE_CLEANUP);
+ op_node = add_operation_node(&object->id,
+ DEG_NODE_TYPE_EVAL_POSE,
+ NULL,
DEG_OPCODE_POSE_DONE);
op_node->set_as_exit();
}