【maya】名前順で同じディレクトリの次のシーンを開く
また書くことになりそうなのでメモです。
実際にはmaファイルでソートした方がよい。
#coding:utf-8
import maya.cmds as cmds
import glob
def main():
filepath = cmds.file(q=True, sn=True)
filename = os.path.basename(filepath)
paths = sorted(glob.glob(filepath.replace(filename,"")+"*"))
isOpen = False
for lp in paths:
lp = lp.replace("\\","/")
if filepath == lp:
isOpen = True
continue
if isOpen == True:
cmds.file(lp,open =True,f=True)
return
else:
cmds.warning(u"次のシーンは存在しません。")
main()
Author And Source
この問題について(【maya】名前順で同じディレクトリの次のシーンを開く), 我々は、より多くの情報をここで見つけました https://qiita.com/tanakou829/items/1bfc1bb80e86254de736著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .