From debcd6b2177938feef619e0b2d65e1dbf00cfef8 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 30 Apr 2015 22:43:48 +1200 Subject: Fix T44558 - "Clear Keyframes" complains when operating on an array property and it had deleted the action in the process --- source/blender/editors/animation/keyframing.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 64ced437142..08b1889aff6 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); } -- cgit v1.2.3