← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 723: Added Yann's (ian57) Space Movie Intro to our animated titles, and I added a new type of widget (...

 

------------------------------------------------------------
revno: 723
fixes bug: https://launchpad.net/bugs/1052990
committer: Jonathan Thomas <Jonathan.Oomph@xxxxxxxxx>
branch nick: openshot
timestamp: Tue 2012-09-25 12:01:43 -0500
message:
  Added Yann's (ian57) Space Movie Intro to our animated titles, and I added a new type of widget (multiline), for parameters that need many lines of text.  Also, I updated a few other animated title XML files to use the multiline, and tweaked the fly_by_1.blend file, to improve the lighting.
added:
  openshot/blender/blend/spacemovie_intro.blend
  openshot/blender/icons/spacemovie_intro.png
  openshot/blender/scripts/spacemovie_intro.py
  openshot/blender/spacemovie_intro.xml
modified:
  openshot/blender/blend/fly_by_1.blend
  openshot/blender/blur.xml
  openshot/blender/colors.xml
  openshot/blender/defocus.xml
  openshot/blender/fly_by_1.xml
  openshot/blender/glare.xml
  openshot/blender/halo_zoom_out.xml
  openshot/blender/neon_curves.xml
  openshot/blender/rotate_360.xml
  openshot/blender/slide_left_to_right.xml
  openshot/blender/wireframe_text.xml
  openshot/windows/BlenderGenerator.py


--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main

Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/blender/blend/fly_by_1.blend'
Binary files openshot/blender/blend/fly_by_1.blend	2011-01-28 19:58:04 +0000 and openshot/blender/blend/fly_by_1.blend	2012-09-25 17:01:43 +0000 differ
=== added file 'openshot/blender/blend/spacemovie_intro.blend'
Binary files openshot/blender/blend/spacemovie_intro.blend	1970-01-01 00:00:00 +0000 and openshot/blender/blend/spacemovie_intro.blend	2012-09-25 17:01:43 +0000 differ
=== modified file 'openshot/blender/blur.xml'
--- openshot/blender/blur.xml	2012-09-17 04:09:20 +0000
+++ openshot/blender/blur.xml	2012-09-25 17:01:43 +0000
@@ -11,7 +11,7 @@
 		<default>TitleFileName</default>
 	</param>
 	
-	<param name="title" type="text" title="Title" description="">
+	<param name="title" type="multiline" title="Title" description="">
 		<default>Title</default>
 	</param>
 	

=== modified file 'openshot/blender/colors.xml'
--- openshot/blender/colors.xml	2012-09-17 04:09:20 +0000
+++ openshot/blender/colors.xml	2012-09-25 17:01:43 +0000
@@ -11,13 +11,13 @@
 		<default>TitleFileName</default>
 	</param>
 	
-	<param name="title1" type="text" title="Title 1" description="">
+	<param name="title1" type="multiline" title="Title 1" description="">
 		<default>Title 1</default>
 	</param>
-	<param name="title2" type="text" title="Title 2" description="">
+	<param name="title2" type="multiline" title="Title 2" description="">
 		<default>Title 2</default>
 	</param>
-	<param name="title3" type="text" title="Title 3" description="">
+	<param name="title3" type="multiline" title="Title 3" description="">
 		<default>Title 3</default>
 	</param>
 	

=== modified file 'openshot/blender/defocus.xml'
--- openshot/blender/defocus.xml	2012-09-17 04:09:20 +0000
+++ openshot/blender/defocus.xml	2012-09-25 17:01:43 +0000
@@ -11,7 +11,7 @@
 		<default>TitleFileName</default>
 	</param>
 	
-	<param name="title" type="text" title="Title" description="">
+	<param name="title" type="multiline" title="Title" description="">
 		<default>Title</default>
 	</param>
 	

=== modified file 'openshot/blender/fly_by_1.xml'
--- openshot/blender/fly_by_1.xml	2012-09-17 04:09:20 +0000
+++ openshot/blender/fly_by_1.xml	2012-09-25 17:01:43 +0000
@@ -11,7 +11,7 @@
 		<default>TitleFileName</default>
 	</param>
 	
-	<param name="title" type="text" title="Title" description="">
+	<param name="title" type="multiline" title="Title" description="">
 		<default>My Title</default>
 	</param>
 	

=== modified file 'openshot/blender/glare.xml'
--- openshot/blender/glare.xml	2012-09-17 04:09:20 +0000
+++ openshot/blender/glare.xml	2012-09-25 17:01:43 +0000
@@ -11,7 +11,7 @@
 		<default>TitleFileName</default>
 	</param>
 	
-	<param name="title" type="text" title="Title" description="">
+	<param name="title" type="multiline" title="Title" description="">
 		<default>My Title</default>
 	</param>
 	

=== modified file 'openshot/blender/halo_zoom_out.xml'
--- openshot/blender/halo_zoom_out.xml	2012-09-17 04:09:20 +0000
+++ openshot/blender/halo_zoom_out.xml	2012-09-25 17:01:43 +0000
@@ -11,7 +11,7 @@
 		<default>TitleFileName</default>
 	</param>
 	
-	<param name="title" type="text" title="Title" description="">
+	<param name="title" type="multiline" title="Title" description="">
 		<default>My Title</default>
 	</param>
 	

=== added file 'openshot/blender/icons/spacemovie_intro.png'
Binary files openshot/blender/icons/spacemovie_intro.png	1970-01-01 00:00:00 +0000 and openshot/blender/icons/spacemovie_intro.png	2012-09-25 17:01:43 +0000 differ
=== modified file 'openshot/blender/neon_curves.xml'
--- openshot/blender/neon_curves.xml	2012-09-17 04:09:20 +0000
+++ openshot/blender/neon_curves.xml	2012-09-25 17:01:43 +0000
@@ -11,7 +11,7 @@
 		<default>TitleFileName</default>
 	</param>
 	
-	<param name="title" type="text" title="Title" description="">
+	<param name="title" type="multiline" title="Title" description="">
 		<default>Title</default>
 	</param>
 	

=== modified file 'openshot/blender/rotate_360.xml'
--- openshot/blender/rotate_360.xml	2012-09-17 04:09:20 +0000
+++ openshot/blender/rotate_360.xml	2012-09-25 17:01:43 +0000
@@ -11,7 +11,7 @@
 		<default>TitleFileName</default>
 	</param>
 	
-	<param name="title" type="text" title="Title" description="">
+	<param name="title" type="multiline" title="Title" description="">
 		<default>My Title</default>
 	</param>
 	

