diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-02-27 08:29:53 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-02-28 16:34:42 +0300 |
commit | bb7ce9173af240a60311df64672fa48744199098 (patch) | |
tree | d79389dcb444221772d001d30a600c2557f7bbc5 /source/blender/editors/space_action | |
parent | b28a24091facf64c93b5eee89d6595f32354545b (diff) |
Fix for previous commit: Pop up a warning in cases where the operator will refuse to do anything
Diffstat (limited to 'source/blender/editors/space_action')
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index e8ee993314c..fe29fed761d 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -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... |