Created
June 5, 2015 09:47
-
-
Save taikomatsu/4bf29bf8dfcc45db409b to your computer and use it in GitHub Desktop.
Open current working 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
from pymel.core import * | |
import os | |
import os.path | |
path, file = os.path.split(sceneName()) | |
path = os.path.dirname(path).replace('/', '\\') | |
os.popen('explorer "%s"' % path) | |
# -- 5行目の注釈 | |
# Windowsのコマンドプロンプトでexplorerを開く際はパスの区切りがスラッシュだとだめなのでバックスラッシュに直す。 | |
# 通常であればos.path.normpath(os.path.dirname(path))で変更したいところだが、Mayaの場合Windowsでも/を返す為今回は自分で修正。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment