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:
authorPeter Schlaile <peter@schlaile.de>2010-04-25 16:53:39 +0400
committerPeter Schlaile <peter@schlaile.de>2010-04-25 16:53:39 +0400
commita92b8b7ff6fae4a5d11baebb062b83e7b1b61dcc (patch)
treeb0296383476658acb64f8ba52e54e3dee796cdb1 /source/blender/blenkernel/intern/seqeffects.c
parent3f12beb4d0440da93ccbe67c76f23a2f15452aac (diff)
== Sequencer ==
This adds MULTICAM-editing support for blender. (Well, the beginning of.) There is now a new effect track, named MULTICAM, which just selects one of the lower tracks. Doesn't sound that exciting, but if you combine this with A/B-Trim (moving split points of two directly connected tracks around, while magically resizing both strips, something to be added), you just do: * add several tracks for your camera angles * (optionally) sync those tracks * add one multicam track on top Use that multicam-track to edit your movie. (Either using fcurves on the multicam source selector or using knife-tool and A/B-Trim.) Compare that to: * add several tracks * add cross fades between them * do some python scripting to add several fcurves to make that beast somewhat work. * cry out loud, using it, if you have to move cut points around Alternatively, even harder: * just edit the old way and put strip after strip You might think, that this isn't really helpfull for animators, but consider using scene-strips (in OpenGL-mode) for input, that are set for different camera angles and can now be intercut a lot more easily... Also: small fix on the way: the speed effect can now be used in cascade. (Don't know, if anyone used it that way, but now it works.)
Diffstat (limited to 'source/blender/blenkernel/intern/seqeffects.c')
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c160
1 files changed, 120 insertions, 40 deletions
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 3c9227fd2a6..b5f9c8fe542 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -230,9 +230,10 @@ static ImBuf * IMB_cast_away_list(ImBuf * i)
}
static void do_plugin_effect(Scene *scene, Sequence *seq, int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
+ float facf0, float facf1, int x, int y,
+ int preview_render_size,
+ struct ImBuf *ibuf1, struct ImBuf *ibuf2,
+ struct ImBuf *ibuf3, struct ImBuf *out)
{
char *cp;
int float_rendering;
@@ -477,6 +478,7 @@ static void do_alphaover_effect_float(float facf0, float facf1, int x, int y,
static void do_alphaover_effect(Scene *scene, Sequence *seq, int cfra,
float facf0, float facf1, int x, int y,
+ int preview_render_size,
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3, struct ImBuf *out)
{
@@ -644,6 +646,7 @@ static void do_alphaunder_effect_float(float facf0, float facf1, int x, int y,
static void do_alphaunder_effect(Scene *scene, Sequence *seq, int cfra,
float facf0, float facf1, int x, int y,
+ int preview_render_size,
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3, struct ImBuf *out)
{
@@ -763,9 +766,10 @@ void do_cross_effect_float(float facf0, float facf1, int x, int y,
/* carefull: also used by speed effect! */
static void do_cross_effect(Scene *scene, Sequence *seq, int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
+ float facf0, float facf1, int x, int y,
+ int preview_render_size,
+ struct ImBuf *ibuf1, struct ImBuf *ibuf2,
+ struct ImBuf *ibuf3, struct ImBuf *out)
{
if (out->rect_float) {
do_cross_effect_float(
@@ -1026,6 +1030,7 @@ static void do_gammacross_effect_float(float facf0, float facf1,
static void do_gammacross_effect(Scene *scene, Sequence *seq, int cfra,
float facf0, float facf1, int x, int y,
+ int preview_render_size,
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3, struct ImBuf *out)
{
@@ -1140,6 +1145,7 @@ static void do_add_effect_float(float facf0, float facf1, int x, int y,
static void do_add_effect(Scene *scene, Sequence *seq, int cfra,
float facf0, float facf1, int x, int y,
+ int preview_render_size,
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3, struct ImBuf *out)
{
@@ -1251,7 +1257,8 @@ static void do_sub_effect_float(float facf0, float facf1, int x, int y,
}
static void do_sub_effect(Scene *scene, Sequence *seq, int cfra,
- float facf0, float facf1, int x, int y,
+ float facf0, float facf1, int x, int y,
+ int preview_render_size,
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3, struct ImBuf *out)
{
@@ -1360,6 +1367,7 @@ static void do_drop_effect_float(float facf0, float facf1, int x, int y,
static void do_drop_effect(Scene *scene, Sequence *seq, int cfra,
float facf0, float facf1, int x, int y,
+ int preview_render_size,
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf * ibuf3,
struct ImBuf *out)
@@ -1481,6 +1489,7 @@ static void do_mul_effect_float(float facf0, float facf1, int x, int y,
static void do_mul_effect(Scene *scene, Sequence *seq, int cfra,
float facf0, float facf1, int x, int y,
+ int preview_render_size,
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3, struct ImBuf *out)
{
@@ -1931,6 +1940,7 @@ static void do_wipe_effect_float(Sequence *seq, float facf0, float facf1,
static void do_wipe_effect(Scene *scene, Sequence *seq, int cfra,
float facf0, float facf1, int x, int y,
+ int preview_render_size,
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3, struct ImBuf *out)
{
@@ -2075,9 +2085,10 @@ static void do_transform(Scene *scene, Sequence *seq, float facf0, int x, int y,
static void do_transform_effect(Scene *scene, Sequence *seq,int cfra,
- float facf0, float facf1, int x, int y,
- struct ImBuf *ibuf1, struct ImBuf *ibuf2,
- struct ImBuf *ibuf3, struct ImBuf *out)
+ float facf0, float facf1, int x, int y,
+ int preview_render_size,
+ struct ImBuf *ibuf1, struct ImBuf *ibuf2,
+ struct ImBuf *ibuf3, struct ImBuf *out)
{
do_transform(scene, seq, facf0, x, y, ibuf1, out);
}
@@ -2588,6 +2599,7 @@ static void do_glow_effect_float(Sequence *seq, float facf0, float facf1,
static void do_glow_effect(Scene *scene, Sequence *seq, int cfra,
float facf0, float facf1, int x, int y,
+ int preview_render_size,
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3, struct ImBuf *out)
{
@@ -2643,6 +2655,7 @@ static int early_out_color(struct Sequence *seq,
static void do_solid_color(Scene *scene, Sequence *seq, int cfra,
float facf0, float facf1, int x, int y,
+ int preview_render_size,
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
struct ImBuf *ibuf3, struct ImBuf *out)
{
@@ -2718,6 +2731,64 @@ static void do_solid_color(Scene *scene, Sequence *seq, int cfra,
}
/* **********************************************************************
+ MULTICAM
+ ********************************************************************** */
+
+/* no effect inputs for multicam, we use give_ibuf_seq */
+static int num_inputs_multicam()
+{
+ return 0;
+}
+
+static int early_out_multicam(struct Sequence *seq, float facf0, float facf1)
+{
+ return -1;
+}
+
+static void do_multicam(Scene *scene, Sequence *seq, int cfra,
+ float facf0, float facf1, int x, int y,
+ int preview_render_size,
+ struct ImBuf *ibuf1, struct ImBuf *ibuf2,
+ struct ImBuf *ibuf3, struct ImBuf *out)
+{
+ struct ImBuf * i;
+ Editing * ed;
+ ListBase * seqbasep;
+
+ if (seq->multicam_source == 0 || seq->multicam_source >= seq->machine) {
+ return;
+ }
+
+ ed = scene->ed;
+ if (!ed) {
+ return;
+ }
+ seqbasep = seq_seqbase(&ed->seqbase, seq);
+ if (!seqbasep) {
+ return;
+ }
+
+ i = give_ibuf_seqbase(scene,
+ out->x, out->y, cfra, seq->multicam_source,
+ preview_render_size, seqbasep);
+ if (!i) {
+ return;
+ }
+
+ if (out->rect && i->rect) {
+ memcpy(out->rect, i->rect, out->x * out->y * 4);
+ } else if (out->rect_float && i->rect_float) {
+ memcpy(out->rect_float, i->rect_float, out->x * out->y *4*sizeof(float));
+ } else if (out->rect && i->rect_float) {
+ IMB_rect_from_float(i);
+ memcpy(out->rect, i->rect, out->x * out->y * 4);
+ } else if (out->rect_float && i->rect) {
+ IMB_float_from_rect(i);
+ memcpy(out->rect_float, i->rect_float, out->x * out->y *4*sizeof(float));
+ }
+}
+
+/* **********************************************************************
SPEED
********************************************************************** */
static void init_speed_effect(Sequence *seq)
@@ -2854,16 +2925,16 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
for (cfra = 1; cfra < v->length; cfra++) {
if(fcu) {
- if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
- ctime = seq->startdisp + cfra;
- div = 1.0;
- } else {
- ctime= cfra;
- div= v->length / 100.0f;
- if(div==0.0) return;
- }
-
- facf = evaluate_fcurve(fcu, ctime/div);
+ if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
+ ctime = seq->startdisp + cfra;
+ div = 1.0;
+ } else {
+ ctime= cfra;
+ div= v->length / 100.0f;
+ if(div==0.0) return;
+ }
+
+ facf = evaluate_fcurve(fcu, ctime/div);
} else {
facf = fallback_fac;
}
@@ -2885,19 +2956,19 @@ void sequence_effect_speed_rebuild_map(Scene *scene, Sequence * seq, int force)
for (cfra = 0; cfra < v->length; cfra++) {
if(fcu) {
- if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
- ctime = seq->startdisp + cfra;
- div = 1.0;
- } else {
- ctime= cfra;
- div= v->length / 100.0f;
- if(div==0.0) return;
- }
-
- facf = evaluate_fcurve(fcu, ctime / div);
- if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) {
- facf *= v->length;
- }
+ if((seq->flag & SEQ_IPO_FRAME_LOCKED) != 0) {
+ ctime = seq->startdisp + cfra;
+ div = 1.0;
+ } else {
+ ctime= cfra;
+ div= v->length / 100.0f;
+ if(div==0.0) return;
+ }
+
+ facf = evaluate_fcurve(fcu, ctime / div);
+ if (v->flags & SEQ_SPEED_COMPRESS_IPO_Y) {
+ facf *= v->length;
+ }
}
if (!fcu) {
@@ -3005,16 +3076,20 @@ static void get_default_fac_fade(struct Sequence *seq, int cfra,
}
static void do_overdrop_effect(Scene *scene, Sequence *seq, int cfra,
- float fac, float facf,
- int x, int y, struct ImBuf * ibuf1,
- struct ImBuf * ibuf2,
- struct ImBuf * ibuf3,
- struct ImBuf * out)
+ float fac, float facf,
+ int x, int y,
+ int preview_render_size,
+ struct ImBuf * ibuf1,
+ struct ImBuf * ibuf2,
+ struct ImBuf * ibuf3,
+ struct ImBuf * out)
{
do_drop_effect(scene, seq, cfra, fac, facf, x, y,
- ibuf1, ibuf2, ibuf3, out);
+ preview_render_size,
+ ibuf1, ibuf2, ibuf3, out);
do_alphaover_effect(scene, seq, cfra, fac, facf, x, y,
- ibuf1, ibuf2, ibuf3, out);
+ preview_render_size,
+ ibuf1, ibuf2, ibuf3, out);
}
static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
@@ -3121,6 +3196,11 @@ static struct SeqEffectHandle get_sequence_effect_impl(int seq_type)
rval.early_out = do_plugin_early_out;
rval.get_default_fac = get_default_fac_fade;
break;
+ case SEQ_MULTICAM:
+ rval.num_inputs = num_inputs_multicam;
+ rval.early_out = early_out_multicam;
+ rval.execute = do_multicam;
+ break;
}
return rval;