diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
commit | dfe2f8dc03267e041102837e92f547fb04881510 (patch) | |
tree | d9582c4667ce5b9e39e2adce40832aa4f44b4fe7 /source/blender/editors/animation/keyframing.c | |
parent | d7e08f2d33207fdf76b1b597ef0de9dec26e3987 (diff) | |
parent | 00e46ef739cf2bfddb8805af056aa59fd3b3c71c (diff) |
Merged changes in the trunk up to revision 28247.
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 02b79770941..669a1042998 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -871,21 +871,27 @@ short insert_keyframe (ID *id, bAction *act, const char group[], const char rna_ /* will only loop once unless the array index was -1 */ for (; array_index < array_index_max; array_index++) { - /* make sure the F-Curve exists */ - fcu= verify_fcurve(act, group, rna_path, array_index, 1); + /* make sure the F-Curve exists + * - if we're replacing keyframes only, DO NOT create new F-Curves if they do not exist yet + * but still try to get the F-Curve if it exists... + */ + fcu= verify_fcurve(act, group, rna_path, array_index, (flag & INSERTKEY_REPLACE)==0); - /* set color mode if the F-Curve is new (i.e. without any keyframes) */ - if ((fcu->totvert == 0) && (flag & INSERTKEY_XYZ2RGB)) { - /* for Loc/Rot/Scale and also Color F-Curves, the color of the F-Curve in the Graph Editor, - * is determined by the array index for the F-Curve - */ - if (ELEM4(RNA_property_subtype(prop), PROP_TRANSLATION, PROP_XYZ, PROP_EULER, PROP_COLOR)) { - fcu->color_mode= FCURVE_COLOR_AUTO_RGB; + /* we may not have a F-Curve when we're replacing only... */ + if (fcu) { + /* set color mode if the F-Curve is new (i.e. without any keyframes) */ + if ((fcu->totvert == 0) && (flag & INSERTKEY_XYZ2RGB)) { + /* for Loc/Rot/Scale and also Color F-Curves, the color of the F-Curve in the Graph Editor, + * is determined by the array index for the F-Curve + */ + if (ELEM4(RNA_property_subtype(prop), PROP_TRANSLATION, PROP_XYZ, PROP_EULER, PROP_COLOR)) { + fcu->color_mode= FCURVE_COLOR_AUTO_RGB; + } } + + /* insert keyframe */ + ret += insert_keyframe_direct(ptr, prop, fcu, cfra, flag); } - - /* insert keyframe */ - ret += insert_keyframe_direct(ptr, prop, fcu, cfra, flag); } return ret; |