Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2015-04-30 13:43:48 +0300
committerJoshua Leung <aligorith@gmail.com>2015-04-30 13:59:39 +0300
commitdebcd6b2177938feef619e0b2d65e1dbf00cfef8 (patch)
tree804426a63187914ba7a064f0d815a47ba776c69b /source/blender
parent16794f908fe3f1df46096df100e007049991d89e (diff)
Fix T44558 - "Clear Keyframes" complains when operating on an array property and it had deleted the action in the process
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/animation/keyframing.c13
1 files changed, 12 insertions, 1 deletions
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);
}