[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48502] branches/soc-2011-tomato: enable playing with blenders internal anim player again.

Campbell Barton ideasman42 at gmail.com
Mon Jul 2 19:15:50 CEST 2012


Revision: 48502
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48502
Author:   campbellbarton
Date:     2012-07-02 17:15:48 +0000 (Mon, 02 Jul 2012)
Log Message:
-----------
enable playing with blenders internal anim player again.

Modified Paths:
--------------
    branches/soc-2011-tomato/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/properties_render.py
    branches/soc-2011-tomato/source/blender/editors/interface/resources.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_userdef.c

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_operators/screen_play_rendered_anim.py	2012-07-02 17:12:41 UTC (rev 48501)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_operators/screen_play_rendered_anim.py	2012-07-02 17:15:48 UTC (rev 48502)
@@ -28,7 +28,9 @@
 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 @@
 
         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)

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/properties_render.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/properties_render.py	2012-07-02 17:12:41 UTC (rev 48501)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/properties_render.py	2012-07-02 17:15:48 UTC (rev 48502)
@@ -66,6 +66,7 @@
         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")
 

Modified: branches/soc-2011-tomato/source/blender/editors/interface/resources.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/interface/resources.c	2012-07-02 17:12:41 UTC (rev 48501)
+++ branches/soc-2011-tomato/source/blender/editors/interface/resources.c	2012-07-02 17:15:48 UTC (rev 48502)
@@ -1926,9 +1926,6 @@
 	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;

Modified: branches/soc-2011-tomato/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- branches/soc-2011-tomato/source/blender/makesrna/intern/rna_userdef.c	2012-07-02 17:12:41 UTC (rev 48501)
+++ branches/soc-2011-tomato/source/blender/makesrna/intern/rna_userdef.c	2012-07-02 17:15:48 UTC (rev 48502)
@@ -3445,7 +3445,7 @@
 	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"},




More information about the Bf-blender-cvs mailing list