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":
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)
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")
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"},