#NEWLINE# def generate_thumbnail( ) : #NEWLINE# #INDENT# 'generates thumbnail for current scene\n    ' #NEWLINE# import tempfile #NEWLINE# import glob #NEWLINE# from anima.env import mayaEnv #NEWLINE# m_env = mayaEnv . Maya ( ) #NEWLINE# v = m_env . get_current_version ( ) #NEWLINE# if ( not v ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( '@' in v . take_name ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# task = v . task #NEWLINE# project = task . project #NEWLINE# imf = project . image_format #NEWLINE# width = int ( ( imf . width * 0.5 ) ) #NEWLINE# height = int ( ( width . height * 0.5 ) ) #NEWLINE# temp_output = tempfile . mktemp ( ) #NEWLINE# current_frame = pm . currentTime ( q = 1 ) #NEWLINE# output_file = pm . playblast ( fmt = 'image' , startTime = current_frame , endTime = current_frame , sequenceTime = 1 , forceOverwrite = 1 , filename = temp_output , clearCache = 1 , showOrnaments = 1 , percent = 100 , wh = ( width , height ) , offScreen = 1 , viewer = 0 , compression = 'PNG' , quality = 70 , framePadding = 0 ) #NEWLINE# pm . currentTime ( current_frame ) #NEWLINE# output_file = output_file . replace ( '####' , '*' ) #NEWLINE# found_output_file = glob . glob ( output_file ) #NEWLINE# if found_output_file : #NEWLINE# #INDENT# output_file = found_output_file [ 0 ] #NEWLINE# from anima.ui import utils #NEWLINE# utils . upload_thumbnail ( task , output_file ) #NEWLINE# #UNINDENT# return found_output_file