← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 557: Added a new 3D animation called "Glass Slider". It includes a transparent / glass background, an...

 

------------------------------------------------------------
revno: 557
committer: Jonathan Thomas <Jonathan.Oomph@xxxxxxxxx>
branch nick: openshot
timestamp: Mon 2011-09-05 01:40:52 -0500
message:
  Added a new 3D animation called "Glass Slider".  It includes a transparent / glass background, and slides out from the bottom of the screen.
added:
  openshot/blender/blend/glass_slider.blend
  openshot/blender/glass_slider.xml
  openshot/blender/icons/glass_slider.png
  openshot/blender/scripts/glass_slider.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
=== added file 'openshot/blender/blend/glass_slider.blend'
Binary files openshot/blender/blend/glass_slider.blend	1970-01-01 00:00:00 +0000 and openshot/blender/blend/glass_slider.blend	2011-09-05 06:40:52 +0000 differ
=== added file 'openshot/blender/glass_slider.xml'
--- openshot/blender/glass_slider.xml	1970-01-01 00:00:00 +0000
+++ openshot/blender/glass_slider.xml	2011-09-05 06:40:52 +0000
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE openshot-effect>
+<effect>
+	<title translatable="True">Glass Slider</title>
+	<description translatable="True">Transparent glass background with title</description>
+	<icon>glass_slider.png</icon>
+	<category>Video</category>
+	<service>glass_slider.blend</service>
+	
+	<param name="file_name" type="text" title="File Name" description="">
+		<default>TitleFileName</default>
+	</param>
+	
+	<param name="title1" type="text" title="Title" description="">
+		<default>Title 1</default>
+	</param>
+	
+	<param name="extrude" type="spinner" title="Extrude" description="">
+		<min>0.0</min>
+		<max>1.0</max>
+		<default>0.1</default>
+	</param>
+
+	<param name="bevel_depth" type="spinner" title="Bevel Depth" description="">
+		<min>0.0</min>
+		<max>1.0</max>
+		<default>0.02</default>
+	</param>
+	
+	<param name="fontname" type="dropdown" title="Font Name" description="">
+		<values>
+			<value name="Bfont" num="Bfont"/>
+			<value name="FreeMono" num="FreeMono"/>
+			<value name="FreeMonoBold" num="FreeMonoBold"/>
+			<value name="FreeSans" num="FreeSans"/>
+			<value name="FreeSansBold" num="FreeSansBold"/>
+			<value name="FreeSansBoldOblique" num="FreeSansBoldOblique"/>
+			<value name="WenQuanYiMicroHei (Unicode)" num="WenQuanYiMicroHei"/>
+		</values>
+		<default>Bfont</default>
+	</param>
+
+	<param name="text_size" type="spinner" title="Text Size" description="">
+		<min>0.0</min>
+		<max>10.0</max>
+		<default>1.0</default>
+	</param>
+	
+	<param name="start_x" type="spinner" title="X Coordinate" description="">
+		<min>-10.0</min>
+		<max>10.0</max>
+		<default>-2.4</default>
+	</param>
+	
+	<param name="start_z" type="spinner" title="Z Coordinate" description="">
+		<min>-10.0</min>
+		<max>10.0</max>
+		<default>0.60</default>
+	</param>
+	
+	<param name="width" type="spinner" title="Text Width" description="">
+		<min>0.0</min>
+		<max>10.0</max>
+		<default>1.0</default>
+	</param>
+
+	<param name="diffuse_color" type="color" title="Diffuse Color" description="">
+		<default>#242326</default>
+	</param>
+	
+	<param name="specular_color" type="color" title="Specular Color" description="">
+		<default>#ffffff</default>
+	</param>
+
+	<param name="specular_intensity" type="spinner" title="Specular Intensity" description="">
+		<min>0.0</min>
+		<max>1.0</max>
+		<default>0.5</default>
+	</param>
+	
+	
+	<param name="diffuse_color_bg" type="color" title="Background: Diffuse Color" description="">
+		<default>#DFDCE7</default>
+	</param>
+	
+	<param name="specular_color_bg" type="color" title="Background: Specular Color" description="">
+		<default>#ffffff</default>
+	</param>
+	
+	<param name="specular_intensity_bg" type="spinner" title="Background: Specular Intensity" description="">
+		<min>0.0</min>
+		<max>1.0</max>
+		<default>0.5</default>
+	</param>
+	
+	<param name="alpha_bg" type="spinner" title="Background: Alpha" description="">
+		<min>0.0</min>
+		<max>1.0</max>
+		<default>0.733</default>
+	</param>
+	
+	<param name="fresnel_bg" type="spinner" title="Background: Fresnel" description="">
+		<min>0.0</min>
+		<max>5.0</max>
+		<default>2.6</default>
+	</param>
+	
+	<param name="blend_bg" type="spinner" title="Background: Blend" description="">
+		<min>0.0</min>
+		<max>5.0</max>
+		<default>2.18</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>180</min>
+		<max>180</max>
+		<default>180</default>
+	</param>
+</effect>

