diff options
author | Matt Ebb <matt@mke3.net> | 2009-08-25 05:37:08 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-08-25 05:37:08 +0400 |
commit | ea97a373834ea956ad0778b2c535452a6ecb1752 (patch) | |
tree | 9da83b01797e1697bc6f99e999bee927e072b3e0 /source/blender/editors/animation/keyframing.c | |
parent | 90895fce8ca4f40bd41026b0406d80e8e83e0e8d (diff) | |
parent | 4a78b9e9046567e86ed3ccada83a50c43684facd (diff) |
svn merge -r 22628:22753 https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blendervolume25
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 2da082a9b7c..b62c69c7b38 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -740,6 +740,12 @@ short insert_keyframe_direct (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, fl printf("ERROR: no F-Curve to add keyframes to \n"); return 0; } + /* F-Curve not editable? */ + if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) { + if (G.f & G_DEBUG) + printf("WARNING: not inserting keyframe for locked F-Curve \n"); + return 0; + } /* if no property given yet, try to validate from F-Curve info */ if ((ptr.id.data == NULL) && (ptr.data==NULL)) { @@ -911,8 +917,19 @@ short delete_keyframe (ID *id, bAction *act, const char group[], const char rna_ /* we don't check the validity of the path here yet, but it should be ok... */ fcu= verify_fcurve(act, group, rna_path, array_index, 0); - /* only continue if we have an F-Curve to remove keyframes from */ - if (act && fcu) { + /* check if F-Curve exists and/or whether it can be edited */ + if ELEM(NULL, act, fcu) { + printf("ERROR: no F-Curve and/or Action to delete keyframe from \n"); + return 0; + } + if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) { + if (G.f & G_DEBUG) + printf("WARNING: not inserting keyframe for locked F-Curve \n"); + return 0; + } + + /* it should be fine to continue now... */ + { short found = -1; int i; |