diff options
author | Peter Schlaile <peter@schlaile.de> | 2007-01-28 16:43:46 +0300 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2007-01-28 16:43:46 +0300 |
commit | 378a28fee41ce7a5a8e4dd881f889f5523046bd5 (patch) | |
tree | 0c9d4a5fb3ab97ceeca6a883bf27104133b03f50 /source/blender/src/drawipo.c | |
parent | d5da8ea1c7052284457499f892f7fcef2d218f1d (diff) |
== Sequencer ==
Bugfix: when ipo-frame-locking is turned off, make the ipo cursor show up
at the correct position and set CFRA correctly, if changed within IPO.
(avoids very annoying snapping...)
Diffstat (limited to 'source/blender/src/drawipo.c')
-rw-r--r-- | source/blender/src/drawipo.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index 87bfe436290..6421374d4c9 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -1463,13 +1463,39 @@ static void draw_ipocurves(int sel) } } +static int get_ipo_cfra_from_cfra(SpaceIpo * sipo, int cfra) +{ + if (sipo->blocktype==ID_SEQ) { + Sequence * seq = (Sequence*) sipo->from; + + if (!seq) { + return cfra; + } + + if ((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) { + return cfra; + } else { + float ctime= frame_to_float(cfra - seq->startdisp); + float div= (seq->enddisp - seq->startdisp)/100.0f; + + if(div == 0.0) { + return 0; + } else { + return ctime / div; + } + } + } else { + return cfra; + } +} + static void draw_cfra(SpaceIpo *sipo) { View2D *v2d= &sipo->v2d; Object *ob; float vec[2]; - vec[0]= (G.scene->r.cfra); + vec[0] = get_ipo_cfra_from_cfra(sipo, G.scene->r.cfra); vec[0]*= G.scene->r.framelen; vec[1]= v2d->cur.ymin; |