Fix missing pose bone hash table in stub poses of action constraints.

This is a follow-up fix for rBa10b2fe. The Action constraint uses a hackish
stub object and pose, which doesn't have a hash table for fast lookups.
This doesn't seem to be a big issue with the old depsgraph, but in the new
depsgraph it creates a large number of cache misses and significant slowdown,
possibly because of additional threading and less simple bone loops.
This commit is contained in:
Lukas Tönne
2016-04-26 14:11:03 +02:00
parent 5abae51a6e
commit 2a63ef03f0

View File

@@ -1414,6 +1414,12 @@ void what_does_obaction(Object *ob, Object *workob, bPose *pose, bAction *act, c
workob->constraints.last = ob->constraints.last;
workob->pose = pose; /* need to set pose too, since this is used for both types of Action Constraint */
if (pose) {
BKE_pose_channels_hash_make(pose);
if (pose->flag & POSE_CONSTRAINTS_NEED_UPDATE_FLAGS) {
BKE_pose_update_constraint_flags(pose);
}
}
BLI_strncpy(workob->parsubstr, ob->parsubstr, sizeof(workob->parsubstr));
BLI_strncpy(workob->id.name, "OB<ConstrWorkOb>", sizeof(workob->id.name)); /* we don't use real object name, otherwise RNA screws with the real thing */