Page 1 of 1

SOLVED - Queuing jobs on one machine...

Posted: Thu Oct 30, 2008 4:01 am
by flower
Hi all,

I want to set up my one machine to render several mxs files, one after the other. I've seen a post somewhere that says you can use manager and server to get this to work. Does this work on Mac OS?

I've searched the forums for answers, but I'm getting nowhere. I'm a bit clueless as to how to get the manager to work on one machine. I need a step by step guide, please someone.

So far this is what I do.

I have my mxs files saved in my work folder.
I go to the the Maxwell folder in Applications and double click "mxcl manager", and double click "mxcl server"
They both open and two windows appear, one is titled Maxwell Manager, the other Maxwell Server. The text within them ends with "Starting Manager" and "Starting Render Node".
I then open mxcl. The usual display opens.
I go to the Network tab and click Connect - it tells me I'm Connected to 192.168.1.103 (my machine)
and in the Render Farm section to the right the same IP is shown in the list. I click on it to highlight it and then I then click "Add" and the add job window dialog appears, and the IP address is shown in the Render Farm section of this window.
I then click on the little folder to the right of the mxs address bar and navigate to the mxs file I want to render and choose it and click open and I get the following message:

MXS File does not exist or it is Invalid or Obsolete. Please choose a valid MXS.


So what am I doing wrong?


I've tried a Pack and Go from studio and using this mxs. Same result.
I've placed it on the same level as the User folder. Same result.
I've set permissions for the folder and file so that everybody has rw access. Same result.

Any suggestions anybody?

Thanks in advance,
Bim

Mac Pro 2.8 Octo early 2008, 10Gb Ram,

Posted: Thu Oct 30, 2008 11:34 am
by sampson
Well the procedure you're going through is correct, there just seems to be a problem with the mxs. Does it render correctly straight out of Studio?

Posted: Thu Oct 30, 2008 12:03 pm
by flower
Hi Sampson,

Thanks for the quick reply. Glad to hear I'm going through the right motions.

Yes the mxs renders fine straight out of Studio. Both straight from Studio (hitting the render button) and also if I open mxcl and load the mxs and hit Render.

So I'm a bit stumped.

The mxs file is 86 Mb, and there are 41 Mb of textures. The file renders fine at 4000 x 2000 pixels. The renders I'm tryng to queue are at 2000 x 1000 pixels, so no problem with memory.

Any more thoughts?

Thanks,
Bim

Posted: Thu Oct 30, 2008 1:16 pm
by bjorn.syse
Does it render through mxcl command line?

I use this script to batch render a few scenes.
Code: Select all
echo ==================================================
echo Batch renders
echo ==================================================
echo 
echo 
echo Initializing.....
echo 

size=500x500
rendertime=720
samplelevel=20
project_folder="/Users/bjorn/Projects/project folder"
output_folder=$project_folder
job1="filename"
job2="filename2"
job3="filename3"
application_path=/Applications/Maxwell/mxcl.app/Contents/MacOS/

/Applications/Maxwell/mxcl.app/Contents/MacOS/mxcl -mxs:"$project_folder/$job1.mxs" -o:"$output_folder/$job1.png" -mxi:"$output_folder/$job1.mxi" -t:$rendertime -r:$size -s:$samplelevel -channels:r -multilight

#/Applications/Maxwell/mxcl.app/Contents/MacOS/mxcl -mxs:"$project_folder/$job2.mxs" -o:"$output_folder/$job2.png" -mxi:"$output_folder/$job2.mxi" -t:$rendertime -r:$size -s:$samplelevel -channels:r -multilight -nowait

#/Applications/Maxwell/mxcl.app/Contents/MacOS/mxcl -mxs:"$project_folder/$job3.mxs" -o:"$output_folder/$job3.png" -mxi:"$output_folder/$job3.mxi" -t:$rendertime -r:$size -s:$samplelevel -channels:r -multilight -nowait

If you change "project folder" and "filename" (no file extension) accordingly, place it in a file which you make executable, that could do the trick..

regards,

- Björn

Posted: Thu Oct 30, 2008 3:16 pm
by flower
Hi Bjorn,

Thanks for your reply and help.

I've reached my level of incompitence with this. Your post sounds like the thing I need to try, but I'm not techie enough to understand what I'm supposed to do with your script. I can fill in the blanks about file and location, its just what do I do with it then?

