[Bf-blender-cvs] [f89b0f6] alembic_basic_io: Merge branch 'master' into alembic_basic_io

Kévin Dietrich noreply at git.blender.org
Fri Jul 8 05:57:31 CEST 2016


Commit: f89b0f6e94919407a30b6ed173f1a2ff040da449
Author: Kévin Dietrich
Date:   Fri Jul 8 02:31:40 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rBf89b0f6e94919407a30b6ed173f1a2ff040da449

Merge branch 'master' into alembic_basic_io

Conflicts:
	source/blender/blenkernel/intern/anim_sys.c

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



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

diff --cc source/blender/blenkernel/intern/anim_sys.c
index 8b7681c,10e7b01..d6b369b
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@@ -101,10 -97,7 +97,8 @@@ bool id_type_can_have_animdata(const sh
  		case ID_MC:
  		case ID_MSK:
  		case ID_GD:
 +		case ID_CF:
- 		{
  			return true;
- 		}
  		
  		/* no AnimData */
  		default:
diff --cc source/blender/editors/animation/anim_filter.c
index 58a90af,88d96c5..5cd305f
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@@ -2788,63 -2839,46 +2899,52 @@@ static size_t animdata_filter_dopesheet
  		filter_mode |= ANIMFILTER_SELEDIT;
  	}
  	
 +	/* Cache files level animations (frame duration and such). */
 +	CacheFile *cache_file = G.main->cachefiles.first;
 +	for (; cache_file; cache_file = cache_file->id.next) {
 +		items += animdata_filter_ds_cachefile(ac, anim_data, ads, cache_file, filter_mode);
 +	}
 +
  	/* scene-linked animation - e.g. world, compositing nodes, scene anim (including sequencer currently) */
- 	items += animdata_filter_dopesheet_scene(ac, anim_data, ads, sce, filter_mode);
- 	
- 	/* loop over all bases (i.e.objects) in the scene */
- 	for (base = sce->base.first; base; base = base->next) {
- 		/* check if there's an object (all the relevant checks are done in the ob-function) */
- 		if (base->object) {
- 			Object *ob = base->object;
- 			
- 			/* firstly, check if object can be included, by the following factors:
- 			 *	- if only visible, must check for layer and also viewport visibility
- 			 *		--> while tools may demand only visible, user setting takes priority
- 			 *			as user option controls whether sets of channels get included while
- 			 *			tool-flag takes into account collapsed/open channels too
- 			 *	- if only selected, must check if object is selected 
- 			 *	- there must be animation data to edit (this is done recursively as we 
- 			 *	  try to add the channels)
- 			 */
- 			if ((filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) {
- 				/* layer visibility - we check both object and base, since these may not be in sync yet */
- 				if ((sce->lay & (ob->lay | base->lay)) == 0) continue;
- 				
- 				/* outliner restrict-flag */
- 				if (ob->restrictflag & OB_RESTRICT_VIEW) continue;
- 			}
- 			
- 			/* if only F-Curves with visible flags set can be shown, check that 
- 			 * datablock hasn't been set to invisible 
- 			 */
- 			if (filter_mode & ANIMFILTER_CURVE_VISIBLE) {
- 				if ((ob->adt) && (ob->adt->flag & ADT_CURVES_NOT_VISIBLE))
- 					continue;
+ 	items += animdata_filter_dopesheet_scene(ac, anim_data, ads, scene, filter_mode);
+ 	
+ 	/* If filtering for channel drawing, we want the objects in alphabetical order,
+ 	 * to make it easier to predict where items are in the hierarchy
+ 	 *  - This order only really matters if we need to show all channels in the list (e.g. for drawing)
+ 	 *    (XXX: What about lingering "active" flags? The order may now become unpredictable)
+ 	 *  - Don't do this if this behaviour has been turned off (i.e. due to it being too slow)
+ 	 *  - Don't do this if there's just a single object
+ 	 */
+ 	if ((filter_mode & ANIMFILTER_LIST_CHANNELS) && !(ads->flag & ADS_FLAG_NO_DB_SORT) &&
+ 	    (scene->base.first != scene->base.last))
+ 	{
+ 		/* Filter list of bases (i.e. objects), sort them, then add their contents normally... */
+ 		// TODO: Cache the old sorted order - if the set of bases hasn't changed, don't re-sort...
+ 		Base **sorted_bases;
+ 		size_t num_bases;
+ 		
+ 		sorted_bases = animdata_filter_ds_sorted_bases(ads, scene, filter_mode, &num_bases);
+ 		if (sorted_bases) {
+ 			/* Add the necessary channels for these bases... */
+ 			for (size_t i = 0; i < num_bases; i++) {
+ 				items += animdata_filter_dopesheet_ob(ac, anim_data, ads, sorted_bases[i], filter_mode);
  			}
  			
- 			/* check selection and object type filters */
- 			if ( (ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & SELECT) /*|| (base == sce->basact)*/) ) {
- 				/* only selected should be shown */
- 				continue;
- 			}
+ 			// TODO: store something to validate whether any changes are needed?
  			
- 			/* check if object belongs to the filtering group if option to filter 
- 			 * objects by the grouped status is on
- 			 *	- used to ease the process of doing multiple-character choreographies
- 			 */
- 			if (ads->filterflag & ADS_FILTER_ONLYOBGROUP) {
- 				if (BKE_group_object_exists(ads->filter_grp, ob) == 0)
- 					continue;
+ 			/* free temporary data */
+ 			MEM_freeN(sorted_bases);
+ 		}
+ 	}
+ 	else {
+ 		/* Filter and add contents of each base (i.e. object) without them sorting first
+ 		 * NOTE: This saves performance in cases where order doesn't matter
+ 		 */
+ 		for (Base *base = scene->base.first; base; base = base->next) {
+ 			if (animdata_filter_base_is_ok(ads, scene, base, filter_mode)) {
+ 				/* since we're still here, this object should be usable */
+ 				items += animdata_filter_dopesheet_ob(ac, anim_data, ads, base, filter_mode);
  			}
- 				
- 			/* since we're still here, this object should be usable */
- 			items += animdata_filter_dopesheet_ob(ac, anim_data, ads, base, filter_mode);
  		}
  	}




More information about the Bf-blender-cvs mailing list