[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20776] branches/blender2.5/blender: RNA wrap give_stripelem as getStripElem for sequence strips so the panel can display the current frames filename .

Campbell Barton ideasman42 at gmail.com
Wed Jun 10 08:02:08 CEST 2009


Revision: 20776
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20776
Author:   campbellbarton
Date:     2009-06-10 08:02:08 +0200 (Wed, 10 Jun 2009)

Log Message:
-----------
RNA wrap give_stripelem as getStripElem for sequence strips so the panel can display the current frames filename.

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/space_sequencer.py
    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-10 05:03:27 UTC (rev 20775)
+++ branches/blender2.5/blender/release/ui/space_sequencer.py	2009-06-10 06:02:08 UTC (rev 20776)
@@ -391,7 +391,7 @@
 		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,13 +404,16 @@
 		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")
 		

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-10 05:03:27 UTC (rev 20775)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c	2009-06-10 06:02:08 UTC (rev 20776)
@@ -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 @@
 {
 	StructRNA *srna;
 	PropertyRNA *prop;
+	FunctionRNA *func;
 
 	static const EnumPropertyItem seq_type_items[]= {
 		{SEQ_IMAGE, "IMAGE", "Image", ""}, 
@@ -370,6 +373,13 @@
 	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)





More information about the Bf-blender-cvs mailing list