[Bf-blender-cvs] [dea7ef4] master: Curve pinning: Allow pinning object data without animated object

Sergey Sharybin noreply at git.blender.org
Wed Sep 28 15:25:10 CEST 2016


Commit: dea7ef4dd99b949fa76c53a1b10641c3acce5c08
Author: Sergey Sharybin
Date:   Wed Sep 28 15:18:15 2016 +0200
Branches: master
https://developer.blender.org/rBdea7ef4dd99b949fa76c53a1b10641c3acce5c08

Curve pinning: Allow pinning object data without animated object

Special case, so now we can pin tricky cases like animated camera DOF
without requiring to have animation on the object level.

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

M	source/blender/editors/animation/anim_channels_defines.c
M	source/blender/editors/animation/anim_filter.c

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

diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 93a602b..5e13143 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -390,7 +390,10 @@ static bool acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListElem
 		/* select is ok for most "ds*" channels (e.g. dsmat) */
 		case ACHANNEL_SETTING_SELECT:
 			return true;
-			
+
+		case ACHANNEL_SETTING_ALWAYS_VISIBLE:
+			return true;
+
 		/* other flags are never supported */
 		default:
 			return false;
@@ -1704,7 +1707,10 @@ static int acf_dscam_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Setting
 			
 		case ACHANNEL_SETTING_SELECT: /* selected */
 			return ADT_UI_SELECTED;
-		
+
+		case ACHANNEL_SETTING_ALWAYS_VISIBLE:
+			return ADT_CURVES_ALWAYS_VISIBLE;
+
 		default: /* unsupported */
 			return 0;
 	}
@@ -1725,6 +1731,7 @@ static void *acf_dscam_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings set
 		case ACHANNEL_SETTING_SELECT: /* selected */
 		case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */
 		case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */
+		case ACHANNEL_SETTING_ALWAYS_VISIBLE:
 			if (ca->adt)
 				return GET_ACF_FLAG_PTR(ca->adt->flag, type);
 			return NULL;
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 87c7381..7893f26 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -2834,6 +2834,19 @@ static bool animdata_filter_base_is_ok(bDopeSheet *ads, Scene *scene, Base *base
 		return true;
 	}
 
+	/* Special case.
+	 * We don't do recursive checks for pin, but we need to deal with tricky
+	 * setup like animated camera lens without animated camera location.
+	 * Without such special handle here we wouldn't be able to bin such
+	 * camera data only animation to the editor.
+	 */
+	if (ob->adt == NULL && ob->data != NULL) {
+		AnimData *data_adt = BKE_animdata_from_id(ob->data);
+		if (data_adt != NULL && (data_adt->flag & ADT_CURVES_ALWAYS_VISIBLE)) {
+			return true;
+		}
+	}
+
 	/* check selection and object type filters */
 	if ((ads->filterflag & ADS_FILTER_ONLYSEL) && !((base->flag & SELECT) /*|| (base == sce->basact)*/)) {
 		/* only selected should be shown */




More information about the Bf-blender-cvs mailing list