=== added file 'openshot/blender/scripts/spacemovie_intro.py'
--- openshot/blender/scripts/spacemovie_intro.py	1970-01-01 00:00:00 +0000
+++ openshot/blender/scripts/spacemovie_intro.py	2012-09-25 17:01:43 +0000
@@ -0,0 +1,127 @@
+#	OpenShot Video Editor is a program that creates, modifies, and edits video files.
+#   Copyright (C) 2009  Jonathan Thomas
+#
+#	This file is part of OpenShot Video Editor (http://launchpad.net/openshot/).
+#
+#	OpenShot Video Editor is free software: you can redistribute it and/or modify
+#	it under the terms of the GNU General Public License as published by
+#	the Free Software Foundation, either version 3 of the License, or
+#	(at your option) any later version.
+#
+#	OpenShot Video Editor is distributed in the hope that it will be useful,
+#	but WITHOUT ANY WARRANTY; without even the implied warranty of
+#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#	GNU General Public License for more details.
+#
+#	You should have received a copy of the GNU General Public License
+#	along with OpenShot Video Editor.  If not, see <http://www.gnu.org/licenses/>.
+
+
+# Import Blender's python API.  This only works when the script is being
+# run from the context of Blender.  Blender contains it's own version of Python
+# with this library pre-installed.
+import bpy
+
+# Load a font
+def load_font(font_path):
+	""" Load a new TTF font into Blender, and return the font object """
+	# get the original list of fonts (before we add a new one)
+	original_fonts = bpy.data.fonts.keys()
+	
+	# load new font
+	bpy.ops.font.open(filepath=font_path)
+	
+	# get the new list of fonts (after we added a new one)
+	for font_name in bpy.data.fonts.keys():
+		if font_name not in original_fonts:
+			return bpy.data.fonts[font_name]
+		
+	# no new font was added
+	return None
+
+# Debug Info:
+# ./blender -b test.blend -P demo.py
+# -b = background mode
+# -P = run a Python script within the context of the project file
+
+# Init all of the variables needed by this script.  Because Blender executes
+# this script, OpenShot will inject a dictionary of the required parameters
+# before this script is executed.
+params = {		
+			'title' : 'Oh Yeah! OpenShot!',
+			'Alongtimeago' : 'Some cycles ago, in The Grid\nfar, far inside....',
+			'Episode' : 'Episode I.V',
+			'EpisodeTitle' : 'A NEW OPENSHOT',
+			'TitleSpaceMovie' : 'Space\nMovie',
+			'MainText' : 'It is a period of software war. Free software developers have won some battles with free, and open-source applications. They leave the source code available for everybody in the Galaxy, allowing people to access software knowledge and truth.\n\nBut the EULA Galactic Empire is not dead and prepares its revenge with an ultimate weapon: the blue screen of DEATH. This armored system can anihilate an entire device by a simple segfault.\n\nBut the rebel hackers have a secret weapon too: an atomic penguin which protects them from almost all digital injuries...',
+
+			'extrude' : 0.1,
+			'bevel_depth' : 0.02,
+			'spacemode' : 'CENTER',
+			'text_size' : 1.5,
+			'width' : 1.0,
+			'fontname' : 'Bfont',
+			
+			'color' : [0.8,0.8,0.8],
+			'alpha' : 1.0,
+			
+			'output_path' : '/tmp/',
+			'fps' : 24,
+			'quality' : 90,
+			'file_format' : 'PNG',
+			'color_mode' : 'RGBA',
+			'horizon_color' : [0.0, 0.0, 0.0],
+			'resolution_x' : 1920,
+			'resolution_y' : 1080,
+			'resolution_percentage' : 100,
+			'start_frame' : 1,
+			'end_frame' : 2232,
+			'animation' : True,
+		}
+
+#INJECT_PARAMS_HERE
+
+# The remainder of this script will modify the current Blender .blend project
+# file, and adjust the settings.  The .blend file is specified in the XML file
+# that defines this template in OpenShot.
+#----------------------------------------------------------------------------
+
+# Modify Text / Curve settings
+#print (bpy.data.curves.keys())
+bpy.data.objects['Alongtimeago'].data.body = params['Alongtimeago']
+bpy.data.objects['Episode'].data.body = params['Episode']
+bpy.data.objects['EpisodeTitle'].data.body = params['EpisodeTitle']
+bpy.data.objects['TitleStarWars'].data.body = params['TitleSpaceMovie']
+bpy.data.objects['MainText'].data.body = params['MainText']
+
+# Set the render options.  It is important that these are set
+# to the same values as the current OpenShot project.  These
+# params are automatically set by OpenShot
+bpy.context.scene.render.filepath = params["output_path"]
+bpy.context.scene.render.fps = params["fps"]
+try:
+	bpy.context.scene.render.file_format = params["file_format"]
+	bpy.context.scene.render.color_mode = params["color_mode"]
+except:
+	bpy.context.scene.render.image_settings.file_format = params["file_format"]
+	bpy.context.scene.render.image_settings.color_mode = params["color_mode"]
+bpy.data.worlds[0].horizon_color = params["horizon_color"]
+bpy.context.scene.render.resolution_x = params["resolution_x"]
+bpy.context.scene.render.resolution_y = params["resolution_y"]
+bpy.context.scene.render.resolution_percentage = params["resolution_percentage"]
+bpy.context.scene.frame_start = params["start_frame"]
+bpy.context.scene.frame_end = params["end_frame"]
+
+# Animation Speed (use Blender's time remapping to slow or speed up animation)
+animation_speed = int(params["animation_speed"])	# time remapping multiplier
+new_length = int(params["end_frame"]) * animation_speed	# new length (in frames)
+bpy.context.scene.frame_end = new_length
+bpy.context.scene.render.frame_map_old = 1
+bpy.context.scene.render.frame_map_new = animation_speed
+if params["start_frame"] == params["end_frame"]:
+	bpy.context.scene.frame_start = params["end_frame"]
+	bpy.context.scene.frame_end = params["end_frame"]
+
+# Render the current animation to the params["output_path"] folder
+bpy.ops.render.render(animation=params["animation"])
+

=== modified file 'openshot/blender/slide_left_to_right.xml'
--- openshot/blender/slide_left_to_right.xml	2012-09-17 04:09:20 +0000
+++ openshot/blender/slide_left_to_right.xml	2012-09-25 17:01:43 +0000
@@ -11,7 +11,7 @@
 		<default>TitleFileName</default>
 	</param>
 	
-	<param name="title" type="text" title="Title" description="">
+	<param name="title" type="multiline" title="Title" description="">
 		<default>My Title</default>
 	</param>
 	

