2.5 External animation player:
authorThomas Dinges <blender@dingto.org>
Sat, 23 Jul 2011 21:45:22 +0000 (21:45 +0000)
committerThomas Dinges <blender@dingto.org>
Sat, 23 Jul 2011 21:45:22 +0000 (21:45 +0000)
* 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.

release/scripts/startup/bl_operators/screen_play_rendered_anim.py

index 910ccf96c0e41e96cd3487d7bd8c687e52b07495..8699862d24b4d872c4d16df81f123b2218bb6660 100644 (file)
@@ -59,6 +59,9 @@ def guess_player_path(preset):
 
     elif preset == 'MPLAYER':
         player_path = "mplayer"
+    
+    else:
+        player_path = ""
 
     return player_path
 
@@ -131,12 +134,14 @@ class PlayRenderedAnim(bpy.types.Operator):
             cmd.extend(opts)
         else:  # 'CUSTOM'
             cmd.append(file)
-
-        # launch it
-        try:
-            process = subprocess.Popen(cmd)
-        except:
-            pass
-            #raise OSError("Couldn't find an external animation player.")
+            
+        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
 
         return {'FINISHED'}