Page 2 of 6

Re: Lua script for texture animation?

Posted: Fri Dec 05, 2014 9:11 am
by grimm
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.

Re: Lua script for texture animation?

Posted: Fri Dec 05, 2014 9:14 am
by Rikk The Gaijin
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 :?

Re: Lua script for texture animation?

Posted: Fri Dec 05, 2014 9:18 am
by grimm
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.

Re: Lua script for texture animation?

Posted: Fri Dec 05, 2014 9:20 am
by Rikk The Gaijin
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:

Re: Lua script for texture animation?

Posted: Fri Dec 05, 2014 9:23 am
by grimm
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.

Re: Lua script for texture animation?

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

Image

Re: Lua script for texture animation?

Posted: Fri Dec 05, 2014 9:30 am
by stratified
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 613 times
cheers,
Thomas

Re: Lua script for texture animation?

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

Re: Lua script for texture animation?

Posted: Mon Dec 08, 2014 2:41 am
by grimm
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 567 times
Have fun!

Jason

Re: Lua script for texture animation?

Posted: Tue Dec 09, 2014 1:38 am
by Rikk The Gaijin
It works great! 8-)
Would it be possible to add the Image options window?
options.jpg