Both of the scripts posted here work great (Thanks stratified and grimm!), but I encounter a problem when trying to use the scripts to animate a HDRi environment. I'm using the HDRi Sky Capture sequence by Paul Debevec et al (
http://gl.ict.usc.edu/Data/skyprobes/), which allows for a fully animated day cycle from sunrise to sunset - just under 700 frames of HDRi sky domes. I'm loading the HDRi sequence using the animated texture script, and feeding that into my Texture Environment. It all works great except for the fact that the script seems to load the HDR textures as LDR images.
Attached are 3 image files that illustrate the problem. The first one is a single frame render with a skyprobe EXR file fed into the Texture Environment. The HDRi has a wide enough range so that the sun casts a sharp shadow, producing a very realistic outcome.
The second image is the result when the exact same EXR is fed into the Animated Texture script (both stratified and grimm's scripts produce identical results). The overall lighting is much darker, and the shadow is nowhere near as sharp.
I suspected that the image is loaded as an LDR texture, so I made a test and saved the EXR as an 8-bit JPG and fed that to the Texture Environment; The result can be seen in the third attachment. I'm not sure if this is indeed the problem since I needed to set the Gamma to 5.0 to produce a similar result as the Animated Texture script.
So, is there anything anyone can do about that? Being able to play back an HDR image sequence as a Texture Environment would be great for animations. If you're curious, just download the HDR Sky Capture sequence from
http://gl.ict.usc.edu/Data/skyprobes/ and see for yourself how awesome it looks to have clouds rolling and sunlight shifting and changing while your animation runs!