Page 3 of 6

Re: Lua script for texture animation?

PostPosted: Tue Dec 09, 2014 2:03 am
by grimm
Excellent! Glad it works. :) On adding in the texture node stuff, I'm going to have to look in to it. I'm thinking that some of that functionality, like the UV transform can be taken care of by hooking up a transform node between the script node and what you are plugging it into. Other items I'm not sure about, ideally the texture node could have an input pin that accepts an image instead of loading it externally. Kind of an input override pin?

Re: Lua script for texture animation?

PostPosted: Tue Dec 09, 2014 4:53 am
by Rikk The Gaijin
grimm wrote:ideally the texture node could have an input pin that accepts an image instead of loading it externally.

That would be perfect.

Re: Lua script for texture animation?

PostPosted: Tue Dec 09, 2014 6:59 am
by grimm
Well, it doesn't quite work that way, but maybe this will work for you. I have only added a UV transform pin but I can add other image texture options. Which ones did you need?

Here is the updated script and an example image:

anim_texture.lua
(2.15 KiB) Downloaded 545 times


at_transform.png

Re: Lua script for texture animation?

PostPosted: Tue Dec 09, 2014 7:32 am
by Rikk The Gaijin
Great! But I also need the Invert button, and then it should be perfect! 8-)

Re: Lua script for texture animation?

PostPosted: Tue Dec 09, 2014 7:43 am
by grimm
Here you go: :D

anim_texture.lua
(2.27 KiB) Downloaded 1057 times

Re: Lua script for texture animation?

PostPosted: Wed Dec 10, 2014 5:52 am
by Rikk The Gaijin
You are the best! 8-)

Re: Lua script for texture animation?

PostPosted: Thu Dec 11, 2014 9:14 am
by blobbybarack
Oh god yes !!!
Should be set as a default script in the next release.
Good job.

Re: Lua script for texture animation?

PostPosted: Thu Dec 11, 2014 10:04 am
by Rikk The Gaijin
blobbybarack wrote:Oh god yes !!!
Should be set as a default script in the next release.
Good job.

Agree! I hope it will. 8-)

Re: Lua script for texture animation?

PostPosted: Fri Dec 12, 2014 8:15 am
by ParviainenArk
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.
hdr_anim_test_01.png

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.
hdr_anim_test_02.png

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.
hdr_anim_test_03.png


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! :D

Re: Lua script for texture animation?

PostPosted: Fri Dec 12, 2014 8:45 am
by Rikk The Gaijin
Wow! That's actually a great idea! Grimm, can you take a look and fix the image loader to support HDR?