diff options
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_channels_defines.c | 151 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 5 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_deps.c | 2 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 130 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 4 | ||||
-rw-r--r-- | source/blender/editors/animation/fmodifier_ui.c | 7 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 2 |
7 files changed, 220 insertions, 81 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 86f729502bb..12c0e851f88 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -47,6 +47,7 @@ #include "DNA_key_types.h" #include "DNA_lamp_types.h" #include "DNA_lattice_types.h" +#include "DNA_linestyle_types.h" #include "DNA_mesh_types.h" #include "DNA_material_types.h" #include "DNA_meta_types.h" @@ -84,6 +85,7 @@ /* size of indent steps */ #define INDENT_STEP_SIZE 7 +/* size of string buffers used for animation channel displayed names */ #define ANIM_CHAN_NAME_SIZE 256 /* get the pointer used for some flag */ @@ -292,7 +294,7 @@ static short acf_nodetree_rootType_offset(bNodeTree *ntree) } } - // unknown + /* unknown */ return 0; } @@ -422,7 +424,7 @@ static void acf_summary_name(bAnimListElem *UNUSED(ale), char *name) BLI_strncpy(name, "DopeSheet Summary", ANIM_CHAN_NAME_SIZE); } -// TODO: this is really a temp icon I think +// FIXME: this is really a temp icon I think static int acf_summary_icon(bAnimListElem *UNUSED(ale)) { return ICON_BORDERMOVE; @@ -601,7 +603,6 @@ static int acf_object_icon(bAnimListElem *ale) Object *ob = base->object; /* icon depends on object-type */ - switch (ob->type) { case OB_LAMP: return ICON_OUTLINER_OB_LAMP; @@ -628,7 +629,6 @@ static int acf_object_icon(bAnimListElem *ale) default: return ICON_OBJECT_DATA; } - } /* name for object */ @@ -2011,6 +2011,83 @@ static bAnimChannelType ACF_DSNTREE = acf_dsntree_setting_ptr /* pointer for setting */ }; +/* LineStyle Expander ------------------------------------------- */ + +// TODO: just get this from RNA? +static int acf_dslinestyle_icon(bAnimListElem *ale) +{ + return ICON_BRUSH_DATA; /* FIXME */ +} + +/* get the appropriate flag(s) for the setting when it is valid */ +static int acf_dslinestyle_setting_flag(bAnimContext *ac, int setting, short *neg) +{ + /* clear extra return data first */ + *neg= 0; + + switch (setting) { + case ACHANNEL_SETTING_EXPAND: /* expanded */ + return LS_DS_EXPAND; + + case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */ + return ADT_NLA_EVAL_OFF; + + case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */ + *neg= 1; + return ADT_CURVES_NOT_VISIBLE; + + case ACHANNEL_SETTING_SELECT: /* selected */ + return ADT_UI_SELECTED; + + default: /* unsupported */ + return 0; + } +} + +/* get pointer to the setting */ +static void *acf_dslinestyle_setting_ptr(bAnimListElem *ale, int setting, short *type) +{ + FreestyleLineStyle *linestyle= (FreestyleLineStyle *)ale->data; + + /* clear extra return data first */ + *type= 0; + + switch (setting) { + case ACHANNEL_SETTING_EXPAND: /* expanded */ + return GET_ACF_FLAG_PTR(linestyle->flag, type); + + case ACHANNEL_SETTING_SELECT: /* selected */ + case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */ + case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */ + if (linestyle->adt) + return GET_ACF_FLAG_PTR(linestyle->adt->flag, type); + else + return NULL; + + default: /* unsupported */ + return NULL; + } +} + +/* node tree expander type define */ +static bAnimChannelType ACF_DSLINESTYLE= +{ + "Line Style Expander", /* type name */ + + acf_generic_dataexpand_color, /* backdrop color */ + acf_generic_dataexpand_backdrop,/* backdrop */ + acf_generic_indention_1, /* indent level */ + acf_generic_basic_offset, /* offset */ + + acf_generic_idblock_name, /* name */ + acf_generic_idblock_nameprop, /* name prop */ + acf_dslinestyle_icon, /* icon */ + + acf_generic_dataexpand_setting_valid, /* has setting */ + acf_dslinestyle_setting_flag, /* flag for setting */ + acf_dslinestyle_setting_ptr /* pointer for setting */ +}; + /* Mesh Expander ------------------------------------------- */ // TODO: just get this from RNA? @@ -2178,7 +2255,7 @@ static int acf_dsspk_setting_flag(bAnimContext *UNUSED(ac), int setting, short * { /* clear extra return data first */ *neg = 0; - + switch (setting) { case ACHANNEL_SETTING_EXPAND: /* expanded */ return SPK_DS_EXPAND; @@ -2202,10 +2279,10 @@ static int acf_dsspk_setting_flag(bAnimContext *UNUSED(ac), int setting, short * static void *acf_dsspk_setting_ptr(bAnimListElem *ale, int setting, short *type) { Speaker *spk = (Speaker *)ale->data; - + /* clear extra return data first */ *type = 0; - + switch (setting) { case ACHANNEL_SETTING_EXPAND: /* expanded */ return GET_ACF_FLAG_PTR(spk->flag, type); @@ -2477,7 +2554,7 @@ static int acf_gpl_setting_flag(bAnimContext *UNUSED(ac), int setting, short *ne return GP_LAYER_HIDE; case ACHANNEL_SETTING_PROTECT: /* protected */ - // *neg = 1; - if we change this to edtiability + // *neg = 1; - if we change this to editability return GP_LAYER_LOCKED; default: /* unsupported */ @@ -2526,7 +2603,7 @@ static void acf_mask_color(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale), // TODO: just get this from RNA? static int acf_mask_icon(bAnimListElem *UNUSED(ale)) { - return ICON_GREASEPENCIL; // MASK_TODO - need real icon + return ICON_MOD_MASK; } /* check if some setting exists for this channel */ @@ -2573,15 +2650,15 @@ static void *acf_mask_setting_ptr(bAnimListElem *ale, int UNUSED(setting), short /* mask datablock type define */ static bAnimChannelType ACF_MASKDATA = { - "Mask Datablock", /* type name */ + "Mask Datablock", /* type name */ acf_mask_color, /* backdrop color */ - acf_group_backdrop, /* backdrop */ - acf_generic_indention_0, /* indent level */ - acf_generic_group_offset, /* offset */ + acf_group_backdrop, /* backdrop */ + acf_generic_indention_0, /* indent level */ + acf_generic_group_offset, /* offset */ - acf_generic_idblock_name, /* name */ - acf_generic_idfill_nameprop, /* name prop */ + acf_generic_idblock_name, /* name */ + acf_generic_idfill_nameprop, /* name prop */ acf_mask_icon, /* icon */ acf_mask_setting_valid, /* has setting */ @@ -2642,7 +2719,7 @@ static int acf_masklay_setting_flag(bAnimContext *UNUSED(ac), int setting, short // return GP_LAYER_HIDE; case ACHANNEL_SETTING_PROTECT: /* protected */ - // *neg = 1; - if we change this to edtiability + // *neg = 1; - if we change this to editability return MASK_LAYERFLAG_LOCKED; default: /* unsupported */ @@ -2654,7 +2731,7 @@ static int acf_masklay_setting_flag(bAnimContext *UNUSED(ac), int setting, short static void *acf_masklay_setting_ptr(bAnimListElem *ale, int UNUSED(setting), short *type) { MaskLayer *masklay = (MaskLayer *)ale->data; - + /* all flags are just in agrp->flag for now... */ return GET_ACF_FLAG_PTR(masklay->flag, type); } @@ -2662,20 +2739,20 @@ static void *acf_masklay_setting_ptr(bAnimListElem *ale, int UNUSED(setting), sh /* grease pencil layer type define */ static bAnimChannelType ACF_MASKLAYER = { - "Mask Layer", /* type name */ - + "Mask Layer", /* type name */ + acf_generic_channel_color, /* backdrop color */ acf_generic_channel_backdrop, /* backdrop */ acf_generic_indention_flexible, /* indent level */ acf_generic_group_offset, /* offset */ - - acf_masklay_name, /* name */ - acf_masklay_name_prop, /* name prop */ + + acf_masklay_name, /* name */ + acf_masklay_name_prop, /* name prop */ NULL, /* icon */ - - acf_masklay_setting_valid, /* has setting */ - acf_masklay_setting_flag, /* flag for setting */ - acf_masklay_setting_ptr /* pointer for setting */ + + acf_masklay_setting_valid, /* has setting */ + acf_masklay_setting_flag, /* flag for setting */ + acf_masklay_setting_ptr /* pointer for setting */ }; @@ -2723,6 +2800,7 @@ static void ANIM_init_channel_typeinfo_data(void) animchannelTypeInfo[type++] = &ACF_DSTEX; /* Texture Channel */ animchannelTypeInfo[type++] = &ACF_DSLAT; /* Lattice Channel */ animchannelTypeInfo[type++] = &ACF_DSSPK; /* Speaker Channel */ + animchannelTypeInfo[type++] = &ACF_DSLINESTYLE; /* LineStyle Channel */ animchannelTypeInfo[type++] = &ACF_SHAPEKEY; /* ShapeKey */ @@ -2776,7 +2854,7 @@ void ANIM_channel_debug_print_info(bAnimListElem *ale, short indent_level) acf->name(ale, name); else BLI_strncpy(name, "<No name>", sizeof(name)); - + /* print type name + ui name */ printf("ChanType: <%s> Name: \"%s\"\n", acf->channel_type_name, name); } @@ -2920,7 +2998,6 @@ void ANIM_channel_setting_set(bAnimContext *ac, bAnimListElem *ale, int setting, #define RENAME_TEXT_WIDTH 100 /* Draw the given channel */ -// TODO: make this use UI controls for the buttons void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc) { bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale); @@ -3010,20 +3087,20 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float /* TODO: when renaming, we might not want to draw this, especially if name happens to be longer than channel */ if (acf->name) { char name[ANIM_CHAN_NAME_SIZE]; /* hopefully this will be enough! */ - + /* set text color */ /* XXX: if active, highlight differently? */ if (selected) UI_ThemeColor(TH_TEXT_HI); else UI_ThemeColor(TH_TEXT); - + /* get name */ acf->name(ale, name); - + offset += 3; UI_DrawString(offset, ytext, name); - + /* draw red underline if channel is disabled */ if ((ale->type == ANIMTYPE_FCURVE) && (ale->flag & FCURVE_DISABLED)) { /* FIXME: replace hardcoded color here, and check on extents! */ @@ -3068,7 +3145,7 @@ void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float } /* check if there's enough space for the toggles if the sliders are drawn too */ - if (!(draw_sliders) || (BLI_RCT_SIZE_X(&v2d->mask) > ACHANNEL_BUTTON_WIDTH / 2) ) { + if (!(draw_sliders) || (BLI_rcti_size_x(&v2d->mask) > ACHANNEL_BUTTON_WIDTH / 2) ) { /* protect... */ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) offset += ICON_WIDTH; @@ -3153,7 +3230,6 @@ static void achannel_setting_rename_done_cb(bContext *C, void *ads_poin, void *U ads->renameIndex = 0; /* send notifiers */ - // XXX: right notifier? WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_RENAME, NULL); } @@ -3199,7 +3275,7 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi { Key *key = (Key *)key_poin; KeyBlock *kb = (KeyBlock *)kb_poin; - char *rna_path = key_get_curValue_rnaPath(key, kb); + char *rna_path = BKE_keyblock_curval_rnapath_get(key, kb); ReportList *reports = CTX_wm_reports(C); Scene *scene = CTX_data_scene(C); @@ -3437,7 +3513,6 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale offset = 0; // TODO: when drawing sliders, make those draw instead of these toggles if not enough space - if (v2d) { short draw_sliders = 0; @@ -3460,7 +3535,7 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale } /* check if there's enough space for the toggles if the sliders are drawn too */ - if (!(draw_sliders) || (BLI_RCT_SIZE_X(&v2d->mask) > ACHANNEL_BUTTON_WIDTH / 2) ) { + if (!(draw_sliders) || (BLI_rcti_size_x(&v2d->mask) > ACHANNEL_BUTTON_WIDTH / 2) ) { /* protect... */ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) { offset += ICON_WIDTH; @@ -3507,7 +3582,7 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale KeyBlock *kb = (KeyBlock *)ale->data; Key *key = (Key *)ale->id; - rna_path = key_get_curValue_rnaPath(key, kb); + rna_path = BKE_keyblock_curval_rnapath_get(key, kb); free_path = 1; } diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index d35f39a48e0..ee31276a8c4 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -124,6 +124,7 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f case ANIMTYPE_DSMESH: case ANIMTYPE_DSTEX: case ANIMTYPE_DSLAT: + case ANIMTYPE_DSLINESTYLE: case ANIMTYPE_DSSPK: { /* need to verify that this data is valid for now */ @@ -169,6 +170,7 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f case ANIMTYPE_DSARM: case ANIMTYPE_DSMESH: case ANIMTYPE_DSLAT: + case ANIMTYPE_DSLINESTYLE: case ANIMTYPE_DSSPK: { /* need to verify that this data is valid for now */ @@ -249,6 +251,7 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s case ANIMTYPE_DSNTREE: case ANIMTYPE_DSTEX: case ANIMTYPE_DSLAT: + case ANIMTYPE_DSLINESTYLE: case ANIMTYPE_DSSPK: { if ((ale->adt) && (ale->adt->flag & ADT_UI_SELECTED)) @@ -343,6 +346,7 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s case ANIMTYPE_DSNTREE: case ANIMTYPE_DSTEX: case ANIMTYPE_DSLAT: + case ANIMTYPE_DSLINESTYLE: case ANIMTYPE_DSSPK: { /* need to verify that this data is valid for now */ @@ -2185,6 +2189,7 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in case ANIMTYPE_DSNTREE: case ANIMTYPE_DSTEX: case ANIMTYPE_DSLAT: + case ANIMTYPE_DSLINESTYLE: case ANIMTYPE_DSSPK: { /* sanity checking... */ diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 6ce9fc638be..98071fafc1e 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -142,7 +142,6 @@ static void animchan_sync_group(bAnimContext *ac, bAnimListElem *ale, bActionGro /* check if there are bones, and whether the name matches any * NOTE: this feature will only really work if groups by default contain the F-Curves for a single bone */ - // TODO: if bone gets renamed, it would be best to be able to rename the group if (ob->pose) { bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, agrp->name); bArmature *arm = ob->data; @@ -319,7 +318,6 @@ void ANIM_sync_animchannels_to_data(const bContext *C) FCurve *active_fcurve = NULL; /* get animation context info for filtering the channels */ - // TODO: check on whether we need to set the area specially instead, since active area might not be ok? if (ANIM_animdata_get_context(C, &ac) == 0) return; diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 209414550e3..eb7bc68ff8f 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -55,6 +55,7 @@ #include "DNA_camera_types.h" #include "DNA_lamp_types.h" #include "DNA_lattice_types.h" +#include "DNA_linestyle_types.h" #include "DNA_key_types.h" #include "DNA_mask_types.h" #include "DNA_material_types.h" @@ -99,7 +100,7 @@ /* ----------- Private Stuff - Action Editor ------------- */ /* Get shapekey data being edited (for Action Editor -> ShapeKey mode) */ -/* Note: there's a similar function in key.c (ob_get_key) */ +/* Note: there's a similar function in key.c (BKE_key_from_object) */ static Key *actedit_get_shapekeys(bAnimContext *ac) { Scene *scene = ac->scene; @@ -114,7 +115,7 @@ static Key *actedit_get_shapekeys(bAnimContext *ac) //if (saction->pin) return NULL; /* shapekey data is stored with geometry data */ - key = ob_get_key(ob); + key = BKE_key_from_object(ob); if (key) { if (key->type == KEY_RELATIVE) @@ -163,30 +164,30 @@ static short actedit_get_context(bAnimContext *ac, SpaceAction *saction) ac->mode = saction->mode; return 1; - + case SACTCONT_GPENCIL: /* Grease Pencil */ /* XXX review how this mode is handled... */ /* update scene-pointer (no need to check for pinning yet, as not implemented) */ saction->ads.source = (ID *)ac->scene; - + ac->datatype = ANIMCONT_GPENCIL; ac->data = &saction->ads; - + ac->mode = saction->mode; return 1; - - case SACTCONT_MASK: /* Grease Pencil */ /* XXX review how this mode is handled... */ - /* update scene-pointer (no need to check for pinning yet, as not implemented) */ + + case SACTCONT_MASK: /* Mask */ /* XXX review how this mode is handled... */ { /* TODO, other methods to get the mask */ // Sequence *seq = BKE_sequencer_active_get(ac->scene); //MovieClip *clip = ac->scene->clip; // struct Mask *mask = seq ? seq->mask : NULL; - + + /* update scene-pointer (no need to check for pinning yet, as not implemented) */ saction->ads.source = (ID *)ac->scene; - + ac->datatype = ANIMCONT_MASK; ac->data = &saction->ads; - + ac->mode = saction->mode; return 1; } @@ -688,12 +689,12 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne { Speaker *spk = (Speaker *)data; AnimData *adt = spk->adt; - + ale->flag = FILTER_SPK_OBJD(spk); - + ale->key_data = (adt) ? adt->action : NULL; ale->datatype = ALE_ACT; - + ale->adt = BKE_animdata_from_id(data); } break; @@ -736,6 +737,19 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne ale->adt = BKE_animdata_from_id(data); } break; + case ANIMTYPE_DSLINESTYLE: + { + FreestyleLineStyle *linestyle= (FreestyleLineStyle *)data; + AnimData *adt= linestyle->adt; + + ale->flag= FILTER_LS_SCED(linestyle); + + ale->key_data= (adt) ? adt->action : NULL; + ale->datatype= ALE_ACT; + + ale->adt= BKE_animdata_from_id(data); + } + break; case ANIMTYPE_DSPART: { ParticleSettings *part = (ParticleSettings *)ale->data; @@ -799,7 +813,7 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne /* the corresponding keyframes are from the animdata */ if (ale->adt && ale->adt->action) { bAction *act = ale->adt->action; - char *rna_path = key_get_curValue_rnaPath(key, kb); + char *rna_path = BKE_keyblock_curval_rnapath_get(key, kb); /* try to find the F-Curve which corresponds to this exactly, * then free the MEM_alloc'd string @@ -824,18 +838,18 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne ale->datatype = ALE_GPFRAME; } break; - + case ANIMTYPE_MASKLAYER: { MaskLayer *masklay = (MaskLayer *)data; - + ale->flag = masklay->flag; - + ale->key_data = NULL; ale->datatype = ALE_MASKLAY; } break; - + case ANIMTYPE_NLATRACK: { NlaTrack *nlt = (NlaTrack *)data; @@ -1138,7 +1152,6 @@ static size_t animfilter_action(bAnimContext *ac, ListBase *anim_data, bDopeShee /* don't include anything from this action if it is linked in from another file, * and we're getting stuff for editing... */ - // TODO: need a way of tagging other channels that may also be affected... if ((filter_mode & ANIMFILTER_FOREDIT) && (act->id.lib)) return 0; @@ -1240,11 +1253,11 @@ static size_t animfilter_block_data(bAnimContext *ac, ListBase *anim_data, bDope { AnimData *adt = BKE_animdata_from_id(id); size_t items = 0; - + /* image object datablocks have no anim-data so check for NULL */ if (adt) { IdAdtTemplate *iat = (IdAdtTemplate *)id; - + /* NOTE: this macro is used instead of inlining the logic here, since this sort of filtering is still needed * in a few places in he rest of the code still - notably for the few cases where special mode-based * different types of data expanders are required. @@ -1265,7 +1278,7 @@ static size_t animfilter_block_data(bAnimContext *ac, ListBase *anim_data, bDope } ); } - + return items; } @@ -1283,7 +1296,6 @@ static size_t animdata_filter_shapekey(bAnimContext *ac, ListBase *anim_data, Ke /* loop through the channels adding ShapeKeys as appropriate */ for (kb = key->block.first; kb; kb = kb->next) { /* skip the first one, since that's the non-animatable basis */ - // XXX maybe in future this may become handy? if (kb == key->block.first) continue; /* only work with this channel and its subchannels if it is editable */ @@ -1485,6 +1497,54 @@ static size_t animdata_filter_ds_nodetree(bAnimContext *ac, ListBase *anim_data, return items; } +static size_t animdata_filter_ds_linestyle (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode) +{ + SceneRenderLayer *srl; + size_t items = 0; + + for (srl= sce->r.layers.first; srl; srl= srl->next) { + FreestyleLineSet *lineset; + + /* skip render layers without Freestyle enabled */ + if (!(srl->layflag & SCE_LAY_FRS)) + continue; + + /* loop over linesets defined in the render layer */ + for (lineset= srl->freestyleConfig.linesets.first; lineset; lineset= lineset->next) { + FreestyleLineStyle *linestyle = lineset->linestyle; + ListBase tmp_data = {NULL, NULL}; + size_t tmp_items = 0; + + /* add scene-level animation channels */ + BEGIN_ANIMFILTER_SUBCHANNELS(FILTER_LS_SCED(linestyle)) + { + /* animation data filtering */ + tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)linestyle, filter_mode); + } + END_ANIMFILTER_SUBCHANNELS; + + /* did we find anything? */ + if (tmp_items) { + /* include anim-expand widget first */ + if (filter_mode & ANIMFILTER_LIST_CHANNELS) { + /* check if filtering by active status */ + if ANIMCHANNEL_ACTIVEOK(linestyle) { + ANIMCHANNEL_NEW_CHANNEL(linestyle, ANIMTYPE_DSLINESTYLE, sce); + } + } + + /* now add the list of collected channels */ + BLI_movelisttolist(anim_data, &tmp_data); + BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL)); + items += tmp_items; + } + } + } + + /* return the number of items added to the list */ + return items; +} + /* NOTE: owner_id is either material, lamp, or world block, which is the direct owner of the texture stack in question */ static size_t animdata_filter_ds_textures(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *owner_id, int filter_mode) { @@ -1597,7 +1657,6 @@ static size_t animdata_filter_ds_material(bAnimContext *ac, ListBase *anim_data, /* did we find anything? */ if (tmp_items) { /* include material-expand widget first */ - // hmm... do we need to store the index of this material in the array anywhere? if (filter_mode & ANIMFILTER_LIST_CHANNELS) { /* check if filtering by active status */ if (ANIMCHANNEL_ACTIVEOK(ma)) { @@ -1809,11 +1868,11 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b { Lamp *la = ob->data; bNodeTree *ntree = la->nodetree; - + /* nodetree */ if ((ntree) && !(ads->filterflag & ADS_FILTER_NONTREE)) tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, ads, &la->id, ntree, filter_mode); - + /* textures */ if (!(ads->filterflag & ADS_FILTER_NOTEX)) tmp_items += animdata_filter_ds_textures(ac, &tmp_data, ads, &la->id, filter_mode); @@ -1943,7 +2002,7 @@ static size_t animdata_filter_dopesheet_ob(bAnimContext *ac, ListBase *anim_data /* filter data contained under object first */ BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_OBJC(ob)) { - Key *key = ob_get_key(ob); + Key *key = BKE_key_from_object(ob); /* object-level animation */ if ((ob->adt) && !(ads->filterflag & ADS_FILTER_NOOBJ)) { @@ -2120,6 +2179,11 @@ static size_t animdata_filter_dopesheet_scene(bAnimContext *ac, ListBase *anim_d tmp_items += animdata_filter_ds_nodetree(ac, &tmp_data, ads, (ID *)sce, ntree, filter_mode); } + /* line styles */ + if ((ads->filterflag & ADS_FILTER_NOLINESTYLE) == 0) { + tmp_items += animdata_filter_ds_linestyle(ac, &tmp_data, ads, sce, filter_mode); + } + /* TODO: one day, when sequencer becomes its own datatype, perhaps it should be included here */ } END_ANIMFILTER_SUBCHANNELS; @@ -2277,7 +2341,7 @@ static size_t animdata_filter_animchan(bAnimContext *ac, ListBase *anim_data, bD size_t items = 0; /* data to filter depends on channel type */ - // XXX: only common channel-types have been handled for now + /* NOTE: only common channel-types have been handled for now. More can be added as necessary */ switch (channel->type) { case ANIMTYPE_SUMMARY: items += animdata_filter_dopesheet(ac, anim_data, ads, filter_mode); @@ -2290,6 +2354,10 @@ static size_t animdata_filter_animchan(bAnimContext *ac, ListBase *anim_data, bD case ANIMTYPE_OBJECT: items += animdata_filter_dopesheet_ob(ac, anim_data, ads, channel->data, filter_mode); break; + + default: + printf("ERROR: Unsupported channel type (%d) in animdata_filter_animchan()\n", channel->type); + break; } return items; @@ -2414,9 +2482,9 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo } break; - case ANIMCONT_FCURVES: /* Graph Editor -> FCurves/Animation Editing */ + case ANIMCONT_FCURVES: /* Graph Editor -> F-Curves/Animation Editing */ case ANIMCONT_DRIVERS: /* Graph Editor -> Drivers Editing */ - case ANIMCONT_NLA: /* NLA Editor */ + case ANIMCONT_NLA: /* NLA Editor */ { /* all of these editors use the basic DopeSheet data for filtering options, but don't have all the same features */ items = animdata_filter_dopesheet(ac, anim_data, data, filter_mode); diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 445b684c261..270e7fc8f90 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -354,7 +354,7 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag) xpos = marker->frame; /* no time correction for framelen! space is drawn with old values */ - ypixels = BLI_RCT_SIZE_Y(&v2d->mask); + ypixels = BLI_rcti_size_y(&v2d->mask); UI_view2d_getscale(v2d, &xscale, &yscale); glScalef(1.0f / xscale, 1.0f, 1.0f); @@ -773,7 +773,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) if (hasNumInput(&mm->num)) break; - dx = BLI_RCT_SIZE_X(&v2d->cur) / BLI_RCT_SIZE_X(&v2d->mask); + dx = BLI_rctf_size_x(&v2d->cur) / BLI_rcti_size_x(&v2d->mask); if (evt->x != mm->evtx) { /* XXX maybe init for first time */ int a, offs, totmark = 0; diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index e254fb7a3c4..30e4d8570cb 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -74,13 +74,6 @@ #define B_REDR 1 #define B_FMODIFIER_REDRAW 20 -/* macro for use here to draw background box and set height */ -// XXX for now, roundbox has it's callback func set to NULL to not intercept events -#define DRAW_BACKDROP(height) \ - { \ - uiDefBut(block, ROUNDBOX, B_REDR, "", -3, yco - height, width + 3, height - 1, NULL, 5.0, 0.0, 12.0, (float)rb_col, ""); \ - } (void)0 - /* callback to verify modifier data */ static void validate_fmodifier_cb(bContext *UNUSED(C), void *fcm_v, void *UNUSED(arg)) { diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 5e0459bea90..1791d84d90b 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1836,7 +1836,7 @@ static short object_frame_has_keyframe(Object *ob, float frame, short filter) /* try shapekey keyframes (if available, and allowed by filter) */ if (!(filter & ANIMFILTER_KEYS_LOCAL) && !(filter & ANIMFILTER_KEYS_NOSKEY) ) { - Key *key = ob_get_key(ob); + Key *key = BKE_key_from_object(ob); /* shapekeys can have keyframes ('Relative Shape Keys') * or depend on time (old 'Absolute Shape Keys') |