Lua script for texture animation?

Forum for OctaneRender Lua scripting examples, discussion and support.
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

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 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
Rikk The Gaijin
Licensed Customer
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

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 :?
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

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 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
Rikk The Gaijin
Licensed Customer
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

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:
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

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 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
Rikk The Gaijin
Licensed Customer
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

You saved my ass grimm! 8-)

Image
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

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 579 times
cheers,
Thomas
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

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 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
User avatar
grimm
Licensed Customer
Posts: 1332
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

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 532 times
Have fun!

Jason
Linux Mint 21.3 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 535.171
Rikk The Gaijin
Licensed Customer
Posts: 1528
Joined: Tue Sep 20, 2011 2:28 pm
Location: Japan

It works great! 8-)
Would it be possible to add the Image options window?
options.jpg
Post Reply

Return to “Lua Scripting”