Commit: 6e6073e13ccf7965bb36c2b4d3349ca967bc505e
Author: Campbell Barton
Date: Fri Jul 8 00:49:44 2016 +1000
Branches: master
https://developer.blender.org/rB6e6073e13ccf7965bb36c2b4d3349ca967bc505e
Skip the ID part of object names when comparing
Also no need to calloc arrays which are immediately filled
===================================================================
M source/blender/editors/animation/anim_filter.c
===================================================================
diff --git a/source/blender/editors/animation/anim_filter.c
b/source/blender/editors/animation/anim_filter.c
index a4d5fef..88d96c5 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -2788,10 +2788,10 @@ static bool animdata_filter_base_is_ok(bDopeSheet *ads,
Scene *scene, Base *base
/* Helper for animdata_filter_ds_sorted_bases() - Comparison callback for two
Base pointers... */
static int ds_base_sorting_cmp(const void *base1_ptr, const void *base2_ptr)
{
- const Base *b1 = *((Base **)base1_ptr);
- const Base *b2 = *((Base **)base2_ptr);
+ const Base *b1 = *((const Base **)base1_ptr);
+ const Base *b2 = *((const Base **)base2_ptr);
- return strcmp(b1->object->id.name, b2->object->id.name);
+ return strcmp(b1->object->id.name + 2, b2->object->id.name + 2);
}
/* Get a sorted list of all the bases - for inclusion in dopesheet (when
drawing channels) */
@@ -2801,7 +2801,7 @@ static Base **animdata_filter_ds_sorted_bases(bDopeSheet
*ads, Scene *scene, int
size_t tot_bases = BLI_listbase_count(&scene->base);
size_t num_bases = 0;
- Base **sorted_bases = MEM_callocN(sizeof(Base *) * tot_bases,
"Dopesheet Usable Sorted Bases");
+ Base **sorted_bases = MEM_mallocN(sizeof(Base *) * tot_bases,
"Dopesheet Usable Sorted Bases");
for (Base *base = scene->base.first; base; base = base->next) {
if (animdata_filter_base_is_ok(ads, scene, base, filter_mode)) {
sorted_bases[num_bases++] = base;
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs