[Closed] Script Controller Not Evaluating on Render
I’ve also run into situations where, for one reason or another, a script controller or pre-render script wouldn’t update correctly at render time, but would work fine rendering one frame at a time or scrubbing the timeline. So my solution, and I’m not saying it the best way to do this, was to write a simple script to render a frame, move the time slider forward one frame, render again, and so on. It’s totally brute force and if you find a more elegant way to get your script controller working then use it. But this method will definitely work in a pinch.
Here’s the script I use:
fn zeroPad num = (
local n = num as string
if num >= 0 and num < 10 then ("000" + n)
else if num > 9 and num < 100 then ("00" + n)
else if num > 99 and num < 1000 then ("0" + n)
else n
)
renderSceneDialog.commit()
if rendOutputFilename == "" then messagebox "Specificy a file name in the Render Output section of the Render dialog box."
else (
totalFrames = ((animationRange.end - animationRange.start) as integer) * framerate / 4800
escapeEnable = true
progressStart "Rendering..."
for i = animationRange.start to animationRange.end do (
sliderTime = i
n = zeroPad (i as integer / 160)
render vfb:false outputFile:((getFilenamePath rendOutputFilename) + (getFilenameFile rendOutputFilename) + n + (getFilenameType rendOutputFilename))
progressUpdate (100.0 * i / totalFrames )
if getProgressCancel() do exit
)
progressEnd()
)
Just set the output path in the render dialog like you normally would, , as well as start and end range of the time slider, and then run the script.
Hi
JHaywood
Thanks for that hint. I will give it a try. This problem appears to be stuck in this Scene and I cannot at the moment reproduce it and I cant release the original. If I can get a simple version of this working I will post it.
Thanks for your help guys. I will try the force approach and see how it works.
H