2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2008 Blender Foundation.
19 * All rights reserved.
22 * Contributor(s): Joshua Leung
24 * ***** END GPL LICENSE BLOCK *****
27 /** \file ED_anim_api.h
31 #ifndef __ED_ANIM_API_H__
32 #define __ED_ANIM_API_H__
61 /* ************************************************ */
62 /* ANIMATION CHANNEL FILTERING */
65 /* --------------- Context --------------------- */
67 /* This struct defines a structure used for animation-specific
68 * 'context' information
70 typedef struct bAnimContext {
71 void *data; /* data to be filtered for use in animation editor */
72 short datatype; /* type of data eAnimCont_Types */
74 short mode; /* editor->mode */
75 short spacetype; /* sa->spacetype */
76 short regiontype; /* active region -> type (channels or main) */
77 struct ScrArea *sa; /* editor host */
78 struct SpaceLink *sl; /* editor data */
79 struct ARegion *ar; /* region within editor */
81 struct bDopeSheet *ads; /* dopesheet data for editor (or which is being used) */
83 struct Scene *scene; /* active scene */
84 struct Object *obact; /* active object */
85 ListBase *markers; /* active set of markers */
87 struct ReportList *reports; /* pointer to current reports list */
90 /* Main Data container types */
91 typedef enum eAnimCont_Types {
92 ANIMCONT_NONE = 0, /* invalid or no data */
93 ANIMCONT_ACTION = 1, /* action (bAction) */
94 ANIMCONT_SHAPEKEY = 2, /* shapekey (Key) */
95 ANIMCONT_GPENCIL = 3, /* grease pencil (screen) */
96 ANIMCONT_DOPESHEET = 4, /* dopesheet (bDopesheet) */
97 ANIMCONT_FCURVES = 5, /* animation F-Curves (bDopesheet) */
98 ANIMCONT_DRIVERS = 6, /* drivers (bDopesheet) */
99 ANIMCONT_NLA = 7, /* nla (bDopesheet) */
100 ANIMCONT_CHANNEL = 8, /* animation channel (bAnimListElem) */
101 ANIMCONT_MASK = 9 /* mask dopesheet */
104 /* --------------- Channels -------------------- */
106 /* This struct defines a structure used for quick and uniform access for
107 * channels of animation data
109 typedef struct bAnimListElem {
110 struct bAnimListElem *next, *prev;
112 void *data; /* source data this elem represents */
113 int type; /* one of the ANIMTYPE_* values */
114 int flag; /* copy of elem's flags for quick access */
115 int index; /* for un-named data, the index of the data in it's collection */
117 short datatype; /* type of motion data to expect */
118 void *key_data; /* motion data - mostly F-Curves, but can be other types too */
121 struct ID *id; /* ID block that channel is attached to */
122 struct AnimData *adt; /* source of the animation data attached to ID block (for convenience) */
126 /* Some types for easier type-testing
127 * NOTE: need to keep the order of these synchronized with the channels define code
128 * which is used for drawing and handling channel lists for
130 typedef enum eAnim_ChannelType {
133 ANIMTYPE_SPECIALDATA,
143 ANIMTYPE_FILLDRIVERS,
158 ANIMTYPE_DSLINESTYLE,
163 ANIMTYPE_GPDATABLOCK,
166 ANIMTYPE_MASKDATABLOCK,
172 /* always as last item, the total number of channel types... */
176 /* types of keyframe data in bAnimListElem */
177 typedef enum eAnim_KeyType {
178 ALE_NONE = 0, /* no keyframe data */
179 ALE_FCURVE, /* F-Curve */
180 ALE_GPFRAME, /* Grease Pencil Frames */
181 ALE_MASKLAY, /* Mask */
182 ALE_NLASTRIP, /* NLA Strips */
184 ALE_ALL, /* All channels summary */
185 ALE_SCE, /* Scene summary */
186 ALE_OB, /* Object summary */
187 ALE_ACT, /* Action summary */
188 ALE_GROUP /* Action Group summary */
191 /* ----------------- Filtering -------------------- */
193 /* filtering flags - under what circumstances should a channel be returned */
194 typedef enum eAnimFilter_Flags {
195 /* data which channel represents is fits the dopesheet filters (i.e. scene visibility criteria) */
196 // XXX: it's hard to think of any examples where this *ISN'T* the case... perhaps becomes implicit?
197 ANIMFILTER_DATA_VISIBLE = (1 << 0),
198 /* channel is visible within the channel-list hierarchy (i.e. F-Curves within Groups in ActEdit) */
199 ANIMFILTER_LIST_VISIBLE = (1 << 1),
200 /* channel has specifically been tagged as visible in Graph Editor (* Graph Editor Only) */
201 ANIMFILTER_CURVE_VISIBLE = (1 << 2),
203 /* include summary channels and "expanders" (for drawing/mouse-selection in channel list) */
204 ANIMFILTER_LIST_CHANNELS = (1 << 3),
206 /* for its type, channel should be "active" one */
207 ANIMFILTER_ACTIVE = (1 << 4),
208 /* channel is a child of the active group (* Actions speciality) */
209 ANIMFILTER_ACTGROUPED = (1 << 5),
211 /* channel must be selected/not-selected, but both must not be set together */
212 ANIMFILTER_SEL = (1 << 6),
213 ANIMFILTER_UNSEL = (1 << 7),
215 /* editability status - must be editable to be included */
216 ANIMFILTER_FOREDIT = (1 << 8),
217 /* only selected animchannels should be considerable as editable - mainly for Graph Editor's option for keys on select curves only */
218 ANIMFILTER_SELEDIT = (1 << 9),
220 /* flags used to enforce certain data types */
221 // NOTE: the ones for curves and NLA tracks were redundant and have been removed for now...
222 ANIMFILTER_ANIMDATA = (1 << 10),
224 /* duplicate entries for animation data attached to multi-user blocks must not occur */
225 ANIMFILTER_NODUPLIS = (1 << 11),
227 /* for checking if we should keep some collapsed channel around (internal use only!) */
228 ANIMFILTER_TMP_PEEK = (1 << 30)
231 /* ---------- Flag Checking Macros ------------ */
232 // xxx check on all of these flags again...
235 /* 'Scene' channels */
236 #define SEL_SCEC(sce) (CHECK_TYPE_INLINE(sce, Scene), ((sce->flag & SCE_DS_SELECTED)))
237 #define EXPANDED_SCEC(sce) (CHECK_TYPE_INLINE(sce, Scene), ((sce->flag & SCE_DS_COLLAPSED) == 0))
238 /* 'Sub-Scene' channels (flags stored in Data block) */
239 #define FILTER_WOR_SCED(wo) (CHECK_TYPE_INLINE(wo, World), (wo->flag & WO_DS_EXPAND))
240 #define FILTER_LS_SCED(linestyle) ((linestyle->flag & LS_DS_EXPAND))
241 /* 'Object' channels */
242 #define SEL_OBJC(base) (CHECK_TYPE_INLINE(base, Base), ((base->flag & SELECT)))
243 #define EXPANDED_OBJC(ob) (CHECK_TYPE_INLINE(ob, Object), ((ob->nlaflag & OB_ADS_COLLAPSED) == 0))
244 /* 'Sub-object' channels (flags stored in Data block) */
245 #define FILTER_SKE_OBJD(key) (CHECK_TYPE_INLINE(key, Key), ((key->flag & KEY_DS_EXPAND)))
246 #define FILTER_MAT_OBJD(ma) (CHECK_TYPE_INLINE(ma, Material), ((ma->flag & MA_DS_EXPAND)))
247 #define FILTER_LAM_OBJD(la) (CHECK_TYPE_INLINE(la, Lamp), ((la->flag & LA_DS_EXPAND)))
248 #define FILTER_CAM_OBJD(ca) (CHECK_TYPE_INLINE(ca, Camera), ((ca->flag & CAM_DS_EXPAND)))
249 #define FILTER_CUR_OBJD(cu) (CHECK_TYPE_INLINE(cu, Curve), ((cu->flag & CU_DS_EXPAND)))
250 #define FILTER_PART_OBJD(part) (CHECK_TYPE_INLINE(part, ParticleSettings), ((part->flag & PART_DS_EXPAND)))
251 #define FILTER_MBALL_OBJD(mb) (CHECK_TYPE_INLINE(mb, MetaBall), ((mb->flag2 & MB_DS_EXPAND)))
252 #define FILTER_ARM_OBJD(arm) (CHECK_TYPE_INLINE(arm, bArmature), ((arm->flag & ARM_DS_EXPAND)))
253 #define FILTER_MESH_OBJD(me) (CHECK_TYPE_INLINE(me, Mesh), ((me->flag & ME_DS_EXPAND)))
254 #define FILTER_LATTICE_OBJD(lt) (CHECK_TYPE_INLINE(lt, Lattice), ((lt->flag & LT_DS_EXPAND)))
255 #define FILTER_SPK_OBJD(spk) (CHECK_TYPE_INLINE(spk, Speaker), ((spk->flag & SPK_DS_EXPAND)))
256 /* Variable use expanders */
257 #define FILTER_NTREE_DATA(ntree) (CHECK_TYPE_INLINE(ntree, bNodeTree), ((ntree->flag & NTREE_DS_EXPAND)))
258 #define FILTER_TEX_DATA(tex) (CHECK_TYPE_INLINE(tex, Tex), ((tex->flag & TEX_DS_EXPAND)))
260 /* 'Sub-object/Action' channels (flags stored in Action) */
261 #define SEL_ACTC(actc) ((actc->flag & ACT_SELECTED))
262 #define EXPANDED_ACTC(actc) ((actc->flag & ACT_COLLAPSED) == 0)
263 /* 'Sub-AnimData' channels */
264 #define EXPANDED_DRVD(adt) ((adt->flag & ADT_DRIVERS_COLLAPSED) == 0)
267 /* Actions (also used for Dopesheet) */
268 /* Action Channel Group */
269 #define EDITABLE_AGRP(agrp) ((agrp->flag & AGRP_PROTECTED) == 0)
270 #define EXPANDED_AGRP(ac, agrp) \
271 ( ((!(ac) || ((ac)->spacetype != SPACE_IPO)) && (agrp->flag & AGRP_EXPANDED)) || \
272 (( (ac) && ((ac)->spacetype == SPACE_IPO)) && (agrp->flag & AGRP_EXPANDED_G)) )
273 #define SEL_AGRP(agrp) ((agrp->flag & AGRP_SELECTED) || (agrp->flag & AGRP_ACTIVE))
274 /* F-Curve Channels */
275 #define EDITABLE_FCU(fcu) ((fcu->flag & FCURVE_PROTECTED) == 0)
276 #define SEL_FCU(fcu) (fcu->flag & FCURVE_SELECTED)
278 /* ShapeKey mode only */
279 #define EDITABLE_SHAPEKEY(kb) ((kb->flag & KEYBLOCK_LOCKED) == 0)
280 #define SEL_SHAPEKEY(kb) (kb->flag & KEYBLOCK_SEL)
282 /* Grease Pencil only */
283 /* Grease Pencil datablock settings */
284 #define EXPANDED_GPD(gpd) (gpd->flag & GP_DATA_EXPAND)
285 /* Grease Pencil Layer settings */
286 #define EDITABLE_GPL(gpl) ((gpl->flag & GP_LAYER_LOCKED) == 0)
287 #define SEL_GPL(gpl) (gpl->flag & GP_LAYER_SELECT)
290 /* Grease Pencil datablock settings */
291 #define EXPANDED_MASK(mask) (mask->flag & MASK_ANIMF_EXPAND)
292 /* Grease Pencil Layer settings */
293 #define EDITABLE_MASK(masklay) ((masklay->flag & MASK_LAYERFLAG_LOCKED) == 0)
294 #define SEL_MASKLAY(masklay) (masklay->flag & SELECT)
298 #define SEL_NLT(nlt) (nlt->flag & NLATRACK_SELECTED)
299 #define EDITABLE_NLT(nlt) ((nlt->flag & NLATRACK_PROTECTED) == 0)
302 /* AnimData - NLA mostly... */
303 #define SEL_ANIMDATA(adt) (adt->flag & ADT_UI_SELECTED)
305 /* -------------- Channel Defines -------------- */
307 /* channel heights */
308 #define ACHANNEL_FIRST (-0.8f * U.widget_unit)
309 #define ACHANNEL_HEIGHT (0.8f * U.widget_unit)
310 #define ACHANNEL_HEIGHT_HALF (0.4f * U.widget_unit)
311 #define ACHANNEL_SKIP (0.1f * U.widget_unit)
312 #define ACHANNEL_STEP (ACHANNEL_HEIGHT + ACHANNEL_SKIP)
315 #define ACHANNEL_NAMEWIDTH (10 * U.widget_unit)
317 /* channel toggle-buttons */
318 #define ACHANNEL_BUTTON_WIDTH (0.8f * U.widget_unit)
321 /* -------------- NLA Channel Defines -------------- */
323 /* NLA channel heights */
324 // XXX: NLACHANNEL_FIRST isn't used?
325 #define NLACHANNEL_FIRST (-0.8f * U.widget_unit)
326 #define NLACHANNEL_HEIGHT(snla) ((snla && (snla->flag & SNLA_NOSTRIPCURVES)) ? (0.8f * U.widget_unit) : (1.2f * U.widget_unit))
327 #define NLACHANNEL_HEIGHT_HALF(snla) ((snla && (snla->flag & SNLA_NOSTRIPCURVES)) ? (0.4f * U.widget_unit) : (0.6f * U.widget_unit))
328 #define NLACHANNEL_SKIP (0.1f * U.widget_unit)
329 #define NLACHANNEL_STEP(snla) (NLACHANNEL_HEIGHT(snla) + NLACHANNEL_SKIP)
332 #define NLACHANNEL_NAMEWIDTH (10 * U.widget_unit)
334 /* channel toggle-buttons */
335 #define NLACHANNEL_BUTTON_WIDTH (0.8f * U.widget_unit)
337 /* ---------------- API -------------------- */
339 /* Obtain list of filtered Animation channels to operate on.
340 * Returns the number of channels in the list
342 size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mode, void *data, short datatype);
344 /* Obtain current anim-data context from Blender Context info.
345 * Returns whether the operation was successful.
347 short ANIM_animdata_get_context(const struct bContext *C, bAnimContext *ac);
349 /* Obtain current anim-data context (from Animation Editor) given
350 * that Blender Context info has already been set.
351 * Returns whether the operation was successful.
353 short ANIM_animdata_context_getdata(bAnimContext *ac);
355 /* ************************************************ */
356 /* ANIMATION CHANNELS LIST */
357 /* anim_channels_*.c */
359 /* ------------------------ Drawing TypeInfo -------------------------- */
361 /* flag-setting behavior */
362 typedef enum eAnimChannels_SetFlag {
363 ACHANNEL_SETFLAG_CLEAR = 0, /* turn off */
364 ACHANNEL_SETFLAG_ADD = 1, /* turn on */
365 ACHANNEL_SETFLAG_INVERT = 2, /* on->off, off->on */
366 ACHANNEL_SETFLAG_TOGGLE = 3 /* some on -> all off // all on */
367 } eAnimChannels_SetFlag;
369 /* types of settings for AnimChannels */
370 typedef enum eAnimChannel_Settings {
371 ACHANNEL_SETTING_SELECT = 0,
372 ACHANNEL_SETTING_PROTECT = 1, /* warning: for drawing UI's, need to check if this is off (maybe inverse this later) */
373 ACHANNEL_SETTING_MUTE = 2,
374 ACHANNEL_SETTING_EXPAND = 3,
375 ACHANNEL_SETTING_VISIBLE = 4, /* only for Graph Editor */
376 ACHANNEL_SETTING_SOLO = 5 /* only for NLA Tracks */
377 } eAnimChannel_Settings;
380 /* Drawing, mouse handling, and flag setting behavior... */
381 typedef struct bAnimChannelType {
383 /* name of the channel type, for debugging */
384 const char *channel_type_name;
387 /* get RGB color that is used to draw the majority of the backdrop */
388 void (*get_backdrop_color)(bAnimContext *ac, bAnimListElem *ale, float r_color[3]);
389 /* draw backdrop strip for channel */
390 void (*draw_backdrop)(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc);
391 /* get depth of indention (relative to the depth channel is nested at) */
392 short (*get_indent_level)(bAnimContext *ac, bAnimListElem *ale);
393 /* get offset in pixels for the start of the channel (in addition to the indent depth) */
394 short (*get_offset)(bAnimContext *ac, bAnimListElem *ale);
396 /* get name (for channel lists) */
397 void (*name)(bAnimListElem *ale, char *name);
398 /* get RNA property+pointer for editing the name */
399 short (*name_prop)(bAnimListElem *ale, struct PointerRNA *ptr, struct PropertyRNA **prop);
400 /* get icon (for channel lists) */
401 int (*icon)(bAnimListElem *ale);
404 /* check if the given setting is valid in the current context */
405 short (*has_setting)(bAnimContext *ac, bAnimListElem *ale, int setting);
406 /* get the flag used for this setting */
407 int (*setting_flag)(bAnimContext *ac, int setting, short *neg);
408 /* get the pointer to int/short where data is stored,
409 * with type being sizeof(ptr_data) which should be fine for runtime use...
410 * - assume that setting has been checked to be valid for current context
412 void *(*setting_ptr)(bAnimListElem *ale, int setting, short *type);
415 /* ------------------------ Drawing API -------------------------- */
417 /* Get typeinfo for the given channel */
418 bAnimChannelType *ANIM_channel_get_typeinfo(bAnimListElem *ale);
420 /* Print debugging info about a given channel */
421 void ANIM_channel_debug_print_info(bAnimListElem *ale, short indent_level);
423 /* Draw the given channel */
424 void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc);
425 /* Draw the widgets for the given channel */
426 void ANIM_channel_draw_widgets(struct bContext *C, bAnimContext *ac, bAnimListElem *ale, struct uiBlock *block, float yminc, float ymaxc, size_t channel_index);
429 /* ------------------------ Editing API -------------------------- */
431 /* Check if some setting for a channel is enabled
432 * Returns: 1 = On, 0 = Off, -1 = Invalid
434 * - setting: eAnimChannel_Settings
436 short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting);
438 /* Change value of some setting for a channel
439 * - setting: eAnimChannel_Settings
440 * - mode: eAnimChannels_SetFlag
442 void ANIM_channel_setting_set(bAnimContext *ac, bAnimListElem *ale, int setting, short mode);
445 /* Flush visibility (for Graph Editor) changes up/down hierarchy for changes in the given setting
446 * - anim_data: list of the all the anim channels that can be chosen
447 * -> filtered using ANIMFILTER_CHANNELS only, since if we took VISIBLE too,
448 * then the channels under closed expanders get ignored...
449 * - ale_setting: the anim channel (not in the anim_data list directly, though occurring there)
450 * with the new state of the setting that we want flushed up/down the hierarchy
451 * - setting: type of setting to set
452 * - on: whether the visibility setting has been enabled or disabled
454 void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAnimListElem *ale_setting, int setting, short on);
457 /* Deselect all animation channels */
458 void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, short test, short sel);
460 /* Set the 'active' channel of type channel_type, in the given action */
461 void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int filter, void *channel_data, short channel_type);
464 /* Delete the F-Curve from the given AnimData block (if possible), as appropriate according to animation context */
465 void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, struct AnimData *adt, struct FCurve *fcu);
467 /* ************************************************ */
471 /* Get string representing the given frame number as an appropriately represented frame or timecode */
472 void ANIM_timecode_string_from_frame(char *str, struct Scene *scene, int power, short timecodes, float cfra);
474 /* ---------- Current Frame Drawing ---------------- */
476 /* flags for Current Frame Drawing */
477 enum eAnimEditDraw_CurrentFrame {
478 /* plain time indicator with no special indicators */
480 /* draw box indicating current frame number */
481 DRAWCFRA_SHOW_NUMBOX = (1 << 0),
482 /* time indication in seconds or frames */
483 DRAWCFRA_UNIT_SECONDS = (1 << 1),
484 /* draw indicator extra wide (for timeline) */
485 DRAWCFRA_WIDE = (1 << 2)
488 /* main call to draw current-frame indicator in an Animation Editor */
489 void ANIM_draw_cfra(const struct bContext *C, struct View2D *v2d, short flag);
491 /* ------------- Preview Range Drawing -------------- */
493 /* main call to draw preview range curtains */
494 void ANIM_draw_previewrange(const struct bContext *C, struct View2D *v2d);
496 /* ************************************************* */
497 /* F-MODIFIER TOOLS */
499 /* ------------- UI Panel Drawing -------------- */
501 /* draw a given F-Modifier for some layout/UI-Block */
502 void ANIM_uiTemplate_fmodifier_draw(struct uiLayout *layout, struct ID *id, ListBase *modifiers, struct FModifier *fcm);
504 /* ------------- Copy/Paste Buffer -------------- */
507 /* free the copy/paste buffer */
508 void free_fmodifiers_copybuf(void);
510 /* copy the given F-Modifiers to the buffer, returning whether anything was copied or not
511 * assuming that the buffer has been cleared already with free_fmodifiers_copybuf()
512 * - active: only copy the active modifier
514 short ANIM_fmodifiers_copy_to_buf(ListBase *modifiers, short active);
516 /* 'Paste' the F-Modifier(s) from the buffer to the specified list
517 * - replace: free all the existing modifiers to leave only the pasted ones
519 short ANIM_fmodifiers_paste_from_buf(ListBase *modifiers, short replace);
521 /* ************************************************* */
524 /* ------------ Animation F-Curves <-> Icons/Names Mapping ------------ */
525 /* anim_ipo_utils.c */
527 /* Get icon + name for channel-list displays for F-Curve */
528 int getname_anim_fcurve(char *name, struct ID *id, struct FCurve *fcu);
530 /* Automatically determine a color for the nth F-Curve */
531 void getcolor_fcurve_rainbow(int cur, int tot, float out[3]);
533 /* ----------------- NLA-Mapping ----------------------- */
536 /* Obtain the AnimData block providing NLA-scaling for the given channel if applicable */
537 struct AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale);
539 /* Apply/Unapply NLA mapping to all keyframes in the nominated F-Curve */
540 void ANIM_nla_mapping_apply_fcurve(struct AnimData *adt, struct FCurve *fcu, short restore, short only_keys);
544 /* Perform auto-blending/extend refreshes after some operations */
545 // NOTE: defined in space_nla/nla_edit.c, not in animation/
546 void ED_nla_postop_refresh(bAnimContext *ac);
548 /* ------------- Unit Conversion Mappings ------------- */
551 /* flags for conversion mapping */
552 typedef enum eAnimUnitConv_Flags {
553 /* restore to original internal values */
554 ANIM_UNITCONV_RESTORE = (1 << 0),
555 /* ignore handles (i.e. only touch main keyframes) */
556 ANIM_UNITCONV_ONLYKEYS = (1 << 1),
557 /* only touch selected BezTriples */
558 ANIM_UNITCONV_ONLYSEL = (1 << 2),
559 /* only touch selected vertices */
560 ANIM_UNITCONV_SELVERTS = (1 << 3),
561 ANIM_UNITCONV_SKIPKNOTS = (1 << 4),
562 } eAnimUnitConv_Flags;
564 /* Get unit conversion factor for given ID + F-Curve */
565 float ANIM_unit_mapping_get_factor(struct Scene *scene, struct ID *id, struct FCurve *fcu, short restore);
567 /* Apply/Unapply units conversions to keyframes */
568 void ANIM_unit_mapping_apply_fcurve(struct Scene *scene, struct ID *id, struct FCurve *fcu, short flag);
570 /* ------------- Utility macros ----------------------- */
572 /* provide access to Keyframe Type info in BezTriple
573 * NOTE: this is so that we can change it from being stored in 'hide'
575 #define BEZKEYTYPE(bezt) ((bezt)->hide)
577 /* set/clear/toggle macro
578 * - channel - channel with a 'flag' member that we're setting
579 * - smode - 0=clear, 1=set, 2=invert
580 * - sflag - bitflag to set
582 #define ACHANNEL_SET_FLAG(channel, smode, sflag) \
584 if (smode == ACHANNEL_SETFLAG_INVERT) (channel)->flag ^= (sflag); \
585 else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag |= (sflag); \
586 else (channel)->flag &= ~(sflag); \
589 /* set/clear/toggle macro, where the flag is negative
590 * - channel - channel with a 'flag' member that we're setting
591 * - smode - 0=clear, 1=set, 2=invert
592 * - sflag - bitflag to set
594 #define ACHANNEL_SET_FLAG_NEG(channel, smode, sflag) \
596 if (smode == ACHANNEL_SETFLAG_INVERT) (channel)->flag ^= (sflag); \
597 else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag &= ~(sflag); \
598 else (channel)->flag |= (sflag); \
602 /* --------- anim_deps.c, animation updates -------- */
604 void ANIM_id_update(struct Scene *scene, struct ID *id);
605 void ANIM_list_elem_update(struct Scene *scene, bAnimListElem *ale);
607 /* data -> channels syncing */
608 void ANIM_sync_animchannels_to_data(const struct bContext *C);
610 /* ************************************************* */
613 /* generic animation channels */
614 void ED_operatortypes_animchannels(void);
615 void ED_keymap_animchannels(struct wmKeyConfig *keyconf);
617 /* generic time editing */
618 void ED_operatortypes_anim(void);
619 void ED_keymap_anim(struct wmKeyConfig *keyconf);
622 void ED_operatormacros_graph(void);
624 void ED_operatormacros_action(void);
626 /* ************************************************ */
628 #endif /* __ED_ANIM_API_H__ */