From: Greg Ercolano <erco@(email surpressed)>
Subject: Re: Rush submit menu in Shake
   Date: Thu, 12 Mar 2009 15:47:35 -0400
Msg# 1833
View Complete Thread (4 articles) | All Threads
Last Next
johan aberg wrote:
> The following Shake code will put a menu in Shake that will call Rush's 
> submitscript for Shake. It will pass the name of the current Shake 
> script as a argument to submit-shake.pl. If you modify submit-shake so 
> that it picks up the new argument, all you have to do is to press the 
> update button in submit-shake.pl to set the framerange and fire off the 
> render.

	Since this original newsgroup posting was made (2004),
	all the rush submit scripts now support setting any of the
	fields in the submit form by using the -field command option
	to the submit script.

	For example, to preset the 'Shake Path:' field in the submit form
	to "/some/path/foo.shk", one can invoke the script with:

perl /path/to/RUSH/submit-shake.pl -field ShakePath /some/path/foo.shk

	So to make the example Johan posted work, you don't need to change
	these new submit scripts at all, and would only need to change
	this one line in Johan's shake code from BEFORE to AFTER:

BEFORE: const char* command = stringf("/path/to/RUSH/submit-shake.pl %s &", NRiMainWin1.scriptName);
 AFTER: const char* command = stringf("/path/to/RUSH/submit-shake.pl -field ShakePath %s &", NRiMainWin1.scriptName);
                                                                     ^^^^^^^^^^^^^^^^^^^
	[Thanks to Vincent at Eclair Laboratories for verifying this]

	You can initialize other fields in the submit form this way as well.
	Multiple '-field' options can be specified to initialize several
	fields all at once, eg:

perl /path/to/RUSH/submit-shake.pl \
	-field ShakePath /some/path/foo.shk \
	-field Frames    1-10 \
	-field JobTitle  TESTING_ONE_TWO

	Note that when specifying fields this way, leave out any spaces
	in the field's name. Example: "Shake Path" in the submit form
	becomes "ShakePath" on the command line.



> Put the code in a file.h in Shake's include/startup/ui directory.
> 
> ps. Mind the linewraps
> 
> johan
> 
> ////////////
> 
> extern "C" {
> int system(const char*);
> }
> 
> void CallSystemMenu()
> {	
> const char* command = stringf("/path/to/RUSH/submit-shake.pl %s &", 
> NRiMainWin1.scriptName);
> system(command);
> }
> 
> nuiPushMenu("RushRender");
> nuiMenuItem("Submit Rush Job", CallSystemMenu());
> nuiPopMenu();
> 
> ////////////


Last Next