Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Special Effects Automatic_GIF_to_SL_script  

Automatic_GIF_to_SL_script

DESCRIPTION: Automatic_GIF_to_SL_script

Category: Special Effects
By : Ferd Frederix
Created: 2011-06-21 Edited: 2015-06-11
Worlds: Second Life OpenSim

the Zip file

Download all files for Automatic_GIF_to_SL_script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Automatic_GIF_to_SL_script_1.lsl
Get file # 2. gif_2_SL_animation_v0.6.zip

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1 // 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
2 // Revisions: V2 6-7-2015 remove all anims on reset
3
4 integer animOn = TRUE; //Set to FALSE and call initAnim() again to stop the animation.
5 //Effect parameters: (can be put in list together, to make animation have all of said effects)
6 //LOOP - loops the animation
7 //SMOOTH - plays animation smoothly
8 //REVERSE - plays animation in reverse
9 //PING_PONG - plays animation in one direction, then cycles in the opposite direction
10 list effects = [LOOP]; // LOOP for GIF89 movies
11 //Movement parameters (choose one):
12 //ROTATE - Rotates the texture
13 //SCALE - Scales the texture
14 //Set movement to 0 to slide animation in the X direction, without any special movement.
15 integer movement = 0;
16 integer face = ALL_SIDES; //Number representing the side to activate the animation on.
17 integer sideX = 1; //Represents how many horizontal images (frames) are contained in your texture.
18 integer sideY = 1; //Same as sideX, except represents vertical images (frames).
19 float start = 0.0; //Frame to start animation on. (0 to start at the first frame of the texture)
20 float length = 0.0; //Number of frames to animate, set to 0 to animate all frames.
21 float speed = 10.0; //Frames per second to play.
22 initAnim() //Call this when you want to change something in the texture animation.
23 {
24 if(animOn)
25 {
26 integer effectBits;
27 integer i;
28 for(i = 0; i < llGetListLength(effects); i++)
29 {
30 effectBits = (effectBits | llList2Integer(effects,i));
31 }
32 integer params = (effectBits|movement);
33 llSetTextureAnim(ANIM_ON|params,face,sideX,sideY, start,length,speed);
34 }
35 else
36 {
37 llSetTextureAnim(0,face,sideX,sideY, start,length,speed);
38 }
39 }
40
41 fetch()
42 {
44 llSetTexture(texture,face);
45 list data = llParseString2List(texture,[";"],[]);
46 llOwnerSay( llDumpList2String(data ,","));
47 string X = llList2String(data,1);
48 string Y = llList2String(data,2);
49 string Z = llList2String(data,3);
50
51 // llOwnerSay("X=" + X + " Y=" + Y + " Z = " + (string) Z);
52
53 sideX = (integer) X;
54 sideY = (integer) Y;
55 speed = (float) Z;
56 if(speed)
57 initAnim();
58 }
59
60 default
61 {
63 {
64 llSetTextureAnim(FALSE, face, 0, 0, 0.0, 0.0, 1.0); // V2 - remove all anims
65 fetch();
66 }
67 changed(integer what)
68 {
69 if(what & CHANGED_INVENTORY)
70 {
71 fetch();
72 }
73 }
74 }

Back to the Best Free Tools in Second Life and OpenSim.