Lua script for texture animation?

Forums: Lua script for texture animation?
Forum for OctaneRender Lua scripting examples, discussion and support.

Lua script for texture animation?

Postby Rikk The Gaijin » Thu Dec 04, 2014 3:54 am

Rikk The Gaijin Thu Dec 04, 2014 3:54 am
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?
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1501
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

Postby Rikk The Gaijin » Fri Dec 05, 2014 12:27 am

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

stratified, any thoughts? :(
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1501
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

Postby face_off » Fri Dec 05, 2014 12:35 am

face_off Fri Dec 05, 2014 12:35 am
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
Win7/Win10/Mavericks/Mint 17 - GTX550Ti/GT640M
Octane Plugin Support : Poser, ArchiCAD, Revit, Inventor, AutoCAD, Rhino, Modo, Nuke, DAZ Studio
Pls read before submitting a support question
User avatar
face_off
Octane Plugin Developer
Octane Plugin Developer
 
Posts: 13632
Joined: Fri May 25, 2012 10:52 am
Location: Adelaide, Australia

Re: Lua script for texture animation?

Postby Rikk The Gaijin » Fri Dec 05, 2014 2:33 am

Rikk The Gaijin Fri Dec 05, 2014 2:33 am
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:
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1501
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

Postby stratified » Fri Dec 05, 2014 4:01 am

stratified Fri Dec 05, 2014 4:01 am
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
User avatar
stratified
OctaneRender Team
OctaneRender Team
 
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Re: Lua script for texture animation?

Postby Rikk The Gaijin » Fri Dec 05, 2014 4:58 am

Rikk The Gaijin Fri Dec 05, 2014 4:58 am
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.
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1501
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

Postby grimm » Fri Dec 05, 2014 8:40 am

grimm Fri Dec 05, 2014 8:40 am
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 405 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
Linux Mint 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.31
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1162
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Lua script for texture animation?

Postby Rikk The Gaijin » Fri Dec 05, 2014 8:55 am

Rikk The Gaijin Fri Dec 05, 2014 8:55 am
Grimm, you are the new master baker! :o
Please post the video ASAP! Thank you!
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1501
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

Postby grimm » Fri Dec 05, 2014 9:02 am

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



Let me know if you have any problems.
Linux Mint 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.31
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1162
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Lua script for texture animation?

Postby Rikk The Gaijin » Fri Dec 05, 2014 9:08 am

Rikk The Gaijin Fri Dec 05, 2014 9:08 am
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...
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1501
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan
Next

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 1 guest

Sat Dec 14, 2019 4:52 pm [ UTC ]