Fix for previous commit: Pop up a warning in cases where the operator will refuse to do anything

This commit is contained in:
Joshua Leung 2015-02-27 18:29:53 +13:00
parent b28a24091f
commit bb7ce9173a
1 changed files with 9 additions and 1 deletions

View File

@ -201,7 +201,15 @@ static int action_pushdown_exec(bContext *C, wmOperator *op)
/* Perform the pushdown operation
* - This will deal with all the AnimData-side usercounts
*/
BKE_nla_action_pushdown(adt);
if (action_has_motion(adt->action) == 0) {
/* action may not be suitable... */
BKE_report(op->reports, RPT_WARNING, "Action needs have at least a keyframe or some FModifiers");
return OPERATOR_CANCELLED;
}
else {
/* action can be safely added */
BKE_nla_action_pushdown(adt);
}
/* Stop displaying this action in this editor
* NOTE: The editor itself doesn't set a user...