Revision: 20808
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20808
Author:   campbellbarton
Date:     2009-06-11 13:54:56 +0200 (Thu, 11 Jun 2009)

Log Message:
-----------
sequencer patch from Xavier Thomas
- allocate transform and crop on "use"
- bring back the scopes drawing (histogram, vectorscope, luma)
- tweak properties layout (need more)

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/space_sequencer.py
    
branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_draw.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c

Modified: branches/blender2.5/blender/release/ui/space_sequencer.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_sequencer.py   2009-06-11 
11:53:41 UTC (rev 20807)
+++ branches/blender2.5/blender/release/ui/space_sequencer.py   2009-06-11 
11:54:56 UTC (rev 20808)
@@ -424,16 +424,26 @@
                if elem:
                        sub.itemR(elem, "filename", text="") # 
strip.elements[0] could be a fallback
                
-               """
+               layout.itemR(strip, "use_translation")
+               if strip.transform:
+                       flow = layout.column_flow()
+                       flow.active = strip.use_translation
+                       flow.itemR(strip.transform, "offset_x")
+                       flow.itemR(strip.transform, "offset_y")
+                       
+                       
                layout.itemR(strip, "use_crop")
+               if strip.crop:
+                       flow = layout.column_flow()
+                       flow.active = strip.use_crop
+                       flow.itemR(strip.crop, "top")
+                       flow.itemR(strip.crop, "left")
+                       flow.itemR(strip.crop, "bottom")
+                       flow.itemR(strip.crop, "right")
+                       
+               layout.itemR(strip, "animation_start_offset")
+               layout.itemR(strip, "animation_end_offset")
                
-               flow = layout.column_flow()
-               flow.active = strip.use_crop
-               flow.itemR(strip, "top")
-               flow.itemR(strip, "left")
-               flow.itemR(strip, "bottom")
-               flow.itemR(strip, "right")
-               """
 
 class SEQUENCER_PT_filter(SequencerButtonsPanel):
        __label__ = "Filter"
@@ -471,15 +481,18 @@
                
                layout.itemR(strip, "use_color_balance")
                if strip.color_balance: # TODO - need to add this somehow
-                       col = layout.row()
-                       
+                       row = layout.row()
+                       row.active = strip.use_color_balance
+                       col = row.column()
                        col.itemR(strip.color_balance, "lift")
+                       col.itemR(strip.color_balance, "inverse_lift")
+                       col = row.column()
                        col.itemR(strip.color_balance, "gamma")
+                       col.itemR(strip.color_balance, "inverse_gamma")
+                       col = row.column()
                        col.itemR(strip.color_balance, "gain")
-                       col = layout.row()
-                       col.itemR(strip.color_balance, "inverse_lift")
-                       col.itemR(strip.color_balance, "inverse_gamma")
                        col.itemR(strip.color_balance, "inverse_gain")
+                       
 
 class SEQUENCER_PT_proxy(SequencerButtonsPanel):
        __label__ = "Proxy"

Modified: 
branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_draw.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_draw.c
 2009-06-11 11:53:41 UTC (rev 20807)
+++ 
branches/blender2.5/blender/source/blender/editors/space_sequencer/sequencer_draw.c
 2009-06-11 11:54:56 UTC (rev 20808)
@@ -790,8 +790,8 @@
 
        if(ibuf->rect==NULL && ibuf->rect_float == NULL) 
                return;
-
-       switch(sseq->mainb != SEQ_DRAW_SEQUENCE) {
+       
+       switch(sseq->mainb) {
        case SEQ_DRAW_IMG_IMBUF:
                if (sseq->zebra != 0) {
                        ibuf = make_zebra_view_from_ibuf(ibuf, sseq->zebra);

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c   
2009-06-11 11:53:41 UTC (rev 20807)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c   
2009-06-11 11:54:56 UTC (rev 20808)
@@ -98,6 +98,7 @@
        sort_seq(sce);
 }
 
+/* properties that need to allocate structs */
 static int rna_SequenceEditor_use_color_balance_set(PointerRNA *ptr, int value)
 {
        Sequence *seq= (Sequence*)ptr->data;
@@ -131,6 +132,31 @@
        }
 }
 
+static int rna_SequenceEditor_use_translation_set(PointerRNA *ptr, int value)
+{
+       Sequence *seq= (Sequence*)ptr->data;
+       if(value) {
+               seq->flag |= SEQ_USE_TRANSFORM;
+               if(seq->strip->transform == NULL) {
+                       seq->strip->transform = MEM_callocN(sizeof(struct 
StripTransform), "StripTransform");
+               }
+       } else {
+               seq->flag ^= SEQ_USE_TRANSFORM;
+       }
+}
+
+static int rna_SequenceEditor_use_crop_set(PointerRNA *ptr, int value)
+{
+       Sequence *seq= (Sequence*)ptr->data;
+       if(value) {
+               seq->flag |= SEQ_USE_CROP;
+               if(seq->strip->crop == NULL) {
+                       seq->strip->crop = MEM_callocN(sizeof(struct 
StripCrop), "StripCrop");
+               }
+       } else {
+               seq->flag ^= SEQ_USE_CROP;
+       }
+}
 /* name functions that ignore the first two characters */
 static void rna_Sequence_name_get(PointerRNA *ptr, char *value)
 {
@@ -546,8 +572,8 @@
 
        prop= RNA_def_property(srna, "use_translation", PROP_BOOLEAN, 
PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM);
-       RNA_def_property_clear_flag(prop, PROP_EDITABLE); // allocate transform
        RNA_def_property_ui_text(prop, "Use Translation", "Translate image 
before processing.");
+       RNA_def_property_boolean_funcs(prop, NULL, 
"rna_SequenceEditor_use_translation_set");
        
        prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "strip->transform");
@@ -555,8 +581,8 @@
 
        prop= RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP);
-       RNA_def_property_clear_flag(prop, PROP_EDITABLE); // allocate crop
        RNA_def_property_ui_text(prop, "Use Crop", "Crop image before 
processing.");
+       RNA_def_property_boolean_funcs(prop, NULL, 
"rna_SequenceEditor_use_crop_set");
 
        prop= RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "strip->crop");


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to