
( define ( script-fu-layers-to-sl-anim curimg curdrawable xframes yframes showscript face fps ) ( let () Local function: check if a string contains a substring ( define ( contains-ci str substr ) ( let* ( ( i 0 ) ( lensub ( string-length substr )) ( imax ( - ( string-length str ) lensub )) ) ( if ( negative? imax ) #f ( begin ( define found #f ) ( while ( and ( not found ) ( ( + offsetx newsizex ) framesizex ) ( set! newsizex ( - framesizex offsetx ))) ( if ( > ( + offsety newsizey ) framesizey ) ( set! newsizey ( - framesizey offsety ))) Calculate frame rectangle's top left position. Thanks to Digital Dharma for the suggestions. Layers to SL Texture Animation, version 2.0.2 Written by Pedro Oval.
#Gimp gif wont separate frames code
If you had the script generation option checked, you can select the code from the window that appears, copy it, and paste it as a LSL script replacing the contents. Now you can save the file and upload it to SL. Click OK and you will get a new image window consisting of the original frames arranged according to the specified values, suitable for use in SL.

It also asks whether you want to generate an animation script in a message window, and the frame rate to use for that script. As noted above, that number must match the number of frames in your layers, or the script will show an error instead. It is invoked using Script-fu > SecondLife > Frames to texture.Ī window will appear, asking the number of horizontal and vertical frames of the final image. If you need to rescale the image at this point and the image is indexed, it's better if you convert it to RGB mode first. Create empty layers or duplicate existing ones until completing the final frame count. If you are not going to use all the frames in your final image (for example, you have 5 frames and decide to do a 3x2 image), you still need to fill the holes. It's preferable to have a plan at this point of what the final resolution will be, and how many horizontal and vertical frames the final image will have. Next, ensure that it has the correct size and number of frames desired. Version 1.0 of this script required to use the Unoptimize filter first in some cases as of version 2.0, that functionality is already built in. An existing GIF animation will work for this purpose, or you can create your own, or import one if you have enough memory.

After it's in the Scripts folder, do a refresh by selecting Filters > Script-Fu > Refresh Scripts.įirst, create or load an animation with one layer per frame (the first frame is the bottom layer). The scripts folder can be found by going to Preferences > Folders > Scripts. scm - the suggested name is "layers-to-sl-animation.scm". Save it into your scripts folder with the extension.
#Gimp gif wont separate frames windows
Copy and paste the script below into a simple text editor of your choice (Notepad is probably the best choice for Windows systems).
