Since Windows _loves_ to misbehave, better copy your entire Indigo folder to the root of your harddisk (e.g. C:\Indigo_v1.3.3.7) and don't forget to change the path to Indigo.exe in Maxigo!
Simply unzip the contents of the attachment into your "new" Indigo folder (e.g. C:\Indigo_v.1.3.3.7\NetRendering) it contains just my batch script, a freeware utility (ssr.exe) to search+replace text in files via command line and the Source code of that utility.
Here is the Source code of the batch file as well so you don't have to download + "install" the whole package if you just wanted to take a look at the code. I recommend a proper text editor like Notepad++ to view this file, it's much easier if for example comments get colored differently.
Code: Select all
@echo off & setlocal
pushd ..
set IndigoDir=%CD%
set Master=%COMPUTERNAME%
echo Welcome to the net rendering suite for Maxigo!
echo.
echo Please keep a USB stick (or a floppy disk) at hand and fasten your seatbelts,
echo we're going to do some serious network rendering now, cowboy!
echo.
echo ----------------------------------------------------------------------
:sceneselect
echo.
echo Enter the name of a scene file you want to render:
echo (=folder name in .\Exported_From_Max)
set /p Scene=
if exist .\Exported_From_Max\%Scene%\%Scene%.bat goto scenecontinue
:sceneerror
echo Sorry, this doesn't seem to be a valid scene name, please try again!
goto :sceneselect
:scenecontinue
md .\NetRendering\Files\%Scene%
cls
:driveletter
echo Please enter a drive letter that is NOT assigned yet on ANY Slave computer
echo (and will not assigned after you plugged in the stick...)
set /p Drive=
echo.
echo.
:Yesno
echo You selected %Drive%, is that correct? (Y/N)
set /p YesNo=
echo.
if /i %YesNo%==Y goto lettercontinue
if /i %YesNo%==N goto driveletter
echo Now come on, just type Y or N... it isn't that hard!
echo.
goto Yesno
:lettercontinue
cls
echo Alright then, please plug in a USB stick, I'll do some stuff in the meantime...
echo.
rem Network stuff
echo Setting up the network share...
net share IndigoShare=%CD% /unlimited /remark:"Should only be active while rendering..." /cache:no
echo.
rem Change those local paths - UNC Style!
echo Changing paths to nk files in %Scene%-materials.igs if they exist...
popd
start /d%IndigoDir% /wait /b ssr.exe 0 %IndigoDir% \\%Master%\IndigoShare .\Exported_From_Max\%Scene%\%Scene%-materials.igs
pushd ..
echo done
echo.
rem Start me up...
pushd .\NetRendering\Files\%Scene%\
echo Writing Autostart file
echo [AutoRun]>Autorun.inf
echo open=.\NetRenderer\%Scene%\Slave.bat>>Autorun.inf
echo action=Start or stop Indigo Renderer in Slave mode>>Autorun.inf
echo done
echo.
popd
rem Modify initial batch file
echo Writing batch files
pushd Exported_From_Max\%Scene%\
for /F "delims= skip=1" %%a in (%Scene%.bat) do call :Modify "%%a"
:Modify
popd
pushd .\NetRendering\Files\%Scene%\
rem Master batch file
echo @echo off>%Scene%Master.bat
echo cd ../../../ >>%Scene%Master.bat
echo %~1 -n wm>>%Scene%Master.bat
echo exit>>%Scene%Master.bat
rem Slave batch file
echo @echo off>%Scene%Slave.bat
echo if not exist %Drive%: goto Vanilla>>%Scene%Slave.bat
echo taskkill /t /f /im indigo.exe>>%Scene%Slave.bat
echo net use %Drive%: /delete>>%Scene%Slave.bat
echo exit>>%Scene%Slave.bat
echo :Vanilla>>%Scene%Slave.bat
echo net use %Drive%: \\%Master%\IndigoShare /persistent:no /user:Administrator>>%Scene%Slave.bat
echo %Drive%:>>%Scene%Slave.bat
echo %~1 -n s>>%Scene%Slave.bat
echo exit>>%Scene%Slave.bat
popd
popd
echo done
echo.
echo That was fast, huh?
echo.
echo ----------------------------------------------------------------------
echo.
rem Needed to get out of that FOR construction
goto :continue
:continue
echo Now tell me: What letter did Windows assign for that stick you just plugged in?
set /p USB=
if /i %USB%==C goto wrong
if /i %USB%==B goto wrong
if exist %USB%: goto create
:wrong
echo Well, I don't think a USB stick would be mounted *there*...
echo.
goto askletter
:create
echo.
echo Alright, copying files!
pushd .\Files\%Scene%\
xcopy Autorun.inf %USB%: /y /v
md %USB%:\NetRenderer\%Scene%\
xcopy %Scene%Slave.bat %USB%:\NetRenderer\%Scene%\Slave.bat /y /v /i
echo done!
echo.
echo We're nearly ready!
echo Just remove your stick and off we go!
pause
rem I'm comin' up...
echo Starting Network master...
start /b /wait %Scene%Master.bat
popd
popd
echo.
echo done
cls
rem ... so you better get this party started!
echo Please insert the USB stick now to all your slaves.
echo If autostart is disabled, please run the "Slave.bat" file located at USBletter:\NetRenderer\%Scene%\ manually.
echo.
echo To stop the slaves, simply insert the USB stick again and run the batch file on the stick again.
echo.
echo Happy Rendering!
echo.
pause
exit
- Network rendering directly from within Maxigo - it's closed source after all... but I don't think my "batch file"-approach would be very difficult to implement
- Preview rendering: Don't try this at home... you will have to modify parts of the batch file and I honstly don't see any sense in rendering a preview file over the network outside of Max - it is however possible to do so and would also require only a small hack on Maxigo's side
- Network rendering without having to stand up... Man, I really tried but psexec.exe just didn't want as I wanted to! If someone is better than me on that issue, PLEASE help me out! That USB-stick thingie is more of a fast solution but surely shouldn't be permanent...
- On the master computer the network share doesn't get eliminated since the script doesn't know when the master is down... could be a problem depending on your paranoia and on how your network at home is secured. I could maybe fire up another batch instance that just lurks around and checks periodically if indigo.exe is still there.
Please report any errors (or success) here so I can work on with it - maybe even someone who can code (I can't... no really, batch files are difficult enough for me to handle, and they are just simple scripts...) could take this as an input and write his/her own implementation!
Have fun, take care
Sukrim