=== added file 'openshot/blender/icons/glass_slider.png'
Binary files openshot/blender/icons/glass_slider.png	1970-01-01 00:00:00 +0000 and openshot/blender/icons/glass_slider.png	2011-09-05 06:40:52 +0000 differ
=== added file 'openshot/blender/scripts/glass_slider.py'
--- openshot/blender/scripts/glass_slider.py	1970-01-01 00:00:00 +0000
+++ openshot/blender/scripts/glass_slider.py	2011-09-05 06:40:52 +0000
@@ -0,0 +1,171 @@
+#	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!',
+			'extrude' : 0.1,
+			'bevel_depth' : 0.02,
+			'spacemode' : 'LEFT',
+			'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.57, 0.57, 0.57],
+			'resolution_x' : 1920,
+			'resolution_y' : 1080,
+			'resolution_percentage' : 100,
+			'start_frame' : 20,
+			'end_frame' : 25,
+			'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.
+#----------------------------------------------------------------------------
+
+# TITLE 1 - Modify Text / Curve settings
+text_object1 = bpy.data.curves["Title1"]
+text_object1.extrude = params["extrude"]
+text_object1.bevel_depth = params["bevel_depth"]
+text_object1.body = params["title1"]
+text_object1.align = params["spacemode"]
+text_object1.size = params["text_size"]
+text_object1.space_character = params["width"]
+# Get font object
+font = None
+if params["fontname"] != "Bfont":
+	# Add font so it's available to Blender
+	font = load_font(params["fontname"])
+else:
+	# Get default font
+	font = bpy.data.fonts["Bfont"]
+text_object1.font = font
+
+
+# TITLE - Change the material settings (color, alpha, etc...)
+material_object1 = bpy.data.materials["Title.Material"]
+material_object1.diffuse_color = params["diffuse_color"]
+material_object1.specular_color = params["specular_color"]
+material_object1.specular_intensity = params["specular_intensity"]
+material_object1.alpha = params["alpha"]
+
+# GLASS - Change the material settings (color, alpha, etc...)
+material_object2 = bpy.data.materials["Background.Material"]
+material_object2.diffuse_color = params["diffuse_color_bg"]
+material_object2.specular_color = params["specular_color_bg"]
+material_object2.specular_intensity = params["specular_intensity_bg"]
+material_object2.alpha = params["alpha_bg"]
+material_object2.raytrace_transparency.fresnel = params["fresnel_bg"]
+material_object2.raytrace_transparency.fresnel_factor = params["blend_bg"]
+
+# ADJUST STARTING POSITION (Keyframes)
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[0].co = (40.0, params["start_x"])
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[0].handle_left.y = params["start_x"]
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[0].handle_right.y = params["start_x"]
+
+#bpy.data.actions["TextAction"].fcurves[2].keyframe_points[0].co = (40.0, params["start_z"])
+#bpy.data.actions["TextAction"].fcurves[2].keyframe_points[0].handle_left.y = params["start_z"]
+#bpy.data.actions["TextAction"].fcurves[2].keyframe_points[0].handle_right.y = params["start_z"]
+
+
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[1].co = (80.0, params["start_x"])
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[1].handle_left.y = params["start_x"]
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[1].handle_right.y = params["start_x"]
+
+bpy.data.actions["TextAction"].fcurves[2].keyframe_points[1].co = (80.0, params["start_z"])
+bpy.data.actions["TextAction"].fcurves[2].keyframe_points[1].handle_left.y = params["start_z"]
+bpy.data.actions["TextAction"].fcurves[2].keyframe_points[1].handle_right.y = params["start_z"]
+
+
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[2].co = (150.0, params["start_x"])
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[2].handle_left.y = params["start_x"]
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[2].handle_right.y = params["start_x"]
+
+bpy.data.actions["TextAction"].fcurves[2].keyframe_points[2].co = (150.0, params["start_z"])
+bpy.data.actions["TextAction"].fcurves[2].keyframe_points[2].handle_left.y = params["start_z"]
+bpy.data.actions["TextAction"].fcurves[2].keyframe_points[2].handle_right.y = params["start_z"]
+
+
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[3].co = (190.0, params["start_x"])
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[3].handle_left.y = params["start_x"]
+bpy.data.actions["TextAction"].fcurves[0].keyframe_points[3].handle_right.y = params["start_x"]
+
+#bpy.data.actions["TextAction"].fcurves[2].keyframe_points[3].co = (190.0, params["start_z"])
+#bpy.data.actions["TextAction"].fcurves[2].keyframe_points[3].handle_left.y = params["start_z"]
+#bpy.data.actions["TextAction"].fcurves[2].keyframe_points[3].handle_right.y = params["start_z"]
+
+# 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"]
+#bpy.context.scene.render.quality = params["quality"]
+bpy.context.scene.render.file_format = params["file_format"]
+bpy.context.scene.render.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"]
+
+# Render the current animation to the params["output_path"] folder
+bpy.ops.render.render(animation=params["animation"])
+