diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-22 13:38:03 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-11-23 23:19:23 +0300 |
commit | 1e820898ff4dfc734710a6640ca7bafc0bfc69db (patch) | |
tree | 8f68fba82219df0295d89581e49e105ff907ba80 /source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc | |
parent | e49c66efae9d9fb85154ca4b3073ae3733400708 (diff) |
Depsgraph: add a new operation node for computing B-Bone segments.
Computing the shape of a B-Bone is a quite expensive operation, and
there are multiple constraints that can access this information in
a variety of useful ways. This means computing the shape once per
bone and saving it is good for performance.
Since the shape may depend on the position of up to two other bones,
often in a "cyclic" manner, this computation has to be a separate
node with its own dependencies.
Reviewers: sergey
Differential Revision: https://developer.blender.org/D3975
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 | 11 |
1 files changed, 11 insertions, 0 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 eb2ed0e637d..8c349b7067f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -261,7 +261,18 @@ void DepsgraphNodeBuilder::build_rig(Object *object, bool is_object_visible) object_cow, pchan_index), DEG_OPCODE_BONE_DONE); + + /* B-Bone shape computation - the real last step if present. */ + if (pchan->bone != NULL && pchan->bone->segments > 1) { + op_node = add_operation_node(&object->id, DEG_NODE_TYPE_BONE, pchan->name, + function_bind(BKE_pose_eval_bbone_segments, _1, + object_cow, + pchan_index), + DEG_OPCODE_BONE_SEGMENTS); + } + op_node->set_as_exit(); + /* Custom properties. */ if (pchan->prop != NULL) { add_operation_node(&object->id, |