[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38643] trunk/blender/release/scripts/ startup/bl_operators/screen_play_rendered_anim.py: 2. 5 External animation player:

Thomas Dinges blender at dingto.org
Sat Jul 23 23:45:22 CEST 2011


Revision: 38643
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38643
Author:   dingto
Date:     2011-07-23 21:45:22 +0000 (Sat, 23 Jul 2011)
Log Message:
-----------
2.5 External animation player:
* Fixed an error when "Custom" was used and the path was empty (variable reference before assignment)
* The Operator now raises an error if there is no path or the path given is not available. 

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_operators/screen_play_rendered_anim.py

Modified: trunk/blender/release/scripts/startup/bl_operators/screen_play_rendered_anim.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/screen_play_rendered_anim.py	2011-07-23 21:33:04 UTC (rev 38642)
+++ trunk/blender/release/scripts/startup/bl_operators/screen_play_rendered_anim.py	2011-07-23 21:45:22 UTC (rev 38643)
@@ -59,6 +59,9 @@
 
     elif preset == 'MPLAYER':
         player_path = "mplayer"
+    
+    else:
+        player_path = ""
 
     return player_path
 
@@ -131,12 +134,14 @@
             cmd.extend(opts)
         else:  # 'CUSTOM'
             cmd.append(file)
+            
+        if (player_path == "") or (os.path.exists(player_path)==False):
+            self.report({'ERROR'}, "Couldn't find an external animation player")
+        else:
+            # launch it
+            try:
+                process = subprocess.Popen(cmd)
+            except:
+                pass
 
-        # launch it
-        try:
-            process = subprocess.Popen(cmd)
-        except:
-            pass
-            #raise OSError("Couldn't find an external animation player.")
-
         return {'FINISHED'}




More information about the Bf-blender-cvs mailing list