Setting project via command line?

Setting project via command line?

Anonymous
Not applicable
1,333 Views
3 Replies
Message 1 of 4

Setting project via command line?

Anonymous
Not applicable

Apologies if this is the wrong forum for the subject.

 

I'm currently pulling my hair out. We are currently implementing a command-line driven project manager running on Windows 7. 

 

The project manager on its own is mostly irrelevant to the problem however. What I am trying to do, is launch Maya from the command line, and set the project using the -proj switch. However, Maya currently does nothing with this switch, and simply loads the previous project into Maya.

 

Running the following command seemingly does nothing useful:

C:\Program Files\Autodesk\Maya2013\bin>maya -proj w:\project_manager\tmp_projec
ts\test_project\

 

Ideally, I want to be able to call Maya from within our Python app and have it launch directly into a specified project - however this isn't happening right now, and I can't see any valid reason why not.

 

Any suggestions would be appreciated, thanks.

0 Likes
Accepted solutions (1)
1,334 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Oh and to also point out, I've also tried:

 

C:\Program Files\Autodesk\Maya2013\bin>maya -command setProject "W:\job_manager\tmp_projects\test_project"

C:\Program Files\Autodesk\Maya2013\bin>maya.exe -script c:\users\*****\project_manager.mel

(project_manager.mel contains the single setProject command from the CLI attempt above)

 

0 Likes
Message 3 of 4

Anonymous
Not applicable
Accepted solution

Weirdly, calling Maya from within Python seems to have solved this problem. 

 

 

0 Likes
Message 4 of 4

Anonymous
Not applicable

Hi

 

I see you've already found a solution but thought I'd just quickly post anyway...your attempt at running Maya with the -command flag would have worked fine if you had encased the command fully and set your brackets the other way round, so this:

 

C:\Program Files\Autodesk\Maya2013\bin>maya -command setProject "W:\job_manager\tmp_projects\test_project"

 

Just needed to be changed to this:

 

C:\Program Files\Autodesk\Maya2013\bin>maya -command "setProject (\"W:/job_manager/tmp_projects/test_project\")";

 

and it will would have worked fine.

 

Cheers

 

Mike