diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-29 18:40:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-29 18:40:26 +0300 |
commit | 5cd837a562d773cdff155ab05084af590341758d (patch) | |
tree | 20609a23f562cbf8ccf91b41af3f80240551b977 /source/blender/blenkernel/intern/action.c | |
parent | d5cef9a30d1febb22b760eb7d5cdac0fd628bb06 (diff) |
* speedup for animating bones, in one scene with sintel and a dragon animated its over 4x faster.
* utility function BLI_findstring to avoid listbase lookup loops everywhere.
eg:
ListBase *lb= objects= &CTX_data_main(C)->object;
Object *ob= BLI_findstring(lb, name, offsetof(ID, name) + 2);
* made some more math functions use const's, (fix warnings I made in previous commits)
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 303cd208b7c..9e89ae77caa 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -379,19 +379,10 @@ bActionGroup *action_groups_find_named (bAction *act, const char name[]) /* usually used within a loop, so we got a N^2 slowdown */ bPoseChannel *get_pose_channel(const bPose *pose, const char *name) { - bPoseChannel *chan; - if (ELEM(NULL, pose, name) || (name[0] == 0)) return NULL; - for (chan=pose->chanbase.first; chan; chan=chan->next) { - if (chan->name[0] == name[0]) { - if (!strcmp (chan->name, name)) - return chan; - } - } - - return NULL; + return BLI_findstring(&pose->chanbase, name, offsetof(bPoseChannel, name)); } /* Use with care, not on Armature poses but for temporal ones */ |