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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-11 17:38:02 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-11 17:38:02 +0300
commit3a9dcf1fea844796453c98843d24a27a4eef9874 (patch)
treebfc4c0b2c1ca449b72b8f25e7f5a9123e3256b94 /source/blender/editors/animation/keyframing.c
parentc6ffe237629b771f86eb92c755b0897e3a2233e0 (diff)
parent912877f290281190ed2fc12d333ba43c0607874b (diff)
Sculpt Branch:sculpt25
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r25245:25315
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r--source/blender/editors/animation/keyframing.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 3bfb8bdc867..3e25c9a6b60 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -274,6 +274,7 @@ int insert_vert_fcurve (FCurve *fcu, float x, float y, short flag)
beztr.ipo= U.ipo_new; /* use default interpolation mode here... */
beztr.f1= beztr.f2= beztr.f3= SELECT;
beztr.h1= beztr.h2= HD_AUTO; // XXX what about when we replace an old one?
+ //BEZKEYTYPE(&beztr)= scene->keytype; /* default keyframe type */
/* add temp beztriple to keyframes */
a= insert_bezt_fcurve(fcu, &beztr, flag);
@@ -809,7 +810,7 @@ short insert_keyframe (ID *id, bAction *act, const char group[], const char rna_
return 0;
}
- /* get F-Curve - if no action is provided, keyframe to the default one attached to this ID-block */
+ /* if no action is provided, keyframe to the default one attached to this ID-block */
if (act == NULL) {
AnimData *adt= BKE_animdata_from_id(id);
@@ -842,8 +843,19 @@ 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);
+ /* 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);
}