diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-10-15 11:05:03 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-10-15 11:05:03 +0300 |
commit | fcff9843384ff72a9549cfb301bdbd418aa12d1b (patch) | |
tree | 0bf3ce1a7544072710230e219c16fd3a471c4b22 /source/blender/editors | |
parent | 9632ca0a13b415a83572378862a44047e0a362e0 (diff) | |
parent | 7fec7eee2070aac701f7918311a05ca2bfd1b3b0 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/anim_channels_defines.c | 79 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 5 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 63 | ||||
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 3 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 2 | ||||
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 2 |
8 files changed, 156 insertions, 5 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 27e806bc98b..de6a17e9d41 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -2624,6 +2624,84 @@ static bAnimChannelType ACF_DSGPENCIL = acf_dsgpencil_setting_ptr /* pointer for setting */ }; +/* World Expander ------------------------------------------- */ + +// TODO: just get this from RNA? +static int acf_dsmclip_icon(bAnimListElem *UNUSED(ale)) +{ + return ICON_SEQUENCE; +} + +/* get the appropriate flag(s) for the setting when it is valid */ +static int acf_dsmclip_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Settings setting, bool *neg) +{ + /* clear extra return data first */ + *neg = false; + + switch (setting) { + case ACHANNEL_SETTING_EXPAND: /* expanded */ + return MCLIP_DATA_EXPAND; + + case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */ + return ADT_NLA_EVAL_OFF; + + case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */ + *neg = true; + 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_dsmclip_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type) +{ + MovieClip *clip = (MovieClip *)ale->data; + + /* clear extra return data first */ + *type = 0; + + switch (setting) { + case ACHANNEL_SETTING_EXPAND: /* expanded */ + return GET_ACF_FLAG_PTR(clip->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 (clip->adt != NULL) { + return GET_ACF_FLAG_PTR(clip->adt->flag, type); + } + return NULL; + + default: /* unsupported */ + return NULL; + } +} + +/* world expander type define */ +static bAnimChannelType ACF_DSMCLIP = +{ + "Movieclip Expander", /* type name */ + ACHANNEL_ROLE_EXPANDER, /* role */ + + 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_idfill_name_prop, /* name prop */ + acf_dsmclip_icon, /* icon */ + + acf_generic_dataexpand_setting_valid, /* has setting */ + acf_dsmclip_setting_flag, /* flag for setting */ + acf_dsmclip_setting_ptr /* pointer for setting */ +}; + /* ShapeKey Entry ------------------------------------------- */ /* name for ShapeKey */ @@ -3424,6 +3502,7 @@ static void ANIM_init_channel_typeinfo_data(void) animchannelTypeInfo[type++] = &ACF_DSLINESTYLE; /* LineStyle Channel */ animchannelTypeInfo[type++] = &ACF_DSSPK; /* Speaker Channel */ animchannelTypeInfo[type++] = &ACF_DSGPENCIL; /* GreasePencil Channel */ + animchannelTypeInfo[type++] = &ACF_DSMCLIP; /* MovieClip Channel */ animchannelTypeInfo[type++] = &ACF_SHAPEKEY; /* ShapeKey */ diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 96dd80777f2..ecaadd78dc2 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -132,6 +132,7 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, eAnimCont_Types datat case ANIMTYPE_DSLINESTYLE: case ANIMTYPE_DSSPK: case ANIMTYPE_DSGPENCIL: + case ANIMTYPE_DSMCLIP: { /* need to verify that this data is valid for now */ if (ale->adt) { @@ -188,6 +189,7 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, eAnimCont_Types datat case ANIMTYPE_DSNTREE: case ANIMTYPE_DSTEX: case ANIMTYPE_DSGPENCIL: + case ANIMTYPE_DSMCLIP: { /* need to verify that this data is valid for now */ if (ale && ale->adt) { @@ -288,6 +290,7 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, eAnimCont_Types d case ANIMTYPE_DSLINESTYLE: case ANIMTYPE_DSSPK: case ANIMTYPE_DSGPENCIL: + case ANIMTYPE_DSMCLIP: { if ((ale->adt) && (ale->adt->flag & ADT_UI_SELECTED)) sel = ACHANNEL_SETFLAG_CLEAR; @@ -383,6 +386,7 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, eAnimCont_Types d case ANIMTYPE_DSLINESTYLE: case ANIMTYPE_DSSPK: case ANIMTYPE_DSGPENCIL: + case ANIMTYPE_DSMCLIP: { /* need to verify that this data is valid for now */ if (ale->adt) { @@ -2733,6 +2737,7 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, case ANIMTYPE_DSLINESTYLE: case ANIMTYPE_DSSPK: case ANIMTYPE_DSGPENCIL: + case ANIMTYPE_DSMCLIP: { /* sanity checking... */ if (ale->adt) { diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 66e4cae2f3e..7bf146aa171 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -62,6 +62,7 @@ #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_meta_types.h" +#include "DNA_movieclip_types.h" #include "DNA_node_types.h" #include "DNA_space_types.h" #include "DNA_sequence_types.h" @@ -828,6 +829,19 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne ale->adt = BKE_animdata_from_id(data); break; } + case ANIMTYPE_DSMCLIP: + { + MovieClip *clip = (MovieClip *)data; + AnimData *adt = clip->adt; + + ale->flag = EXPANDED_MCLIP(clip); + + ale->key_data = (adt) ? adt->action : NULL; + ale->datatype = ALE_ACT; + + ale->adt = BKE_animdata_from_id(data); + break; + } case ANIMTYPE_NLACONTROLS: { AnimData *adt = (AnimData *)data; @@ -2721,6 +2735,50 @@ static size_t animdata_filter_dopesheet_scene(bAnimContext *ac, ListBase *anim_d return items; } +static size_t animdata_filter_ds_movieclip(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, MovieClip *clip, int filter_mode) +{ + ListBase tmp_data = {NULL, NULL}; + size_t tmp_items = 0; + size_t items = 0; + /* add world animation channels */ + BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_MCLIP(clip)) + { + /* animation data filtering */ + tmp_items += animfilter_block_data(ac, &tmp_data, ads, (ID *)clip, filter_mode); + } + END_ANIMFILTER_SUBCHANNELS; + /* did we find anything? */ + if (tmp_items) { + /* include data-expand widget first */ + if (filter_mode & ANIMFILTER_LIST_CHANNELS) { + /* check if filtering by active status */ + if (ANIMCHANNEL_ACTIVEOK(clip)) { + ANIMCHANNEL_NEW_CHANNEL(clip, ANIMTYPE_DSMCLIP, clip); + } + } + /* now add the list of collected channels */ + BLI_movelisttolist(anim_data, &tmp_data); + BLI_assert(BLI_listbase_is_empty(&tmp_data)); + items += tmp_items; + } + /* return the number of items added to the list */ + return items; +} + +static size_t animdata_filter_dopesheet_movieclips(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, int filter_mode) +{ + size_t items = 0; + MovieClip *clip; + for (clip = G.main->movieclip.first; clip != NULL; clip = clip->id.next) { + /* only show if gpd is used by something... */ + if (ID_REAL_USERS(clip) < 1) { + continue; + } + items += animdata_filter_ds_movieclip(ac, anim_data, ads, clip, filter_mode); + } + /* return the number of items added to the list */ + return items; +} /* Helper for animdata_filter_dopesheet() - For checking if an object should be included or not */ static bool animdata_filter_base_is_ok(bDopeSheet *ads, Scene *scene, Base *base, int filter_mode) @@ -2854,9 +2912,12 @@ static size_t animdata_filter_dopesheet(bAnimContext *ac, ListBase *anim_data, b items += animdata_filter_ds_cachefile(ac, anim_data, ads, cache_file, filter_mode); } + /* movie clip's animation */ + items += animdata_filter_dopesheet_movieclips(ac, anim_data, ads, filter_mode); + /* scene-linked animation - e.g. world, compositing nodes, scene anim (including sequencer currently) */ 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) diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index e05f15ce7fc..4ca7eaf0943 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -169,6 +169,7 @@ typedef enum eAnim_ChannelType { ANIMTYPE_DSLINESTYLE, ANIMTYPE_DSSPK, ANIMTYPE_DSGPENCIL, + ANIMTYPE_DSMCLIP, ANIMTYPE_SHAPEKEY, @@ -327,6 +328,8 @@ typedef enum eAnimFilter_Flags { #define SEL_NLT(nlt) (nlt->flag & NLATRACK_SELECTED) #define EDITABLE_NLT(nlt) ((nlt->flag & NLATRACK_PROTECTED) == 0) +/* Movie clip only */ +#define EXPANDED_MCLIP(clip) (clip->flag & MCLIP_DATA_EXPAND) /* AnimData - NLA mostly... */ #define SEL_ANIMDATA(adt) (adt->flag & ADT_UI_SELECTED) diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 5602e2b9c6d..cdf34642a8d 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -808,7 +808,7 @@ int UI_searchbox_size_y(void) int UI_searchbox_size_x(void) { - return 10 * UI_UNIT_X; + return 12 * UI_UNIT_X; } int UI_search_items_find_index(uiSearchItems *items, const char *name) diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 0716c062ab9..9d9ccf2f3ba 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -739,7 +739,10 @@ static void screen_opengl_render_end(bContext *C, OGLRender *oglrender) if (oglrender->is_animation) { BLI_task_pool_work_and_wait(oglrender->task_pool); BLI_task_pool_free(oglrender->task_pool); - BLI_task_scheduler_free(oglrender->task_scheduler); + /* Depending on various things we might or might not use global scheduler. */ + if (oglrender->task_scheduler != NULL) { + BLI_task_scheduler_free(oglrender->task_scheduler); + } BLI_spin_end(&oglrender->reports_lock); } BLI_mutex_end(&oglrender->task_mutex); diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index de8d7609509..9430ee626ba 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -103,7 +103,7 @@ static void sclip_zoom_set(const bContext *C, float zoom, float location[2]) width *= sc->zoom; height *= sc->zoom; - if ((width < 4) && (height < 4)) + if ((width < 4) && (height < 4) && sc->zoom < oldzoom) sc->zoom = oldzoom; else if (BLI_rcti_size_x(&ar->winrct) <= sc->zoom) sc->zoom = oldzoom; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index b4dd5c4a87f..6ca738b0e11 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -122,7 +122,7 @@ static void sima_zoom_set(SpaceImage *sima, ARegion *ar, float zoom, const float width *= sima->zoom; height *= sima->zoom; - if ((width < 4) && (height < 4)) + if ((width < 4) && (height < 4) && sima->zoom < oldzoom) sima->zoom = oldzoom; else if (BLI_rcti_size_x(&ar->winrct) <= sima->zoom) sima->zoom = oldzoom; |