diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2016-04-25 16:38:50 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2016-04-25 16:41:03 +0300 |
commit | a10b2fefab71f6463a6f83df7c84242af6f2e9ab (patch) | |
tree | e281974a0593404a17d51f3779e2aedc0c7fe6fc /source | |
parent | 3ac2028df0c4e6e30135b79537e3f0af8e59382f (diff) |
Fix for missing pose bone hash in the new dependency graph.
The hash table is used to look up bone poses, particularly during constraint
evaluation. Without this the default BLI_findstring method on a plain ListBase
is used, which is really slow for extensive rigs.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_build_nodes.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build_nodes.cc b/source/blender/depsgraph/intern/depsgraph_build_nodes.cc index 0a5235a6d11..80961a687cd 100644 --- a/source/blender/depsgraph/intern/depsgraph_build_nodes.cc +++ b/source/blender/depsgraph/intern/depsgraph_build_nodes.cc @@ -778,6 +778,14 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *ob) } } + /* speed optimization for animation lookups */ + if (ob->pose) { + BKE_pose_channels_hash_make(ob->pose); + if (ob->pose->flag & POSE_CONSTRAINTS_NEED_UPDATE_FLAGS) { + BKE_pose_update_constraint_flags(ob->pose); + } + } + /* Make sure pose is up-to-date with armature updates. */ add_operation_node(&arm->id, DEPSNODE_TYPE_PARAMETERS, @@ -872,6 +880,14 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *ob) ID *obdata = (ID *)ob->data; build_animdata(obdata); + BLI_assert(ob->pose != NULL); + + /* speed optimization for animation lookups */ + BKE_pose_channels_hash_make(ob->pose); + if (ob->pose->flag & POSE_CONSTRAINTS_NEED_UPDATE_FLAGS) { + BKE_pose_update_constraint_flags(ob->pose); + } + add_operation_node(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEPSOP_TYPE_INIT, |