Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-05-14 21:48:22 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-05-14 21:56:57 +0300
commit26d2652d6d4287801d56dc8d41b1037750af701a (patch)
treee6d71dcc75782c28859d06d7eb39d7929c412b7b /source/blender/editors/armature/armature_utils.c
parent987c6da6c0dd7b4f8c64561c030d4c381f2725c5 (diff)
Armature: implement universal hash table lookup of Bone objects by name.
Since drivers on Bone properties are really supposed to be stored in Armature data and access bones via its bones[] collection, this lookup path should work efficiently. Mass lookup of bones by name was already done through hashes, but they were built temporarily every time that was needed. This simply replaces it with a common hash table computed immediately after file load, copy, or Edit to Object mode switch.
Diffstat (limited to 'source/blender/editors/armature/armature_utils.c')
-rw-r--r--source/blender/editors/armature/armature_utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c
index b23081cd6fa..20dc7b6c826 100644
--- a/source/blender/editors/armature/armature_utils.c
+++ b/source/blender/editors/armature/armature_utils.c
@@ -650,6 +650,7 @@ void ED_armature_from_edit(Main *bmain, bArmature *arm)
Object *obt;
/* armature bones */
+ BKE_armature_bone_hash_free(arm);
BKE_armature_bonelist_free(&arm->bonebase);
arm->act_bone = NULL;
@@ -754,6 +755,8 @@ void ED_armature_from_edit(Main *bmain, bArmature *arm)
/* Finalize definition of restpose data (roll, bone_mat, arm_mat, head/tail...). */
armature_finalize_restpose(&arm->bonebase, arm->edbo);
+ BKE_armature_bone_hash_make(arm);
+
/* so all users of this armature should get rebuilt */
for (obt = bmain->objects.first; obt; obt = obt->id.next) {
if (obt->data == arm) {