enable playing with blenders internal anim player again.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 2 Jul 2012 17:15:48 +0000 (17:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 2 Jul 2012 17:15:48 +0000 (17:15 +0000)
release/scripts/startup/bl_operators/screen_play_rendered_anim.py
release/scripts/startup/bl_ui/properties_render.py
source/blender/editors/interface/resources.c
source/blender/makesrna/intern/rna_userdef.c

index 5ee7cf86142bc02c38a3a68a2093133b82ca23ed..edbd0bc03e0543176e27fab1017346081f6104f8 100644 (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)
index 1ed3638080a199d40e58eb31be53a57392e61a06..74bb720b6189605ded8268130a4900e9ed5b2073 100644 (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")
 
index 407b2308af8003fb28f811ebe736e9f288b416c8..9a965fa8f7fb4dbb4f1f170978013c67cfe31558 100644 (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;
index f4cb4fc58f4e61bb9e6100fb8317ba16d6454761..6fd7bb6776d3ca65f35892f2b0ef42bc21e6c324 100644 (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"},