Пример #1
0
void ui_but_anim_flag(uiBut *but, float cfra)
{
	AnimData *adt;
	bAction *act;
	FCurve *fcu;
	bool driven;
	bool special;
	
	but->flag &= ~(UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN);
	
	/* NOTE: "special" is reserved for special F-Curves stored on the animation data
	 *        itself (which are used to animate properties of the animation data).
	 *        We count those as "animated" too for now
	 */
	fcu = ui_but_get_fcurve(but, &adt, &act, &driven, &special);
	
	if (fcu) {
		if (!driven) {
			but->flag |= UI_BUT_ANIMATED;
			
			/* T41525 - When the active action is a NLA strip being edited, 
			 * we need to correct the frame number to "look inside" the
			 * remapped action
			 */
			if (adt)
				cfra = BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP);
			
			if (fcurve_frame_has_keyframe(fcu, cfra, 0))
				but->flag |= UI_BUT_ANIMATED_KEY;
		}
		else {
			but->flag |= UI_BUT_DRIVEN;
		}
	}
}
Пример #2
0
void ui_but_anim_flag(uiBut *but, float cfra)
{
	AnimData *adt;
	bAction *act;
	FCurve *fcu;
	bool driven;

	but->flag &= ~(UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN);

	fcu = ui_but_get_fcurve(but, &adt, &act, &driven);

	if (fcu) {
		if (!driven) {
			but->flag |= UI_BUT_ANIMATED;
			
			/* T41525 - When the active action is a NLA strip being edited, 
			 * we need to correct the frame number to "look inside" the
			 * remapped action
			 */
			if (adt)
				cfra = BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP);
			
			if (fcurve_frame_has_keyframe(fcu, cfra, 0))
				but->flag |= UI_BUT_ANIMATED_KEY;
		}
		else {
			but->flag |= UI_BUT_DRIVEN;
		}
	}
}
Пример #3
0
void ui_but_anim_flag(uiBut *but, float cfra)
{
	FCurve *fcu;
	bool driven;

	but->flag &= ~(UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN);

	fcu = ui_but_get_fcurve(but, NULL, &driven);

	if (fcu) {
		if (!driven) {
			but->flag |= UI_BUT_ANIMATED;
			
			if (fcurve_frame_has_keyframe(fcu, cfra, 0))
				but->flag |= UI_BUT_ANIMATED_KEY;
		}
		else {
			but->flag |= UI_BUT_DRIVEN;
		}
	}
}