Skip to content

Instantly share code, notes, and snippets.

@taikomatsu
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taikomatsu/f599afaa1edf0dfc70af to your computer and use it in GitHub Desktop.
Save taikomatsu/f599afaa1edf0dfc70af to your computer and use it in GitHub Desktop.
Copy a playbast movie file from tmp directory
# 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