diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-20 17:42:37 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-20 17:53:59 +0300 |
commit | 4dc639ac9965f3d0e8b2304363c62d888cdd1dc9 (patch) | |
tree | f0272c9c70e5095dbabf5bce59d07cd8492f1b74 /source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc | |
parent | 163be42a9661741757325039909ba81f0701b248 (diff) |
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.
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.cc | 8 |
1 files changed, 6 insertions, 2 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 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(); } |