diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-06 20:44:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-06 20:44:05 +0400 |
commit | 2a95a246eda72b3d08d0572562953a5703baa4b7 (patch) | |
tree | 788de89efeecb3cef2ca2af681310be4fa6a7224 /source/blender | |
parent | 577cd54c8e88d97ecb87c7c0b01bf3fd6703e2ee (diff) |
color balance can now be animated in the sequencer.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 19 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 37 | ||||
-rwxr-xr-x | source/blender/makesrna/rna_cleanup/rna_cleaner.py | 2 |
4 files changed, 52 insertions, 10 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 6fe1c2a96ea..5c5bf30980c 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -136,8 +136,8 @@ struct SeqEffectHandle { void printf_strip(struct Sequence *seq); /* apply functions recursively */ -void seqbase_recursive_apply(struct ListBase *seqbase, int (*apply_func)(struct Sequence *seq, void *), void *arg); -void seq_recursive_apply(struct Sequence *seq, int (*apply_func)(struct Sequence *, void *), void *arg); +int seqbase_recursive_apply(struct ListBase *seqbase, int (*apply_func)(struct Sequence *seq, void *), void *arg); +int seq_recursive_apply(struct Sequence *seq, int (*apply_func)(struct Sequence *, void *), void *arg); // extern void seq_free_sequence(struct Scene *scene, struct Sequence *seq); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index bd3e0129bcc..894b8b6ab60 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -87,18 +87,27 @@ void printf_strip(Sequence *seq) fprintf(stderr, "\tseq_tx_set_final_left: %d %d\n\n", seq_tx_get_final_left(seq, 0), seq_tx_get_final_right(seq, 0)); } -void seqbase_recursive_apply(ListBase *seqbase, int (*apply_func)(Sequence *seq, void *), void *arg) +int seqbase_recursive_apply(ListBase *seqbase, int (*apply_func)(Sequence *seq, void *), void *arg) { Sequence *iseq; for(iseq= seqbase->first; iseq; iseq= iseq->next) { - seq_recursive_apply(iseq, apply_func, arg); + if(seq_recursive_apply(iseq, apply_func, arg) == -1) + return -1; /* bail out */ } + return 1; } -void seq_recursive_apply(Sequence *seq, int (*apply_func)(Sequence *, void *), void *arg) +int seq_recursive_apply(Sequence *seq, int (*apply_func)(Sequence *, void *), void *arg) { - if(apply_func(seq, arg) && seq->seqbase.first) - seqbase_recursive_apply(&seq->seqbase, apply_func, arg); + int ret= apply_func(seq, arg); + + if(ret == -1) + return -1; /* bail out */ + + if(ret && seq->seqbase.first) + ret = seqbase_recursive_apply(&seq->seqbase, apply_func, arg); + + return ret; } /* ********************************************************************** diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 5cd4db205f5..b7bdffa0e13 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -483,6 +483,37 @@ static void rna_Sequence_opacity_set(PointerRNA *ptr, float value) { ((Sequence*)(ptr->data))->blend_opacity = value * 100.0f; } + +static int colbalance_seq_cmp_cb(Sequence *seq, void *arg_pt) +{ + struct { Sequence *seq; void *color_balance; } *data= arg_pt; + + if(seq->strip && seq->strip->color_balance == data->color_balance) { + data->seq= seq; + return -1; /* done so bail out */ + } + return 1; +} +static char *rna_SequenceColorBalance_path(PointerRNA *ptr) +{ + Scene *scene= ptr->id.data; + Editing *ed= seq_give_editing(scene, FALSE); + Sequence *seq; + + struct { Sequence *seq; void *color_balance; } data; + data.seq= NULL; + data.color_balance= ptr->data; + + /* irritating we need to search for our sequence! */ + seqbase_recursive_apply(&ed->seqbase, colbalance_seq_cmp_cb, &data); + seq= data.seq; + + if (seq && seq->name+2) + return BLI_sprintfN("sequence_editor.sequences_all[\"%s\"].color_balance", seq->name+2); + else + return BLI_strdup(""); +} + #else static void rna_def_strip_element(BlenderRNA *brna) @@ -613,7 +644,9 @@ static void rna_def_strip_color_balance(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_COLOR_BALANCE_INVERSE_LIFT); RNA_def_property_ui_text(prop, "Inverse Lift", ""); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); - + + RNA_def_struct_path_func(srna, "rna_SequenceColorBalance_path"); + /* not yet used prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); @@ -1320,7 +1353,7 @@ static void rna_def_solid_color(BlenderRNA *brna) PropertyRNA *prop; srna = RNA_def_struct(brna, "ColorSequence", "EffectSequence"); - RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single color"); + RNA_def_struct_ui_text(srna, "Color Sequence", "Sequence strip creating an image filled with a single g"); RNA_def_struct_sdna_from(srna, "SolidColorVars", "effectdata"); prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner.py b/source/blender/makesrna/rna_cleanup/rna_cleaner.py index 52bd59a6bba..3f68ec4a955 100755 --- a/source/blender/makesrna/rna_cleanup/rna_cleaner.py +++ b/source/blender/makesrna/rna_cleanup/rna_cleaner.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python3 +#! /usr/bin/env python3.1 """ This script is used to help cleaning RNA api. |