From: Greg Ercolano <erco@(email surpressed)>
Subject: Re: [Q+A] How to add a 'Rush' button into Maya's menu
   Date: Mon, 22 Oct 2007 18:45:48 -0400
Msg# 1634
View Complete Thread (10 articles) | All Threads
Last Next
Gary Jaeger wrote:
> Also, how much can this be customized? 

	Yes, you should be able to get as wild as you want.

> Could the job name be derived from the scene name?

	Sure, MEL has lots of string manipulation commands to parse
	things like show/scene/shot info from the pathname, and pass
	that as the job title to submit-maya on the command line.

	submit-maya in 102.42a8 (and up) lets you preset /any/ of the
	fields in the submit form with the '-field' flag.

	To preset the "Job Title:" field, you would add the following
	to submit-maya's command line:

		-field JobTitle YOUR_TITLE

	..in the RUSH_Submit() function.

	Not that I'm any MEL expert, but if your scene file pathnames
	looked something like this:


//yourserver/jobs/<SHOW>/<SCENE>/<SHOT>/..
     |         |     |      |       |
    [0]       [1]   [2]    [3]     [4]


	..then you should be able to use MEL to parse that out with:


string $scenefile = `file -q -sn`;
string $words[];
tokenize($scenefile, "/", $words);
string $show  = $words[2];
string $scene = $words[3];
string $shot  = $words[4];
string $jobtitle = $show + "/" + $scene + "/" + $shot;


	..which you can then pass as to submit-maya with:


    RUSH_Start("perl " + $submit_maya +
                         " -field ScenePath \"" + $scene + "\" " +
                         " -field Frames " + $sfrm + "-" + $efrm + " " +
                         " -field Renderer \"" + $renderer + "\" "
                         " -field JobTitle \"" + $jobtitle + "\" "
                         );

> And could there be a way to populate the Maya  
> Flags with things like -cam, -x, -y etc?

	I don't know MEL well enough how to get that info, though I assume
	it can be done. Certainly if you can get the info you want, you can
	pass it to the submit-maya script with:

		-field MayaFlags "-cam ... -x ... -y ...";

Last Next