Lua script for texture animation?

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

Re: Lua script for texture animation?

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

grimm Fri Dec 05, 2014 9:11 am
Hmm very strange, try making sure that you have the scrub line set to "Frame" instead of "Time" and see if that makes a difference. In the script I just count the frames down by 1.
Linux Mint 20 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 460.56
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1321
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:14 am

Rikk The Gaijin Fri Dec 05, 2014 9:14 am
grimm wrote:Hmm very strange, try making sure that you have the scrub line set to "Frame" instead of "Time" and see if that makes a difference. In the script I just count the frames down by 1.

It is set on Frames, and I have 30 FPS. I tried to recreate the scene from scratch, and the problem persist :?
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

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

grimm Fri Dec 05, 2014 9:18 am
It should error out as it tries to load a non-existent frame. It must be something I don't understand in how the script gets triggered. Can you just limit your animation to render the first 200 frames? In my test it was the exact opposite, I have more texture frames than my animation (240 vs. 100). But I didn't see any issues. Also make sure to reload the script before you render so everything lines up.
Linux Mint 20 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 460.56
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1321
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:20 am

Rikk The Gaijin Fri Dec 05, 2014 9:20 am
I figured out what the problem is: when you scrub the timeline, it doesn't count all the frames, only the ones when it stops and render. If you launch the render batch, it renders out correctly! So basically, it's only a scrubbing/preview problem! :lol:
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

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

grimm Fri Dec 05, 2014 9:23 am
Cool, yep it's a problem, but I'm not sure how to solve it. Just move the scrubber to the first frame and reload the script right before rendering and it should be fine.
Linux Mint 20 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 460.56
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1321
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:23 am

Rikk The Gaijin Fri Dec 05, 2014 9:23 am
You saved my ass grimm! 8-)

Image
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

Re: Lua script for texture animation?

Postby stratified » Fri Dec 05, 2014 9:30 am

stratified Fri Dec 05, 2014 9:30 am
Hi Jason,

Thanks for all the work, it looks like you already have something working. I already started something but mine works a bit different. It starts from a directory and then creates an animation based on the image files it finds in that directory. Maybe you can reuse something from it?

texture-animation.lua
(3.21 KiB) Downloaded 538 times


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 grimm » Fri Dec 05, 2014 9:33 am

grimm Fri Dec 05, 2014 9:33 am
Thanks Thomas, I will check it out. But I have to do that tomorrow. It's past midnight here and I have to work in the morning. :evil:
Linux Mint 20 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 460.56
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1321
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Lua script for texture animation?

Postby grimm » Mon Dec 08, 2014 2:41 am

grimm Mon Dec 08, 2014 2:41 am
Here is a new version of the script.

Changes:

- Works with the timeline scrubber now, let me know if you see any frame discrepancies.
- Plays nicer with other Lua scripts like the turntable script (looks like there are still some issues though :( ).
- I had to add another input pin for the number of frames/sec. This is because of an Octane bug that when fixed I can remove.
- Changed the name of the node to reflect that it's an animated texture.

anim_texture.lua
(2.01 KiB) Downloaded 498 times


Have fun!

Jason
Linux Mint 20 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 460.56
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1321
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Lua script for texture animation?

Postby Rikk The Gaijin » Tue Dec 09, 2014 1:38 am

Rikk The Gaijin Tue Dec 09, 2014 1:38 am
It works great! 8-)
Would it be possible to add the Image options window?
options.jpg
Rikk The Gaijin
Licensed Customer
Licensed Customer
 
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan
PreviousNext

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 15 guests

Sat Apr 20, 2024 2:29 am [ UTC ]