Page 1 of 6

Lua script for texture animation?

PostPosted: Thu Dec 04, 2014 3:54 am
by Rikk The Gaijin
Hi, I have a texture sequence of 440 frames of a wet-map generated in RealFlow, and I need to plug it into Octane to render an animation.
I know by default that is not possible, but some of you Lua geniuses around (hello Thomas!) should be able to make one in no time, RIGHT? :twisted:

Seriously, I really need it, can someone help me on this?

Re: Lua script for texture animation?

PostPosted: Fri Dec 05, 2014 12:27 am
by Rikk The Gaijin
Wow, don't reply all together... :cry:

stratified, any thoughts? :(

Re: Lua script for texture animation?

PostPosted: Fri Dec 05, 2014 12:35 am
by face_off
Rikk - I'm sure this would be relatively easy for an LUA guru to put together. Another option is to use one of the plugins - I think most support animated textures (I know the Modo and Poser plugins do).

Paul

Re: Lua script for texture animation?

PostPosted: Fri Dec 05, 2014 2:33 am
by Rikk The Gaijin
face_off wrote:Rikk - I'm sure this would be relatively easy for an LUA guru to put together.

That's what I was hoping for... :cry:

Re: Lua script for texture animation?

PostPosted: Fri Dec 05, 2014 4:01 am
by stratified
Rikk The Gaijin wrote:
face_off wrote:Rikk - I'm sure this would be relatively easy for an LUA guru to put together.

That's what I was hoping for... :cry:


Hey Rikk,

OTOY pays me to do more stuff than only fulfilling script request on the forum. There are a lot of users here on the forum that are able to do something like this. Maybe it's time that you learn yourself some Lua for the greater good? In between I started working on an example of the scripted graph that does texture animation based on a directory of images.

cheers,
Thomas

Re: Lua script for texture animation?

PostPosted: Fri Dec 05, 2014 4:58 am
by Rikk The Gaijin
stratified wrote:Maybe it's time that you learn yourself some Lua for the greater good?

Imagine you are running a bakery, and a customer enters your shop and asks you if you can make raisin bread, would you tell him to start learning bakery and make his own bread? :roll:
If I could write a Lua script I wouldn't ask here, don't you think?
It's not my job, it's not even my field.
stratified wrote:In between I started working on an example of the scripted graph that does texture animation based on a directory of images.

Good to hear, I look forward to that.

Re: Lua script for texture animation?

PostPosted: Fri Dec 05, 2014 8:40 am
by grimm
Sorry Thomas, didn't know you were working on one too. I thought that this would be a perfect opportunity to learn script nodes. :mrgreen:

anim_texture.zip
(850 Bytes) Downloaded 671 times


This script graph will allow you to load a series of images and use it as an image texture. I will post an example of how it work as soon as Vimeo finished processing my file.

To use add a script node and load the script into it. Once loaded it will allow you to choose a file (just choose the first image file) and set the number of digits the filename uses for the numbers. The format is "example_file_name0000.png", in this case the number of digits is 4. Once you have the node setup you can connect it to any image pin on any node with one (diffuse, glossy, emission, etc.). You can also scrub through the animation but the script can not tell which direction you are going in and will just walk through all the images until it errors. To reset the node before you do your final render, reload the script into the node, that will reset everything. There is alot that could be done to make this a better script so YMMV. :D

Jason

Re: Lua script for texture animation?

PostPosted: Fri Dec 05, 2014 8:55 am
by Rikk The Gaijin
Grimm, you are the new master baker! :o
Please post the video ASAP! Thank you!

Re: Lua script for texture animation?

PostPosted: Fri Dec 05, 2014 9:02 am
by grimm
Ok, here is the video, this was rendered in standalone, not through a plugin.



Let me know if you have any problems.

Re: Lua script for texture animation?

PostPosted: Fri Dec 05, 2014 9:08 am
by Rikk The Gaijin
I just tried the script, and it's great! 8-)
The only thing I don't understand, the script seems to rescale the animation time to match the timeline? For example, my animated object has 550 frames, and my textures only have 200 frames, but it seems the texture animation is stretched to 550 frames... Is this correct? I was expecting to see my animation to end at frame 200, that's a problem because it won't match with my animation...