[Bf-blender-cvs] [bb7ce91] master: Fix for previous commit: Pop up a warning in cases where the operator will refuse to do anything

Joshua Leung noreply at git.blender.org
Sat Feb 28 14:37:09 CET 2015


Commit: bb7ce9173af240a60311df64672fa48744199098
Author: Joshua Leung
Date:   Fri Feb 27 18:29:53 2015 +1300
Branches: master
https://developer.blender.org/rBbb7ce9173af240a60311df64672fa48744199098

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

===================================================================

M	source/blender/editors/space_action/action_edit.c

===================================================================

diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index e8ee993..fe29fed 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...




More information about the Bf-blender-cvs mailing list