View Full Version : Emergency Stitching Script.
01 January 2009, 08:19 PM
For those who use Strip Rendering there's a bug in 3dsmax 9 that often causes painful headaches. If the filename has a integer on the end sometimes backburner will fail to stitch the pass together. And after a 13hour render near deadline that can be quite painful. There's a script in photoshop online somewhere (i've lost it) that can help you stitch the renders back together (requiring figuring out the maths, more on this later)
We had one such emergency today and I managed to quickly bodge something together in maxscript to save the day.
Made a 1x1 Plane the size of 1 strip. Used Array to instance that down for all the strips, then used this script to put the strip maps on the strips.
files = getFiles "C:\\test\*.tga"
i = 1
for f in files do (
newmat = Standardmaterial()
newmat.selfillumination = 100
newmat.diffusemap = Bitmaptexture fileName:f
newmat.diffusemap.coords.blur = 0.01
$selection[i].material = newmat
i = i+1
Then rendered this and got something which whilst wasn't pixel perfect, surficed and saved the day!
So I want to improve this script now for the next emergency. So problems...
1. Strip height and overlay...
Even though we specify with no overlay backburner renders strips bigger than necessary. For example. My Render 10000x8994
1st strip is 60 high
the other 199 are 68 pixels.
So for an image 8994, divided by 200 is almost 45, so I used that as my incremental and bodged the first overlap. But I wondering if anyone knows how backburner divides it all up so I can automate replicating the strip layout.
2. Render exact size?
So how Can I select a bunch of objects and Render just those objects. Like Crop Selected Render, but then define the final width/height I want. Is there an easy way to align a Orthographic Camera Frustrum to a plane?
Or does anyone have any other suggestions of how one could replicate the stitching task?
01 January 2009, 10:55 PM
Why don't you just create a callback which stops render output files being saved with a trailing digit as this is the real cause of the problem? Save the callback as startup.ms in your scripts\startup folder and deploy to all artists. Job done.
01 January 2009, 12:32 AM
Why not just rename the saved files to what they are suppose to be and rerun the Stitch job. All of which should be possible through maxscript, if you must. I have personally had to do that on a few jobs, simple rename and restart the stitch job and no problems.
Edit: Another option would be try using the composite map and then do a rendermap() call to put it all together. Or you could manually build the bitmap using maxscript.
01 January 2009, 01:07 AM
I've used the renaming method before but found it doesn't always work... Backburner seems to have weird ways of naming strips.
I thought perhaps using the max bitmap might be the better way to do it, but still got the problem of working out the overlap issue.
01 January 2009, 01:13 AM
If it is missing a strip it will tell you the name. Then you just need to change everything after the STP0000- part of the name, which simply indicates the strip number. After the - is the file name from the render dialog, or in this case the error report.
01 January 2009, 01:13 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.