diff options
-rw-r--r-- | source/blender/editors/space_nla/nla_channels.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_edit.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_intern.h | 8 |
3 files changed, 16 insertions, 7 deletions
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index c3f8642d0a6..ca50ff3b545 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -395,7 +395,7 @@ void NLA_OT_channels_click(wmOperatorType *ot) /* Add NLA Tracks to the same AnimData block as a selected track, or above the selected tracks */ /* helper - add NLA Tracks alongside existing ones */ -static bool nlaedit_add_tracks_existing(bAnimContext *ac, bool above_sel) +bool nlaedit_add_tracks_existing(bAnimContext *ac, bool above_sel) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; @@ -437,7 +437,7 @@ static bool nlaedit_add_tracks_existing(bAnimContext *ac, bool above_sel) } /* helper - add NLA Tracks to empty (and selected) AnimData blocks */ -static bool nlaedit_add_tracks_empty(bAnimContext *ac) +bool nlaedit_add_tracks_empty(bAnimContext *ac) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 5be3a2b14d4..164382c300d 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -412,6 +412,11 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op) act->id.name + 2); } + /* add tracks to empty but selected animdata blocks so that strips can be added to those directly + * without having to manually add tracks first + */ + nlaedit_add_tracks_empty(&ac); + /* get a list of the editable tracks being shown in the NLA * - this is limited to active ones for now, but could be expanded to */ @@ -419,7 +424,9 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op) items = ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); if (items == 0) { - BKE_report(op->reports, RPT_ERROR, "No active track(s) to add strip to"); + BKE_report(op->reports, RPT_ERROR, + "No active track(s) to add strip to. " + "Select an existing track or add one before trying again"); return OPERATOR_CANCELLED; } @@ -1671,8 +1678,6 @@ static int nlaedit_apply_scale_exec(bContext *C, wmOperator *UNUSED(op)) filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); - /* init the editing data */ - /* for each NLA-Track, apply scale of all selected strips */ for (ale = anim_data.first; ale; ale = ale->next) { NlaTrack *nlt = (NlaTrack *)ale->data; diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 98c66d70a75..e78187cef39 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -71,8 +71,7 @@ void NLA_OT_click_select(wmOperatorType *ot); /* **************************************** */ /* nla_edit.c */ -/* defines for snap strips - */ +/* defines for snap strips */ enum eNlaEdit_Snap_Mode { NLAEDIT_SNAP_CFRA = 1, NLAEDIT_SNAP_NEAREST_FRAME, @@ -122,6 +121,11 @@ void NLA_OT_fmodifier_paste(wmOperatorType *ot); /* **************************************** */ /* nla_channels.c */ +bool nlaedit_add_tracks_existing(bAnimContext *ac, bool above_sel); +bool nlaedit_add_tracks_empty(bAnimContext *ac); + +/* --- */ + void NLA_OT_channels_click(wmOperatorType *ot); void NLA_OT_tracks_add(wmOperatorType *ot); |