My first lua script: j_slideshow.lua

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
jorgy
Posts: 779
Joined: Sun Sep 05, 2004 8:01 pm
Location: Colorado, USA

My first lua script: j_slideshow.lua

Post by jorgy »

Okay, it's not even close to being finished with all the functionality I envision, but it's at least useful at this point.

The script will ask you for the number of frames to show an image as well as the crossfading frames (not implemented yet). It then prompts you for a file containing a list of images, in the order that you would like them displayed.

The cool thing (I think) is that the visibility of each image is done automagically, as well as keyframes for translation and scaling inserted. This means that you can go in and easily to the Ken Burns effect.

All comments welcome!

Some of the things I have planned:

- crossfading between slides
- automatic generation of titles
- setting the soundtrack
- rotation of slides

jorgy

p.s. Thanks to LM & 7ft!

http://65.98.71.13/moho/j_slideshow.lua
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

Very cool script there, Jorgy. So cool that I couldn't help messing with it to throw in some of those other features you mentioned.

For one, I threw in the crossfades for you. It's too bad that you cant see layer transparency in realtime, but what the hell. I put in a checkbox in the dialog to let you pick if you want each image to fade in/out completely before/after the next image, or do a proper crossfade. I set it up to put in the rotation keyframes, and the bit to set the end keyframe. Hope you don't mind. It's a really neat idea, as a use for Moho.

Anything to do with scaling the auto scaling the images is going to take either a Moho update, or going into the image files themselves to get the size info. I could whip you up some code to do it for PNGs at least, I haven't checked other file formats but that one is "easy". And to make it easier I was going to hack out a script that would export a textfile with the paths of all the images in a directory. Don't have the juice right now.

One other thing you might think about putting in there - maybe it would be good to be able to put the display and crossfade time and type into the file you are reading (as an option?), maybe on the line after the path, so you could vary them for each image. Anyway keep it up. Oh, yeah, heres my mod:
http://www.sharemation.com/MoreMohoD/Me ... deshow.lua
User avatar
jorgy
Posts: 779
Joined: Sun Sep 05, 2004 8:01 pm
Location: Colorado, USA

Post by jorgy »

Thanks for the mods!! Especially the crossfade. I didn't have a chance to try it until today, but it rocks! I'm going to be adding more features too soon. Thanks!!!
Post Reply