Forum Replies Created
-
25th September 2013 at 9:06 pm #15234
Hello,
I came across the same problem, but gave up trying to find the folder names. I decided to create the folder names and write down the ID number associated with it. In my script I just use the ID number for the parent folder. Here is a partial code I use to build the cmdline for submission where I add the parent folder ( in Python ):
cmdline = ‘%s -parent %d’ % (cmdline,1854) #This ID matches an already created folder called Quicktimes
What I then do in Muster is make sure that users cannot delete jobs belonging to others. This way that folder doesn’t “accidentally” disappear.
I agree it would be nice to be able to query Muster to find all the IDs belonging to all the folders, but I have no idea as to how or if Muster tracks folder IDs differently than job submissions.
Andrew
9th September 2013 at 3:30 pm #15233Here is how I use Python in combination with Muster. Basically I use it as a wrapper to pre-process information before sending it off to render. There are a few things you need to do first to set it up.
1. set up Job Submission Templates
2. Set up render blades to receive muster commands
3. Set up Python file to receive muster command1. Set up the Job Submission Templates.
I’ll use one example I have here where I send a file plus the output directory to my Python script. The Job Submission Template will have the custom GUI input boxes.
ECLARE TEMPLATE
{SET TEMPLATE_NAME “Houdini”
SET TEMPLATE_DESC “Houdini rendering”
SET TEMPLATE_UID 51
SET TEMPLATE_LOGIC MULTIFRAME
SET DEFAULT_PRIORITY 1
SET DEFAULT_POOL “Houdini”
SET MAXIMUM_LICENSES 15
SET DELAY_GROUP “Global”
SET DELAY_TIME 0
}DECLARE MULTIFRAME
{
SET ENABLE_FRAME_CHECK 1
}DECLARE SUBMISSION
{
SET ENABLE_ADDITIONAL_FLAGS 1ADD HOUFILENAME FILE_SELECTOR “” “Houdini scene file” “Specify a houdini file.” NOTACTIVABLE MANDATORY SUBST *.*
ADD HOUPROJECTPATH FOLDER_SELECTOR “” “Department Directory” “Specify the department path” NOTACTIVABLE MANDATORY SUBST
ADD HOURENDERPATH FOLDER_SELECTOR “” “Image destination” “Specify image output folder” ACTIVABLE MANDATORY NOSUBST
ADD HOUSTARTFRAME INTEGER_INPUT “1” “Start frame” “Specify the starting frame for the rendering job” NOTACTIVABLE MANDATORY NOSUBST
ADD HOUENDFRAME INTEGER_INPUT “1” “End frame” “Specify the ending frame for the rendering job” NOTACTIVABLE MANDATORY NOSUBST
ADD HOUBYFRAME INTEGER_INPUT “1” “By frame” “Specify the frame step for the rendering job” NOTACTIVABLE MANDATORY NOSUBSTSET BUILDHOUFILE FILE_BUILDER HOUFILENAME HOUFILENAME 1 “#”
SET GUESSPROJECTPATH PATH_BUILDER HOUPROJECTPATH HOUFILENAME “\scenes” “”
SET GUESSPROJECTPATH2 PATH_BUILDER HOURENDERPATH HOUFILENAME “\scenes” “\renders”# Map fields to Muster internal start/end/by frame values
MAP start_frame HOUSTARTFRAME
MAP end_frame HOUENDFRAME
MAP by_frame HOUBYFRAME
MAP job_file HOUFILENAME
MAP job_project HOUPROJECTPATH
MAP output_folder HOURENDERPATH}
With the mapping set you can then use it with the command line output in Muster. Here is a partial code:
DECLARE ENGINE_LINUX
{SET PLATFORM_ENABLED 1
SET ENABLE_ERROR_CHECK 1
SET ENABLED_BY_DEFAULT 1
SET FRAMESFLOATS 0
SET COMMAND_LINE “%ATTR(output_folder) %ATTR(job_file)”This part will send the output path and file name gathered from the user input in the Muster Console and send it to the python file. In my case I have all the rendr blades on a Linux environment.
2. Set up render blades to receive muster commands
In the Muster Console, looking at the Instances view, pick a machine to test on. Right-click on this machine and select Configuration->Configure. This will pop up another window showing some option configurations. Select Templates. You will see all the Job Submission Templates. Select the one you were just editing. When you click on the arrow button beside the Template name you will see three options, Executable,Executable Home, and Executable starting folder. For the executable put a directory all the render blades can access. In my case I have a /p/script/muster directory with all my scripts. In there I have created a Python script, so the three lines will look like:
executable: /p/scripts/muster/python_script_name.py
executable home: /p/scripts/muster
executable starting folder: /p/scripts/muster3. Set up Python file to receive muster command
Now I have a Python file that will receive the command from Muster with all the options as arguments. It will look like this:
start
#!/usr/bin/pythonfrom optparse import OptionParser
import osparser = OptionParser()
(options, args) = parser.parse_args()print ‘Receiving commands from muster. Submitting now…’
output_dir = args[0]
sceneFile = args[1]
print ‘Received all the arguements as:nScene File:%snOutput Folder: %s’ % (sceneFile,output_dir)
end
This is a bare bones script for testing. When you submit a render from within the Muster console, it will be re-directed to your python script. You can see the output of this transaction by going to the Muster Console and right-clicking on the render blade you submitted to ( just specify the Include Pool option to the specific instance machine ) and select the Workstation Logs option (CTRL-J). This will pop up all the transactions with Muster and that machine. You can then read all the outputs from your Python file. Double click on the log with the latest time stamp.Hope this helps,
Andrew6th September 2013 at 3:00 pm #15232Hello,
I’m not sure exactly what you’re trying to do by submitting a python file, but I’ll give you an example of how I’m using Python with Muster.
I use Python as a wrapper to pre-process information before submitting a render. I have my python scripts in a drive all the render blades can see. In my case it’s something like:
/p/scripts/muster
If I open the Muster console I can configure the way any of the blades handle each job submission template. For example I created a Job Submission Template called Vray_Caching. In that template I created some submission parameters to pass to the Python script:
DECLARE SUBMISSION
{
SET ENABLE_ADDITIONAL_FLAGS 1ADD VRAYFILENAME FILE_SELECTOR “” “Maya File” “Specify the Maya file to export from” NOTACTIVABLE MANDATORY SUBST *.*
ADD PRERENDERSCRIPT FILE_SELECTOR “” “Pre-Render Script File” “Specify the pre-render script mel file” NOTACTIVABLE MANDATORY SUBST *.*
ADD VRAYOUTDIR FOLDER_SELECTOR “” “Vrscene directory” “Specify the output path for the vrscene files” NOTACTIVABLE MANDATORY SUBST
ADD VRAYSTARTFRAME INTEGER_INPUT “1” “Start frame” “Specify the starting frame for the rendering job” NOTACTIVABLE MANDATORY NOSUBST
ADD VRAYENDFRAME INTEGER_INPUT “1” “End frame” “Specify the ending frame for the rendering job” NOTACTIVABLE MANDATORY NOSUBST
ADD VRAYBYFRAME INTEGER_INPUT “1” “By frame” “Specify the frame step for the rendering job” NOTACTIVABLE MANDATORY NOSUBST# Map fields to Muster internal start/end/by frame values
MAP job_file VRAYFILENAME
MAP pre_render PRERENDERSCRIPT
MAP out_dir VRAYOUTDIR
MAP start_frame VRAYSTARTFRAME
MAP end_frame VRAYENDFRAME
MAP by_frame VRAYBYFRAME
}Then I send these to my python script:
DECLARE ENGINE_LINUX
{SET PLATFORM_ENABLED 1
SET ENABLE_ERROR_CHECK 1
SET ENABLED_BY_DEFAULT 1
SET FRAMESFLOATS 0
#need to send in the following order
# file name
# pre render script file
# output directory. This is sent so the render blade can create the directory and set the permissions if needed
# start frame
# end frame
# by frameSET COMMAND_LINE “%ATTR(job_file) %ATTR(pre_render) %ATTR(out_dir) %ATTR(start_frame) %ATTR(end_frame) %ATTR(by_frame)”
This command line is sent as arguments to the script. Before submitting this job, I configure the render blade by opening the Muster Console and right-clicking on any computer node. This will give you a list of options. Choose Configuration->Configure. This will pop up another window. Select Templates, then select the Job Submission Template. In my case it’s Vray_Caching. You can then direct that submission to a python script. From the command line above each argument is sent to python. In my Python script I will have something to parse the arguments then run my Maya Render command with those arguments.
There is nothing stopping you from using the print statements instead for testing. Going back to the Muster Console you can see the output of those print statements by opening the workstation log for that render blade.
I hope this ramble has helped.
Andrew25th June 2012 at 3:54 pm #15198I changed a few lines and it seems to be working:
DECLARE CONFIGURABLE_TAGS
{
ADD VRAYEXECUTABLE FILE_SELECTOR “/apps/maya2012-x64/vray/bin/vray” “Vray executable” “Specify the Vray render executable” NOTACTIVABLE MANDATORY *.exe
ADD VRAYHOME FOLDER_SELECTOR “/apps/maya2012-x64/vray” “Location of Vray home” “Specify the starting folder for the render process” NOTACTIVABLE MANDATORY
ADD VRAYSTARTINGFOLDER FOLDER_SELECTOR “/apps/maya2012-x64/vray/bin” “Location of Vray starting folder” “Specify the starting folder for the render process” NOTACTIVABLE MANDATORY
}SET APPFINDER “VRAY” EXECUTABLE vray
#MAP VRAYEXECUTABLE “%ATTR(APPPATH)/%ATTR(APPBIN)”
MAP VRAYEXECUTABLE “%ATTR(APPBIN)”
MAP VRAYHOME “%ATTR(APPPATH)”
MAP VRAYSTARTINGFOLDER “%ATTR(APPPATH)”I changed the VRAYHOME FOLDER_SELECTOR and changed the mapping of the executable. On some of my render machines I get a message like the following:
Invalid executable /apps/maya2012-x64/vray/bin/vray
but on one machine I get vray starting and opening the vrscene file. Then it stops because it can’t get a license. I think I can figure out why this is happening now that I have the proper feedback. I just wish there was better error management. For the longest time all I saw was:
Invalid executable
15th June 2012 at 1:54 pm #15196For now, since I don’t really have the time to find out why this is happening, I changed the frameLayout -collapsable from one to zero and hardcoded the height for every instance.
string $MS_FramesFrame = `frameLayout -bs “etchedIn” -collapsable 0 -label “Frame ranges” -w 420 -h 170`;
I’ll have to find out why later.
Drew -