diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-06-10 10:02:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-06-10 10:02:08 +0400 |
commit | 872767f5c76db75797344b84c056d6cef28248e8 (patch) | |
tree | e9c5dfca7b30b20964123a6b24f062696bd05ac9 | |
parent | b9ef34b6e5c8455638d1e88211e536d0009b3bfa (diff) |
RNA wrap give_stripelem as getStripElem for sequence strips so the panel can display the current frames filename.
-rw-r--r-- | release/ui/space_sequencer.py | 11 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequence.c | 10 |
2 files changed, 17 insertions, 4 deletions
diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index c783fd27b98..c4521bfc140 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -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") diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 0cf627a20fc..357e3bf8bc8 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -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) |