Last active
August 29, 2015 14:23
-
-
Save taikomatsu/f599afaa1edf0dfc70af to your computer and use it in GitHub Desktop.
Copy a playbast movie file from tmp directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Playblastをした後にその動画が保存したくなった場合にblast_nameに動画の名前(名前のみでOK)を入力すると | |
# TMPから勝手に引っ張ってきてcurrent_project/moviesにコピーします | |
# ムービーの名前はPlayblastが終わった直後、パスが表示されるのでそれを見て手動で入力してください | |
# UIあるととても便利でしたね(放置中) | |
# copy blast from tmp | |
from pymel.core import * | |
import os | |
import os.path | |
import shutil | |
blast_name = 'blast11.mov' # playblast file name | |
tmp_dir = os.environ['TMP'] | |
cur_proj = workspace(q=True,active=True) | |
scene_name = cmds.file(q=True, sn=True).split('/')[-1].split('.')[0] | |
movie_dir = '%s/movies' % cur_proj | |
if not os.path.isdir(movie_dir): | |
os.makedirs(movie_dir) | |
blast_file = '%s/%s' % (tmp_dir, blast_name) | |
movie_file = '%s/%s.mov' % (movie_dir, scene_name) | |
if os.path.isfile(blast_file): | |
shutil.copy(blast_file, movie_file) # copy overwrite | |
print('[COPY] %s -> %s' % (blast_file, movie_file)) | |
else: | |
print('[ERROR] File not found: %s' % blast_file) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment