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.
This commit is contained in:
parent
3ac2028df0
commit
a10b2fefab
Notes:
blender-bot
2023-02-14 08:06:35 +01:00
Referenced by commit 2a63ef03f0
, Fix missing pose bone hash table in stub poses of action constraints.
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue