Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / Auto set project?
  RSS 2.0 ATOM  

Auto set project?
Rate this thread
 
61033
 
Permlink of this thread  
avatar
  • Total Posts: 84
  • Joined: 11 April 2009 09:27 PM

hey there,

I might be missing a crucial part of my maya learning, but is there a way to auto load a project?

Say you have a project for each shot in a pipeline, and when opening an animation file Maya automatic sets the project.



Replies: 1
/img/forum/dark/default_avatar.png

Could you provide more details?
What is not working?

Author: Michael Mueller

Replied: 24 October 2011 06:04 PM  
avatar

i might still be missing something about setting projects in maya, but it doesn’t seem to automaticly set a project when you have a workspace file in the same directory as your maya file.

so i came up with this little code for doing just that.

import maya.cmds as mc

path
=(mc.file(q=True,sn=True))
fileName=(mc.file(q=True,sn=True,shn=True))

if 
fileName!='':
 
temp=path.partition(fileName)
 
mc.workspace(temp[0],openWorkspace=True)
 
 print 
'File Inherit Project Set'
else:
 
mc.workspace(( (mc.optionVarq='ProjectsDir' ))), openWorkspace=True )
 
 print 
'Default Project Set'


Replies: 0