diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-05-14 21:48:22 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-05-14 21:56:57 +0300 |
commit | 26d2652d6d4287801d56dc8d41b1037750af701a (patch) | |
tree | e6d71dcc75782c28859d06d7eb39d7929c412b7b /source/blender/makesdna | |
parent | 987c6da6c0dd7b4f8c64561c030d4c381f2725c5 (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/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_armature_types.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index 8ae9aa5a041..b18ab503e94 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -104,7 +104,11 @@ typedef struct bArmature { struct AnimData *adt; ListBase bonebase; - ListBase chainbase; + + /** Ghash for quicker lookups of bones by name. */ + struct GHash *bonehash; + void *_pad1; + /** Editbone listbase, we use pointer so we can check state. */ ListBase *edbo; |