enable playing with blenders internal anim player again.

This commit is contained in:
Campbell Barton
2012-07-02 17:15:48 +00:00
parent f80ea57d31
commit 8d384435ad
4 changed files with 6 additions and 31 deletions

View File

@@ -28,7 +28,9 @@ import os
def guess_player_path(preset):
import sys
if preset == 'BLENDER24':
if preset == 'INTERNAL':
return bpy.app.binary_path
elif preset == 'BLENDER24':
player_path = "blender"
if sys.platform == "darwin":
@@ -110,32 +112,7 @@ class PlayRenderedAnim(Operator):
cmd = [player_path]
# extra options, fps controls etc.
if preset == 'BLENDER24':
# -----------------------------------------------------------------
# Check blender is not 2.5x until it supports playback again
try:
process = subprocess.Popen([player_path, '--version'],
stdout=subprocess.PIPE,
)
except:
# ignore and allow the main execution to catch the problem.
process = None
if process is not None:
process.wait()
out = process.stdout.read()
process.stdout.close()
out_split = out.strip().split()
if out_split[0] == b'Blender':
if not out_split[1].startswith(b'2.4'):
self.report({'ERROR'},
"Blender %s doesn't support playback: %r" %
(out_split[1].decode(), player_path))
return {'CANCELLED'}
del out, out_split
del process
# -----------------------------------------------------------------
if preset in {'BLENDER24', 'INTERNAL'}:
opts = ["-a", "-f", str(rd.fps), str(rd.fps_base),
"-j", str(scene.frame_step), file]
cmd.extend(opts)

View File

@@ -66,6 +66,7 @@ class RENDER_PT_render(RenderButtonsPanel, Panel):
row = layout.row()
row.operator("render.render", text="Image", icon='RENDER_STILL')
row.operator("render.render", text="Animation", icon='RENDER_ANIMATION').animation = True
row.operator("render.play_rendered_anim", text="Play", icon='RENDER_ANIMATION')
layout.prop(rd, "display_mode", text="Display")

View File

@@ -1926,9 +1926,6 @@ void init_userdef_do_versions(void)
if (U.dbl_click_time == 0) {
U.dbl_click_time = 350;
}
if (U.anim_player_preset == 0) {
U.anim_player_preset = 1;
}
if (U.scrcastfps == 0) {
U.scrcastfps = 10;
U.scrcastwait = 50;

View File

@@ -3445,7 +3445,7 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
StructRNA *srna;
static EnumPropertyItem anim_player_presets[] = {
/*{0, "INTERNAL", 0, "Internal", "Built-in animation player"}, *//* doesn't work yet! */
{0, "INTERNAL", 0, "Internal", "Built-in animation player"}, /* doesn't work yet! */
{1, "BLENDER24", 0, "Blender 2.4", "Blender command line animation playback - path to Blender 2.4"},
{2, "DJV", 0, "Djv", "Open source frame player: http://djv.sourceforge.net"},
{3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"},