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>2010-02-12 04:06:18 +0300
committerJoshua Leung <aligorith@gmail.com>2010-02-12 04:06:18 +0300
commit61d7e4a51e929a781affe62a33d569ca0e6a0406 (patch)
tree2a758f32de3c878429d0dfcc9f6cd3a838e96df7 /source/blender
parent6b01ab5e2309b2c823b8a1abf631a3d8172b93a2 (diff)
Bugfix #21094:
Inserting keyframes for properties that don't already have F-Curves shouldn't occur if auto keyframing is set to 'replace' only (i.e. see timeline -> frame -> autokey mode menu for details).
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/animation/keyframing.c20
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c26
2 files changed, 19 insertions, 27 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 1eb2a82cccf..979502e0bf4 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -222,10 +222,12 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt, short flag)
{
int i= 0;
+ /* are there already keyframes? */
if (fcu->bezt) {
short replace = -1;
i = binarysearch_bezt_index(fcu->bezt, bezt->vec[1][0], fcu->totvert, &replace);
+ /* replace an existing keyframe? */
if (replace) {
/* sanity check: 'i' may in rare cases exceed arraylen */
if ((i >= 0) && (i < fcu->totvert)) {
@@ -252,6 +254,7 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt, short flag)
}
}
}
+ /* keyframing modes allow to not replace keyframe */
else if ((flag & INSERTKEY_REPLACE) == 0) {
/* insert new - if we're not restricted to replacing keyframes only */
BezTriple *newb= MEM_callocN((fcu->totvert+1)*sizeof(BezTriple), "beztriple");
@@ -270,16 +273,27 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt, short flag)
/* replace (+ free) old with new, only if necessary to do so */
MEM_freeN(fcu->bezt);
fcu->bezt= newb;
-
+
fcu->totvert++;
}
}
- else {
- // TODO: need to check for old sample-data now...
+ /* no keyframes already, but can only add if...
+ * 1) keyframing modes say that keyframes can only be replaced, so adding new ones won't know
+ * 2) there are no samples on the curve
+ * // NOTE: maybe we may want to allow this later when doing samples -> bezt conversions,
+ * // but for now, having both is asking for trouble
+ */
+ else if ((flag & INSERTKEY_REPLACE)==0 && (fcu->fpt==NULL)) {
+ /* create new keyframes array */
fcu->bezt= MEM_callocN(sizeof(BezTriple), "beztriple");
*(fcu->bezt)= *bezt;
fcu->totvert= 1;
}
+ /* cannot add anything */
+ else {
+ /* return error code -1 to prevent any misunderstandings */
+ return -1;
+ }
/* we need to return the index, so that some tools which do post-processing can
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 2771e6315c8..2b500321dfe 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -791,34 +791,12 @@ static void recurs_del_seq_flag(Scene *scene, ListBase *lb, short flag, short de
static Sequence *dupli_seq(struct Scene *scene, Sequence *seq)
{
Sequence *seqn = MEM_dupallocN(seq);
- // XXX animato: ID *id;
seq->tmp = seqn;
-
seqn->strip= MEM_dupallocN(seq->strip);
- // XXX animato
-#if 0
- if (seqn->ipo) {
- if (U.dupflag & USER_DUP_IPO) {
- id= (ID *)seqn->ipo;
- seqn->ipo= copy_ipo(seqn->ipo);
- /* we don't need to decrease the number
- * of the ipo because we never increase it,
- * for example, adduplicate need decrease
- * the number but only because copy_object
- * call id_us_plus for the ipo block and
- * single_ipo_users only work if id->us > 1.
- *
- * need call ipo_idnew here, for drivers ??
- * - Diego
- */
- }
- else
- seqn->ipo->id.us++;
- }
-#endif
-
+ // XXX: add F-Curve duplication stuff?
+
seqn->strip->tstripdata = 0;
seqn->strip->tstripdata_startstill = 0;
seqn->strip->tstripdata_endstill = 0;