[Bf-blender-cvs] [debcd6b] master: Fix T44558 - "Clear Keyframes" complains when operating on an array property and it had deleted the action in the process

Joshua Leung noreply at git.blender.org
Thu Apr 30 13:01:40 CEST 2015


Commit: debcd6b2177938feef619e0b2d65e1dbf00cfef8
Author: Joshua Leung
Date:   Thu Apr 30 22:43:48 2015 +1200
Branches: master
https://developer.blender.org/rBdebcd6b2177938feef619e0b2d65e1dbf00cfef8

Fix T44558 - "Clear Keyframes" complains when operating on an array property and it had deleted the action in the process

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

M	source/blender/editors/animation/keyframing.c

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

diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 64ced43..08b1889 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1884,8 +1884,19 @@ static int clear_key_button_exec(bContext *C, wmOperator *op)
 			else
 				length = 1;
 			
-			for (a = 0; a < length; a++)
+			for (a = 0; a < length; a++) {
+				AnimData *adt = BKE_animdata_from_id(ptr.id.data);
+				
 				success += clear_keyframe(op->reports, ptr.id.data, NULL, NULL, path, index + a, 0);
+				
+				/* T44558 - Stop if there's no animdata anymore
+				 * This is needed if only the first item in an array is keyed,
+				 * and we're clearing for the whole array
+				 */
+				if (ELEM(NULL, adt, adt->action)) {
+					break;
+				}
+			}
 			
 			MEM_freeN(path);
 		}




More information about the Bf-blender-cvs mailing list