Where do I write that script?
How do I make a file executable?

I've literally no idea where to start. I'm not expecting you to waste time on this if there is somewhere I can look to get more information.

Thanks for your help,

Regards,
Bim

Posted: Thu Oct 30, 2008 3:45 pm
by bjorn.syse
Hi Bim,

No problem, I'll guide you through it.

1. Open TextEdit or similar application and enter all that text.
2. Save this file as eg. "batchrender.command" on the desktop. Now the file resides on your computer under your home directory and has the following path: ~/Desktop/batchrender.command

3. Now you have to make this file executable, so that mac os recognize it as a script/application and not just a text file. This has to be done through the terminal. Open Terminal.app and enter the following:
Code: Select all
chmod +x ~/Desktop/batchrender.command
4. Hard part over! Now you can execute your script by just double-clicking on it in finder/on the desktop.

Now to the content of the script. The first portions of text:
Code: Select all
echo ==================================================
echo Batch renders
echo ==================================================
echo
echo
echo Initializing.....
echo
.. are just comments written echoed/printed to the prompt at runtime when the script is executed. Cosmetics that is...

The second part, contains the variables. These are for you to change if needed. They will be used in the render execution (third part)
Code: Select all
size=500x500
rendertime=720
samplelevel=20
project_folder="/Users/bjorn/Projects/project folder"
output_folder=$project_folder
job1="filename"
job2="filename2"
job3="filename3"
application_path=/Applications/Maxwell/mxcl.app/Contents/MacOS/
The first three you can change as you like. The project_folder you can set to the path of the folder where the .MXS file resides. The output_folder will be where the image and MXI are saved. (in the example it is set to the project folder variable)

job1 through 3 is the file name of the MXS scene, but without the file extension (.MXS).

The last part, is where MXCL, Maxwell Render is called to render all the scenes specified in the job1 through 3. The rows with the # in the beginning are currently inactive, which means only the first job will be rendered. Remove the hash (#) if you want to activate these aswell.
Code: Select all
/Applications/Maxwell/mxcl.app/Contents/MacOS/mxcl -mxs:"$project_folder/$job1.mxs" -o:"$output_folder/$job1.png" -mxi:"$output_folder/$job1.mxi" -t:$rendertime -r:$size -s:$samplelevel -channels:r -multilight -nowait

#/Applications/Maxwell/mxcl.app/Contents/MacOS/mxcl -mxs:"$project_folder/$job2.mxs" -o:"$output_folder/$job2.png" -mxi:"$output_folder/$job2.mxi" -t:$rendertime -r:$size -s:$samplelevel -channels:r -multilight -nowait

#/Applications/Maxwell/mxcl.app/Contents/MacOS/mxcl -mxs:"$project_folder/$job3.mxs" -o:"$output_folder/$job3.png" -mxi:"$output_folder/$job3.mxi" -t:$rendertime -r:$size -s:$samplelevel -channels:r -multilight -nowait
Be sure to use the -nowait flag if you are rendering more than one job. Otherwie, Maxwell render will not exit after the first render is done, and the script will stall and not continue unless maxwell render is closed manually.

Hope that helps for a start, just ask if doesn't work for you.

regards,

- Björn

Posted: Thu Oct 30, 2008 4:56 pm
by flower
Hi Bjorn,

Wow, great instructions. I think even I should be able to get this now!

I'll give it a go and see what happens, and report back.

Thank you very much for taking the time to spell it all out like that.

Regards,
Bim

Posted: Fri Oct 31, 2008 1:14 am
by flower
Hi Bjorn,

Well, I tried, but didn't get very far.

I wrote my script file, using Text Edit, changing the various things so they would reflect my machine and filenames and locations. Got that done. Saved to the desktop. Wouldn't allow me to save with .command, so saved with .command.rtf

I then changed the file name with Get Info and knocked off the .rtf

Opened Terminal and typed what you said, and this is what it says:

