def create_default_project(cls, path, name='DefaultProject'):
"""Creates default maya project structure along with a suitable
workspace.mel file.
:param str path: The path that the default project structure will be
created.
:return:
"""
project_path = os.path.join(path, name)
# lets create the structure
for dir_name in cls.default_project_structure.split('\n'):
dir_path = os.path.join(project_path, dir_name)
try:
os.makedirs(dir_path)
except OSError:
pass
# create the workspace.mel
workspace_mel_path = os.path.join(project_path, 'workspace.mel')
with open(workspace_mel_path, 'w+') as f:
f.writelines(cls.default_workspace_content)
return project_path
评论列表
文章目录