diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-02-21 00:32:21 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-02-21 00:32:21 +0300 |
commit | 38e7084179118059dd8c6f6ac5db77a86676f742 (patch) | |
tree | b7b0ac146926c592bdadb3dcd92bb8ac26a9e474 /source/blender/editors/animation/keyingsets.c | |
parent | 06aee2ef0e1c810c24b2559838e46045d708b22f (diff) |
Bugfixes:
- Fix for crash with Keying Sets when a Keying Set path has no ID-
block to target
- Info window now indicates the types of the reports shown by
colouring their entries if the entries are not selected.
Diffstat (limited to 'source/blender/editors/animation/keyingsets.c')
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 930563678dd..afc295a73da 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -937,6 +937,14 @@ int ANIM_apply_keyingset (bContext *C, ListBase *dsources, bAction *act, KeyingS int arraylen, i; short kflag2; + /* skip path if no ID pointer is specified */ + if (ksp->id == NULL) { + BKE_reportf(reports, RPT_WARNING, + "Skipping path in Keying Set, as it has no ID (KS = '%s', Path = '%s'[%d])", + ks->name, ksp->rna_path, ksp->array_index); + continue; + } + /* since keying settings can be defined on the paths too, extend the path before using it */ kflag2 = (kflag | ksp->keyingflag); @@ -980,20 +988,18 @@ int ANIM_apply_keyingset (bContext *C, ListBase *dsources, bAction *act, KeyingS } /* set recalc-flags */ - if (ksp->id) { - switch (GS(ksp->id->name)) { - case ID_OB: /* Object (or Object-Related) Keyframes */ - { - Object *ob= (Object *)ksp->id; - - ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; // XXX: only object transforms only? - } - break; + switch (GS(ksp->id->name)) { + case ID_OB: /* Object (or Object-Related) Keyframes */ + { + Object *ob= (Object *)ksp->id; + + ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; // XXX: only object transforms only? } - - /* send notifiers for updates (this doesn't require context to work!) */ - WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + break; } + + /* send notifiers for updates (this doesn't require context to work!) */ + WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); } /* return the number of channels successfully affected */ |