clone and stencil layer access added, renamed mask to stencil layer internally
[blender.git] / source / blender / makesrna / intern / rna_sequencer.c
index b8cd2c56483721935b52e6bd1cbbe525481fa1e3..f875e6a7fa2aa51ab2608330ea6631fbbb350e0d 100644 (file)
@@ -92,11 +92,11 @@ static void rna_SequenceEditor_sequences_all_next(CollectionPropertyIterator *it
 static void rna_Sequence_frame_change_update(Scene *scene, Sequence *seq)
 {
        Editing *ed= seq_give_editing(scene, FALSE);
-
+       ListBase *seqbase= seq_seqbase(&ed->seqbase, seq);
        calc_sequence_disp(seq);
 
-       if( seq_test_overlap(ed->seqbasep, seq) ) {
-               shuffle_seq(ed->seqbasep, seq);
+       if(seq_test_overlap(seqbase, seq)) {
+               shuffle_seq(seqbase, seq, scene); // XXX - BROKEN!, uses context seqbasep
        }
        sort_seq(scene);
 }
@@ -150,11 +150,12 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
        Sequence *seq= (Sequence*)ptr->data;
        Scene *scene= (Scene*)ptr->id.data;
        Editing *ed= seq_give_editing(scene, FALSE);
-       
+       ListBase *seqbase= seq_seqbase(&ed->seqbase, seq);
+
        seq->machine= value;
        
-       if( seq_test_overlap(ed->seqbasep, seq) ) {
-               shuffle_seq(ed->seqbasep, seq);
+       if( seq_test_overlap(seqbase, seq) ) {
+               shuffle_seq(seqbase, seq, scene);  // XXX - BROKEN!, uses context seqbasep
        }
        sort_seq(scene);
 }
@@ -234,9 +235,22 @@ static int rna_Sequence_name_length(PointerRNA *ptr)
 static void rna_Sequence_name_set(PointerRNA *ptr, const char *value)
 {
        Scene *scene= (Scene*)ptr->id.data;
+//     Editing *ed= seq_give_editing(scene, FALSE);
        Sequence *seq= (Sequence*)ptr->data;
+//     Sequence *iseq;
        BLI_strncpy(seq->name+2, value, sizeof(seq->name)-2);
+
        seqUniqueName(&scene->ed->seqbase, seq);
+
+       // TODO, unique name for all meta's
+       /*
+       SEQ_BEGIN(ed, iseq) {
+               if(iseq->seqbase.first)
+                       seqUniqueName(&iseq->seqbase, seq);
+
+       }
+       SEQ_END
+       */
 }
 
 static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr)
@@ -348,6 +362,14 @@ static void rna_Sequence_mute_update(Main *bmain, Scene *scene, PointerRNA *ptr)
        rna_Sequence_update(bmain, scene, ptr);
 }
 
+/* do_versions? */
+static float rna_Sequence_opacity_get(PointerRNA *ptr) {
+       return ((Sequence*)(ptr->data))->blend_opacity / 100.0f;
+}
+static void rna_Sequence_opacity_set(PointerRNA *ptr, float value) {
+       ((Sequence*)(ptr->data))->blend_opacity = value * 100.0f;
+}
+
 #else
 
 static void rna_def_strip_element(BlenderRNA *brna)
@@ -646,9 +668,10 @@ static void rna_def_sequence(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Blend Mode", "");
        RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
        
-       prop= RNA_def_property(srna, "blend_opacity", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_range(prop, 0.0f, 100.0f);
+       prop= RNA_def_property(srna, "blend_opacity", PROP_FLOAT, PROP_FACTOR);
+       RNA_def_property_range(prop, 0.0f, 1.0f);
        RNA_def_property_ui_text(prop, "Blend Opacity", "");
+       RNA_def_property_float_funcs(prop, "rna_Sequence_opacity_get", "rna_Sequence_opacity_set", NULL); // stupid 0-100 -> 0-1
        RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
        
        prop= RNA_def_property(srna, "effect_fader", PROP_FLOAT, PROP_NONE);