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>2009-08-25 04:12:11 +0400
committerJoshua Leung <aligorith@gmail.com>2009-08-25 04:12:11 +0400
commit4a78b9e9046567e86ed3ccada83a50c43684facd (patch)
tree405a3569ffe5d0477dfce4c2bcaded918574e240 /source/blender/editors/animation
parent8ed64f785491c10467e83584caecc13ec5199aaf (diff)
2.5 - Assorted Bugfixes for Animation Editing
* Inserting keyframes now takes into account whether the F-Curve was editable or not. * Editing keyframes in animation editors now sends proper depsgraph updates instead of just tagging the relevant objects. Thanks JiriH for reporting these bugs.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/keyframing.c21
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;