diff options
author | Matt Ebb <matt@mke3.net> | 2009-12-11 11:05:05 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-12-11 11:05:05 +0300 |
commit | 7e7e1018acfb23f0e10d4ae051d002a6516b8d83 (patch) | |
tree | fcaed067bdbda3e02add0843fcbf88b393fb62ae /release/scripts/op/screen_play_rendered_anim.py | |
parent | 877c47fe350de17f58e55358fe28887a8131cca8 (diff) |
Added back rendered animation playback (in a sense), with a
customisable player.
You can choose a player in User Preferences -> File Paths. You can
choose a plan custom command line, otherwise there are presets available
for the Blender 2.4 player or DJV (where it will give it the correct filename,
fps, etc on the command line). So for example if you have a Blender 2.4
version installed, you can enter the path to the blender 2.4 executable,
and the playback will work just like before.
Any info on other frame players (FrameCycler? pdplayer?) and their
command line settings could be useful for adding some more presets too,
if anyone knows of them.
It's available in Render->Play Rendered Animation (Ctrl F11)
Diffstat (limited to 'release/scripts/op/screen_play_rendered_anim.py')
-rw-r--r-- | release/scripts/op/screen_play_rendered_anim.py | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/release/scripts/op/screen_play_rendered_anim.py b/release/scripts/op/screen_play_rendered_anim.py new file mode 100644 index 00000000000..e98fa45cbaa --- /dev/null +++ b/release/scripts/op/screen_play_rendered_anim.py @@ -0,0 +1,99 @@ +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Script copyright (C) Campbell J Barton +# +# This program 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 2 +# of the License, or (at your option) any later version. +# +# This program 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 this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# ***** END GPL LICENCE BLOCK ***** +# -------------------------------------------------------------------------- + +# History +# +# Originally written by Matt Ebb + +import bpy +import subprocess, platform + +# from BKE_add_image_extension() +img_format_exts = { + 'IRIS':'.rgb', + 'RADHDR':'.hdr', + 'PNG':'png', + 'TARGA':'tga', + 'RAWTARGA':'tga', + 'BMP':'bmp', + 'TIFF':'tif', + 'OPENEXR':'exr', + 'MULTILAYER':'exr', + 'CINEON':'cin', + 'DPX':'dpx', + 'JPEG':'jpg', + 'JPEG2000':'jp2', + 'QUICKTIME_QTKIT':'mov', + 'QUICKTIME_CARBON':'mov', + 'AVIRAW':'avi', + 'AVIJPEG':'avi', + 'AVICODEC':'avi', + 'XVID':'avi', + 'THEORA':'ogg', + } + +class PlayRenderedAnim(bpy.types.Operator): + + bl_idname = "screen.play_rendered_anim" + bl_label = "Play Rendered Animation" + bl_register = True + bl_undo = False + + def execute(self, context): + sce = context.scene + rd = sce.render_data + prefs = context.user_preferences + + preset = prefs.filepaths.animation_player_preset + player_path = prefs.filepaths.animation_player + + # try and guess a command line if it doesn't exist + if player_path == '': + if preset == 'BLENDER24': + player_path = 'blender' + elif preset == 'DJV': + player_path = 'djv_view' + + # doesn't support ### frame notation yet + file = "%s%04d" % (rd.output_path, sce.start_frame) + if rd.file_extensions: + file += '.' + img_format_exts[rd.file_format] + + cmd = [player_path] + # extra options, fps controls etc. + if preset == 'BLENDER24': + opts = ["-a", "-f", str(rd.fps), str(rd.fps_base), file] + cmd.extend(opts) + elif preset == 'DJV': + opts = [file, "-playback_speed", str(rd.fps)] + cmd.extend(opts) + else: # 'CUSTOM' + cmd.extend(file) + + # launch it + try: + process = subprocess.Popen(cmd) + except: + pass + + return('FINISHED',) + +bpy.ops.add(PlayRenderedAnim)
\ No newline at end of file |