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.
This commit is contained in:
Thomas Dinges 2011-07-23 21:45:22 +00:00
parent 742225d9b4
commit 39edc53558

@ -60,6 +60,9 @@ def guess_player_path(preset):
elif preset == 'MPLAYER': elif preset == 'MPLAYER':
player_path = "mplayer" player_path = "mplayer"
else:
player_path = ""
return player_path return player_path
@ -132,11 +135,13 @@ class PlayRenderedAnim(bpy.types.Operator):
else: # 'CUSTOM' else: # 'CUSTOM'
cmd.append(file) cmd.append(file)
# launch it if (player_path == "") or (os.path.exists(player_path)==False):
try: self.report({'ERROR'}, "Couldn't find an external animation player")
process = subprocess.Popen(cmd) else:
except: # launch it
pass try:
#raise OSError("Couldn't find an external animation player.") process = subprocess.Popen(cmd)
except:
pass
return {'FINISHED'} return {'FINISHED'}