[Bf-blender-cvs] [a10b2fe] master: Fix for missing pose bone hash in the new dependency graph.

Lukas Tönne noreply at git.blender.org
Mon Apr 25 15:41:13 CEST 2016


Commit: a10b2fefab71f6463a6f83df7c84242af6f2e9ab
Author: Lukas Tönne
Date:   Mon Apr 25 15:38:50 2016 +0200
Branches: master
https://developer.blender.org/rBa10b2fefab71f6463a6f83df7c84242af6f2e9ab

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.

===================================================================

M	source/blender/depsgraph/intern/depsgraph_build_nodes.cc

===================================================================

diff --git a/source/blender/depsgraph/intern/depsgraph_build_nodes.cc b/source/blender/depsgraph/intern/depsgraph_build_nodes.cc
index 0a5235a..80961a6 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,




More information about the Bf-blender-cvs mailing list