From a10b2fefab71f6463a6f83df7c84242af6f2e9ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= Date: Mon, 25 Apr 2016 15:38:50 +0200 Subject: 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. --- source/blender/depsgraph/intern/depsgraph_build_nodes.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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, -- cgit v1.2.3