From 4dc639ac9965f3d0e8b2304363c62d888cdd1dc9 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 20 Nov 2018 15:42:37 +0100 Subject: Speedup rigs with multiple objects deformed by bbones Previously each of the objects which has armature modifier will request deformation matricies from bbones. Thing is, all those deformations are the same and do not depend on object which is being modified. What's even worse is that this calculation is not cheap. This change makes it so bbones deformation is calculated once and stored in the armature object. After this armature modifiers simply use it. With a rigs we've got here dependency graph evaluation time goes down from 0.02 sec to 0.012 sec. Possible further optimization is to make bbone deformation calculated at the time when bone is calculated. This will avoid an extra threaded loop over all bones. --- source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/depsgraph') 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 88e5ca9346c..eb2ed0e637d 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -230,7 +230,9 @@ void DepsgraphNodeBuilder::build_rig(Object *object, bool is_object_visible) op_node = add_operation_node(&object->id, DEG_NODE_TYPE_EVAL_POSE, - NULL, + function_bind(BKE_pose_eval_done, + _1, + object_cow), DEG_OPCODE_POSE_DONE); op_node->set_as_exit(); /* Bones. */ @@ -379,7 +381,9 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object) DEG_OPCODE_POSE_CLEANUP); op_node = add_operation_node(&object->id, DEG_NODE_TYPE_EVAL_POSE, - NULL, + function_bind(BKE_pose_eval_proxy_done, + _1, + object_cow), DEG_OPCODE_POSE_DONE); op_node->set_as_exit(); } -- cgit v1.2.3