Skip to content

Instantly share code, notes, and snippets.

@fereria
Created May 7, 2016 14:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fereria/65229ad51a4158c313ec93fbbb95e68b to your computer and use it in GitHub Desktop.
Save fereria/65229ad51a4158c313ec93fbbb95e68b to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import maya.cmds as mc
import os
def set_project(path):
"""
Mayaのプロジェクトを作成する
"""
if os.path.exists(path) is False:
os.makedirs(path)
if os.path.exists(path + "/workspace.mel") is True:
mc.workspace(path, openWorkspace=True)
else:
mc.workspace(path, openWorkspace=True)
default_rules = {"scene": "scenes",
"images": "images",
"movie": "playblast",
"sourceImages": "sourceimages"}
for key in default_rules:
mc.workspace(fr=(key, default_rules[key]))
if os.path.exists(os.path.join(path, default_rules[key])) is False:
os.makedirs(os.path.join(path, default_rules[key]))
mc.workspace(saveWorkspace=True)
return path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment