Quoi qu'il en soit, voilà la dernière version !
Code: Select all
import os
from subprocess import call
#path to tvpaint executable
tvpaint_path = '"/Applications/TVPaint Animation 11 Pro.app"'
#directory where tvpp files are stored.
tvpp_path="/Users/jo/Desktop/EPILOGUE"
#export type, testet with PNG and AVI, other modes are available
export_type='AVI'
#cmd prefix
cmd_prefix = ''
cmd_suffix = ' '
os_usecall = True
print( os.name )
if os.name == 'posix':
cmd_prefix = 'open -n -W -a '
cmd_suffix = ' --args '
os_usecall = False
tvpp_entries = []
all_entries = os.scandir( tvpp_path )
for entry in all_entries:
if entry.is_file():
ext = entry.name.split( "." )[-1]
if( ext == "tvpp" ):
tvpp_entries.append( entry )
for tvpp_entry in tvpp_entries:
full_entry_path = tvpp_path + '/' + tvpp_entry.name
baked_command = cmd_prefix + tvpaint_path + cmd_suffix + '"cmd=tv_LoadProject {}" "cmd=tv_SaveMode {}" "cmd=tv_SaveSequence {}" "cmd=tv_quit"'.format( full_entry_path, export_type, full_entry_path, tvpp_entry.name )
print( baked_command )
if os_usecall:
call( baked_command )
else:
os.system( baked_command )
Testé chez moi sur mac, j'ai pas rencontré de problème, assure-toi quand même d'avoir assez d'espace en mémoire avant d'exporter 280 clips