=== added file 'openshot/blender/spacemovie_intro.xml'
--- openshot/blender/spacemovie_intro.xml	1970-01-01 00:00:00 +0000
+++ openshot/blender/spacemovie_intro.xml	2012-09-25 17:01:43 +0000
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE openshot-effect>
+<effect>
+	<title translatable="True">Space Movie Intro</title>
+	<description translatable="True">Space Movie Intro</description>
+	<icon>spacemovie_intro.png</icon>
+	<category>Video</category>
+	<service>spacemovie_intro.blend</service>
+	
+	<param name="file_name" type="text" title="File Name" description="">
+		<default>TitleFileName</default>
+	</param>
+	
+	<param name="Alongtimeago" type="text" title="First Title" description="">
+		<default>A long time ago in a video\neditor far, far away...</default>
+	</param>
+
+	<param name="TitleSpaceMovie" type="text" title="Flying Title" description="">
+		<default>open\nshot</default>
+	</param>
+
+	<param name="Episode" type="text" title="Episode" description="">
+		<default>Episode IV</default>
+	</param>
+
+	<param name="EpisodeTitle" type="text" title="Episode Title" description="">
+		<default>A NEW OPENSHOT</default>
+	</param>
+
+	<param name="MainText" type="multiline" title="Main Text" description="">
+		<default>It is a period of software war. Free software developers have won some battles with free, and open-source applications. They leave the source code available for everybody in the Galaxy, allowing people to access software knowledge and truth.\n\nBut the EULA Galactic Empire is not dead and prepares its revenge with an ultimate weapon: the blue screen of DEATH. This armored system can anihilate an entire device by a simple segfault.\n\nBut the rebel hackers have a secret weapon too: an atomic penguin which protects them from almost all digital injuries...</default>
+	</param>
+	<param name="start_frame" type="spinner" title="Start Frame" description="">
+		<min>1</min>
+		<max>1</max>
+		<default>1</default>
+	</param>
+	
+	<param name="end_frame" type="spinner" title="End Frame" description="">
+		<min>2232</min>
+		<max>2232</max>
+		<default>2232</default>
+	</param>
+
+	<!-- SPEED -->
+	<param name="animation_speed" type="dropdown" title="Animation Length" description="">
+		<values>
+			<value name="Default" num="1"/>
+			<value name="2X" num="2"/>
+			<value name="3X" num="3"/>
+			<value name="4X" num="4"/>
+			<value name="5X" num="5"/>
+		</values>
+		<default>1</default>
+	</param>
+</effect>

=== modified file 'openshot/blender/wireframe_text.xml'
--- openshot/blender/wireframe_text.xml	2012-09-17 04:09:20 +0000
+++ openshot/blender/wireframe_text.xml	2012-09-25 17:01:43 +0000
@@ -11,7 +11,7 @@
 		<default>TitleFileName</default>
 	</param>
 	
-	<param name="title" type="text" title="Title" description="">
+	<param name="title" type="multiline" title="Title" description="">
 		<default>My Title</default>
 	</param>
 	

=== modified file 'openshot/windows/BlenderGenerator.py'
--- openshot/windows/BlenderGenerator.py	2012-09-25 15:19:03 +0000
+++ openshot/windows/BlenderGenerator.py	2012-09-25 17:01:43 +0000
@@ -173,7 +173,7 @@
 		# get selected effect (if any)
 		selected_effect, unique_id = self.get_selected_effect()
 		real_effect = self.OSTreeBlender.get_real_effect(service=selected_effect)
-		
+
 		if real_effect:
 			
 			# get the selected template .blend name
@@ -241,7 +241,34 @@
 					textbox.connect("changed", self.effect_text_changed, real_effect, param, unique_id)
 					# add to hbox
 					hbox.pack_start(textbox, expand=True, fill=True)
-				
+					
+				elif param.type == "multiline":
+					# add value to dictionary
+					self.params[param.name] = param.default
+					
+					# create new scrolled window
+					scrolled_win = gtk.ScrolledWindow()
+					scrolled_win.set_shadow_type("in")
+					scrolled_win.set_property("hscrollbar_policy", "automatic")
+					scrolled_win.set_property("height-request", 100)
+					
+					# create buffer
+					new_buffer = gtk.TextBuffer()
+					new_buffer.set_text(param.default.replace("\\n","\n"))
+
+					# create spinner
+					textbox = gtk.TextView()
+					textbox.set_buffer(new_buffer)
+					#textbox.set_size_request(width=-1, height=75)
+					#textbox.set_property("height-request", 100)
+					textbox.set_wrap_mode("word")
+					
+					# connect signal 
+					new_buffer.connect("changed", self.effect_multi_text_changed, real_effect, param, unique_id)
+					# add to hbox
+					scrolled_win.add_with_viewport(textbox)
+					hbox.pack_start(scrolled_win, expand=True, fill=True)
+
 				elif param.type == "dropdown":
 					# add value to dictionary
 					self.params[param.name] = param.default
@@ -363,11 +390,20 @@
 		self.params[param.name] = float(widget.get_value())
 		
 	def effect_text_changed(self, widget, real_effect, param, *args):
-		print "effect_spinner_changed"
+		print "effect_text_changed"
 		
 		# Update the param of the selected effect
 		self.params[param.name] = widget.get_text()
 		
+	def effect_multi_text_changed(self, buffer, real_effect, param, *args):
+		print "effect_multi_text_changed"
+		
+		start, end = buffer.get_bounds()
+		updated_text = buffer.get_text(start, end)
+		
+		# Update the param of the selected effect
+		self.params[param.name] = updated_text.replace("\n", "\\n")
+		
 	def effect_color_changed(self, widget, real_effect, param, *args):
 		print "effect_color_changed"