First thing to do is to download Gif2SL by Gonta Maltz attached to this post. Un-zip it on a convenient location on your HD.
Find an animated GIF you like, and download it to your HD.
Then you just click the "Load GIF" button, find your original GIF file, and click "Output". The program will save the converted gif in the same directory or folder you saved the executable program in.
If your GIF has a transparent background, select the "Transparency" check box and it will preserve the Alpha channel information in the output in a Second Life compatible format.
Upload your converted gif (*.jpeg or *.png) and drop it in a prim.
Now create a new script, call is Gif2SL and copy&paste the following script (by Fred Federix) in it.
Drop the script in the prim with one texture in it and you should see an animation on the prim.
- Code: Alles auswählen
// Script Name: Automatic_GIF_to_SL_script.lsl
// Author: Ferd Frederix
//Put any texture converted by gif_2_SL_animation_v0.6.exe into a prim with this script to get it to play back automatically as a movie. You can get the GIF 2 SL executable at http://secondlife.mitsi.com/download/
// Downloaded from : http://www.free-lsl-scripts.com/cgi/freescripts.plx?ID=1594
// This program is free software; you can redistribute it and/or modify it.
// Additional Licenes may apply that prevent you from selling this code
// and these licenses may require you to publish any changes you make on request.
// There are literally thousands of hours of work in these scripts. Please respect
// the creators wishes and Copyright law and follow their license requirements.
// License information included herein must be included in any script you give out or use.
// Licenses may also be included in the script or comments by the original author, in which case
// the authors license must be followed, and their licenses override any licenses outlined in this header.
// You cannot attach a license to any of these scripts to make any license more or less restrictive.
// All scripts by avatar Ferd Frederix, unless stated otherwise in the script, are licensed as Creative Commons By Attribution and Non-Commercial.
// Commercial use is NOT allowed - no resale of my scripts in any form.
// This means you cannot sell my scripts but you can give them away if they are FREE.
// Scripts by Ferd Frederix may be sold when included in a new object that actually uses these scripts. Putting my script in a prim and selling it on marketplace does not constitute a build.
// For any reuse or distribution, you must make clear to others the license terms of my works. This is done by leaving headers intact.
// See http://creativecommons.org/licenses/by-nc/3.0/ for more details and the actual license agreement.
// You must leave any author credits and any headers intact in any script you use or publish.
// If you don't like these restrictions and licenses, then don't use these scripts.
//////////////////////// ORIGINAL AUTHORS CODE BEGINS ////////////////////////////////////////////
// Put any texture converted by gif_2_SL_animation_v0.6.exe into a prim with this script to get it to play back automatically as a movie
integer animOn = TRUE; //Set to FALSE and call initAnim() again to stop the animation.
//Effect parameters: (can be put in list together, to make animation have all of said effects)
//LOOP - loops the animation
//SMOOTH - plays animation smoothly
//REVERSE - plays animation in reverse
//PING_PONG - plays animation in one direction, then cycles in the opposite direction
list effects = [LOOP]; // LOOP for GIF89 movies
//Movement parameters (choose one):
//ROTATE - Rotates the texture
//SCALE - Scales the texture
//Set movement to 0 to slide animation in the X direction, without any special movement.
integer movement = 0;
integer face = ALL_SIDES; //Number representing the side to activate the animation on.
integer sideX = 1; //Represents how many horizontal images (frames) are contained in your texture.
integer sideY = 1; //Same as sideX, except represents vertical images (frames).
float start = 0.0; //Frame to start animation on. (0 to start at the first frame of the texture)
float length = 0.0; //Number of frames to animate, set to 0 to animate all frames.
float speed = 10.0; //Frames per second to play.
initAnim() //Call this when you want to change something in the texture animation.
for(i = 0; i < llGetListLength(effects); i++)
effectBits = (effectBits | llList2Integer(effects,i));
integer params = (effectBits|movement);
string texture = llGetInventoryName(INVENTORY_TEXTURE,0);
list data = llParseString2List(texture,[";"],);
llOwnerSay( llDumpList2String(data ,","));
string X = llList2String(data,1);
string Y = llList2String(data,2);
string Z = llList2String(data,3);
// llOwnerSay("X=" + X + " Y=" + Y + " Z = " + (string) Z);
sideX = (integer) X;
sideY = (integer) Y;
speed = (float) Z;
if (what & CHANGED_INVENTORY)