RNA wrap give_stripelem as getStripElem for sequence strips so the panel can display...
authorCampbell Barton <ideasman42@gmail.com>
Wed, 10 Jun 2009 06:02:08 +0000 (06:02 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 10 Jun 2009 06:02:08 +0000 (06:02 +0000)
release/ui/space_sequencer.py
source/blender/makesrna/intern/rna_sequence.c

index c783fd27b98251d59c98520c520bba7eff832548..c4521bfc1403b474742442349c01b338b4356c3f 100644 (file)
@@ -391,7 +391,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
                if not strip:
                        return False
                
-               return strip.type in ('MOVIE', 'IMAGE', 'SCENE', 'META')
+               return strip.type in ('MOVIE', 'IMAGE', 'SOUND')
        
        def draw(self, context):
                layout = self.layout
@@ -404,12 +404,15 @@ class SEQUENCER_PT_input(SequencerButtonsPanel):
                sub = split.column() 
                sub.itemR(strip, "directory", text="")
                
-               # TODO - get current element!
+               # Current element for the filename
                split = layout.split(percentage=0.3)
                sub = split.column()
                sub.itemL(text="File Name:")
-               sub = split.column() 
-               sub.itemR(strip.elements[0], "filename", text="")
+               sub = split.column()
+               
+               elem = strip.getStripElem(context.scene.current_frame)
+               if elem:
+                       sub.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback
                
                """
                layout.itemR(strip, "use_crop")
index 0cf627a20fc980f1775e647751d5dec2359f0503..357e3bf8bc8f18566a15e0004234a22ea905feaa 100644 (file)
@@ -34,6 +34,8 @@
 #include "DNA_scene_types.h"
 #include "DNA_sequence_types.h"
 
+#include "BKE_sequence.h"
+
 #ifdef RNA_RUNTIME
 
 static int rna_SequenceEditor_name_length(PointerRNA *ptr)
@@ -240,6 +242,7 @@ static void rna_def_sequence(BlenderRNA *brna)
 {
        StructRNA *srna;
        PropertyRNA *prop;
+       FunctionRNA *func;
 
        static const EnumPropertyItem seq_type_items[]= {
                {SEQ_IMAGE, "IMAGE", "Image", ""}, 
@@ -370,6 +373,13 @@ static void rna_def_sequence(BlenderRNA *brna)
        prop= RNA_def_property(srna, "blend_opacity", PROP_FLOAT, PROP_NONE);
        RNA_def_property_range(prop, 0.0f, 100.0f);
        RNA_def_property_ui_text(prop, "Blend Opacity", "");
+       
+       /* funcsions */
+       func= RNA_def_function(srna, "getStripElem", "give_stripelem");
+       RNA_def_function_ui_description(func, "Return the strip element from a given frame or None.");
+       prop= RNA_def_int(func, "frame", 0, INT_MIN, INT_MAX, "Frame", "The frame to get the strip element from", INT_MIN, INT_MAX);
+       RNA_def_property_flag(prop, PROP_REQUIRED);
+       RNA_def_function_return(func, RNA_def_pointer(func, "elem", "SequenceElement", "", "strip element of the current frame"));
 }
 
 void rna_def_editor(BlenderRNA *brna)