Last login: Thu Oct 30 22:58:33 on ttys000
Bims-Mac-Pro-2800:~ bim2800$ chmod +x `/Desktop/batchrenderscript1.command
>

If I keep pressing return I keep getting the > symbol. I am assuming its done what its supposed to do, although it didn't say that the first time. So I close the terminal window.

I go to the desktop, double click the .command file, a terminal window opens up and says the following:

Last login: Thu Oct 30 23:04:28 on ttys000
Bims-Mac-Pro-2800:~ bim2800$ /Users/bim2800/Desktop/batchrenderscript1.command ; exit;
/Users/bim2800/Desktop/batchrenderscript1.command: line 1: {rtf1ansiansicpg1252cocoartf949cocoasubrtf350: command not found
/Users/bim2800/Desktop/batchrenderscript1.command: line 2: syntax error near unexpected token `}'
/Users/bim2800/Desktop/batchrenderscript1.command: line 2: `{\fonttbl\f0\fmodern\fcharset0 Courier;}'
logout

[Process completed]

and that is that, no rendering going on.

Sure I've messed up somewhere, but no idea where. Can you tell from the above?

Feel free to drop this if you haven't the time, but I'd really like to get this cracked now that I've started.

Regards,
Bim

Posted: Fri Oct 31, 2008 1:09 pm
by bjorn.syse
Hi Bim,

Seems the saving in the RTF probably is the problem. It adds formatting to the text that shouldn't be there. Are you sure you are using TextEdit? My save dialog looks like this:

Image

- Björn

Posted: Fri Oct 31, 2008 1:17 pm
by bjorn.syse
Also, when changing the permissions of the file (making it executable) in this line:

chmod +x `/Desktop/batchrenderscript1.command

make sure that's a ~ symbol, and not the `like in your line. correct should look like this:

chmod +x ~/Desktop/batchrenderscript1.command

regards,

- Björn

Posted: Fri Oct 31, 2008 1:24 pm
by bjorn.syse
Also, if you check preferences for Finder, you might want to enable Show all file extensions to help you.

Image

Posted: Sat Nov 01, 2008 1:28 am
by flower
Hi Bjorn,

Success!!! :D

My Text Edit peferences were set to create rich text documents, thats why I couldn't save as plain text, so once I changed that preference I was getting there.

I had made problems for myself by naming my Maxwell application folder Maxwell 1.7.1. I don't think it liked the 'dot' in the 1.7.1 in the script, so I had to change the folder name to just Maxwell. That got mxcl to open, but the side effect of renaming the application folder was that none of the texture maps which reside in that folder could be found, so I had to rework my mxs file to re-find all my textures in Studio. The 'Fix Texture Paths' seemed to work for some of the textures but not all. Also with some textures even though I had deleted them from the file, they were still coming up as not being found when I opened the file, really strange and I cant seem to sort that one.

Anyway, once the texture paths were all corrected the script worked great. Thank you very much for your help with this. Greatly appreciated.

Regards,
Bim

Posted: Sat Nov 01, 2008 2:07 pm
by bjorn.syse
Great, I'm glad you made it!

It should be cool to have some sort of droplet-application where one could drag the MXS-file onto and then get them rendered on command..

- Björn

Posted: Sat Nov 01, 2008 4:04 pm
by flower
Bjorn,

Just a quick question. Is there a way of stopping the script mid renders?

I wanted to stop the renders before the whole script has run, so I just quit mxcl. It then jumped to the next in job in the script, I quit again, and repeated this process till I got to then end of the script.

Is there an easier way? Do I just close the terminal window or something?

Thanks,
Bim

Posted: Sat Nov 01, 2008 6:27 pm
by bjorn.syse
Well, there should be. There probably is some unix command to terminate the script. Try 'exit' after the first job.
Code: Select all
/Applications/Maxwell/mxcl.app/Contents/MacOS/mxcl  job1 jada jada... 

exit 

/Applications/Maxwell/mxcl.app/Contents/MacOS/mxcl  job2 jada jada... 
Or, you could use the hash mark # before the renders after the first one to make them "out-commented"/inactive:
Code: Select all

/Applications/Maxwell/mxcl.app/Contents/MacOS/mxcl  job1 jada jada... 


# everything after the hash-mark does not get interpretated in the script.
# so you can use it to comment your code, or make certain lines inactive temporarly
#/Applications/Maxwell/mxcl.app/Contents/MacOS/mxcl  job2 jada jada... 
#/Applications/Maxwell/mxcl.app/Contents/MacOS/mxcl  job3 jada jada... 

have fun, it's addictive.. :)