Don't click here unless you want to be banned.

LSL Wiki : llSetTextureAnim

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl411.us.archive.org
llSetTextureAnim(integer mode, integer side, integer x_frames, integer y_frames, float start, float length, float rate);

Animates the texture on side of a prim. Only one animation can be run per prim, although all sides of a prim can be animated at the same time by setting side to ALL_SIDES.

mode is a mask made up of the following parameters:

Mode Description Hex
ANIM_ON enable texture animation 0x01
LOOP loop when animating textures 0x02
REVERSE animate in reverse direction 0x04
PING_PONG animate forward then reverse 0x08
SMOOTH slide texture smoothly instead of frame-stepping 0x10
ROTATE rotate texture instead of using frames 0x20
SCALE scale texture instead of using frames 0x40
Notes:




'Standard' Animation Mode

(ie. neither ROTATE nor SCALE)

The "standard" animation mode divides the texture up into frames, then steps through these frames in sequence.

x_frames and y_frames describe how the texture is to be broken into frames:

start and length specify which frames of the texture are to be animated:

rate controls the animation speed:

Notes:




ROTATE Animation Mode


This mode causes the texture to rotate on the side(s) of the prim, instead of stepping through frames.

x_frames and y_frames are ignored in this mode.

start and length specify how the texture is to rotate:

rate controls the animation speed:

Note: setting rate to a negative value will cause the texture to rotate in the opposite direction.




SCALE Animation Mode


This mode causes the texture to scale up or down on the side(s) of the prim, causing a 'zoom in' or 'zoom out' effect.

x_frames and y_frames are ignored in this mode.

start and length specify the scaling of the texture through its animation:

rate controls the animation speed:

Notes:

SMOOTH Animation Mode


This mode causes the texture to be moved smoothly between one frame and the next in the X direction.

It can be used for scrolling smoothly from one end of a texture to another. To do this set Y frames to 1, and set X frames to a value which sets the proportion of the texture which will be seen at any one time. To avoid over-running the end of the texture and repeating at the end of the loop, set length to one less than the number of X frames and start to zero.

llSetTextureAnim(ANIM_ON | PING_PONG | SMOOTH | LOOP, ALL_SIDES, 8, 1, 0, 7, 2);

Notes:
- for smooth scrolling in the vertical direction on a prim, simply use the Texure tab on the Edit window to rotate the texture +/- 90 degrees, and the animation will follow.





General Note: llSetTextureAnim works by overriding the texture's scale and offset on the client side which makes this function incompatable with llScaleTexture and the PRIM_TEXTURE and PRIM_GLOW components of llSetPrimitiveParams. However, due to this implementation approach it will not affect your bandwidth or a sim's performance.

Example:
default {
    state_entry() {
        llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES, 1, 1, 0.0, 0.0, 0.5);
    }
}


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Texture | Animation
Comments [Hide comments/form]
I think the info about SMOOTH mode is wrong. x_frames is relevant. I think what it does is give how much of the texture is visible on the face at a time. So for example, with x_frames set to 2, only half of the texture will be on the face at once, although it will scroll through the whole texture. These should really be floats rather than integers for this use - I can't see a way to make a smooth scrolling texture that uses more than one copy of the texture on a face.
-- SeifertSurface (2005-07-19 00:10:45)
This is a fix for a bug I found with mutiframed TextureAnims. If you are getting a Quick flash (0.2 seconds ish) of all the frames at the looping point of your anim or when changing between two different TextureAnims, go to the Texture tab under the object and turn Shiny ON and OFF....don't ask ....I was getting bored and desperate :)
-- WheelFizz (2005-08-13 09:19:34)
Does that work if you do that using llSetPrimitiveParams? :-O
-- ChristopherOmega (2005-08-14 22:51:39)
What you are seeing is the default texture offset and scale of the object. Try setting them.
-- BlindWanderer (2005-08-16 09:00:28)
Stepping doesn't seem to work. Removing SMOOTH just seems to STOP the animation, but if the x/y frames are changed, the step does something but nothing in a uniform manner and more of a blip/reset than anything. :/
-- EepQuirk (2005-10-20 21:42:51)
Whenever I link another object with the object with the animation script it doesn't play anymore, yet I dont see anything about that on the wiki. What could be the problem?
-- MoldRat (2006-03-14 07:00:09)
I get the same problem as MoldRat. A single prim with a animation script works properly. Link another prim to it, and it stops working.
-- AngelaSalome (2006-03-26 01:25:29)
I've reported this a bug.
default
{
state_entry()
{
llSetTextureAnim (ANIM_ON, 0, 4, 4, 3, 16.0, 0.0);
}
}
-- AngelaSalome (2006-03-26 01:33:39)
You reported a script? There's nothing wrong with that script. No reason to post it here either.
-- EepQuirk (2006-03-26 11:47:00)
I think Angela is referring more to her problem with llSetTextureAnim stopping after linking then the actual script text itself. When discussing this bug the script text may or may not be useful. I haven't performed a test of this behavior or if it varies depending upon the parameters passed to llSetTextureAnim, so Im not sure.

Its true there's nothing blatently wrong with the script text itself, but by providing it, other scripters can verify her claim.
-- ChristopherOmega (2006-03-26 21:22:54)
But to post it in comments here--and just a script--is just silly and pointless. Again, there's nothing wrong with the script itself so it should not have been posted here, cluttering up the comments unnecessarily. It's bad enough comments don't get cleaned out (look at the HomePage) as it is...
-- EepQuirk (2006-03-27 12:40:06)
Negative rates are allowed and do the same thing as REVERSE? Is this intended behavior?
-- TalarusLuan (2006-05-10 04:35:54)
Cross, why did you remove the table and other CONDENSED info? Now this page is confusing again. Get rid of redundant info and reduce it to a single table with notes.
-- EepQuirk (2006-05-18 12:35:11)
It's confusing -again-? I removed the table because it was mostly wrong, and pretty much pointless, since the parameters change so much depending on the mode flags being used. As it is now, at least it's readable and makes some kind of sense.
-- CrossLament (2006-05-27 22:24:26)
So fix the table instead of just removing it. A table is much easier to read/follow to show differences than having to read multiple paragraphs with duplicate information and only minor differences.
-- EepQuirk (2006-05-28 14:38:28)
As of 1.9, I can't seem to get any SMOOTH texture animations to work. I noticed this when old items of mine stopped moving (which moved properly before), and tests comfirm this. Stepping animations seem to work fine.
-- KokiriSaarinen (2006-06-14 01:06:22)
Actually, I find the current format quite readable and sensible. There's nothing wrong with redundant info, organized well. :)
-- TalarusLuan (2006-07-13 10:54:42)
I noticed that in the ROTATE mode with SMOOTH, the rate seems to be in radians per second, not frames per second, as specified. Can someone verify and update if true?
-- TalarusLuan (2006-07-13 11:00:18)
I tried panning a texture across a prim using SMOOTH, and manually editing the repeats using the build tool.. after I put in the script the texture would flicker between 1.0 horizontal and vertical repeats, and back to where I originally had it at, 3 horizontal, 2 vertical. Is this a bug? or do extra lines need to be added to the script. (I'm using just the basic animsmooth script listed in the example)
-- KismetMuromachi (2006-11-08 04:22:45)
I ran into the same problem without the smooth texturing. I made an animated door, that when clicked on would open or close (use reverse to close) but when touched on it would flicker to the objects original texture settings then re-apply the texture_anim. The closest I could get to fixing it was to use the script to set the texture repeats and offset as close as I could get to what the first frame of the anim should be, then call the animation. I think it should be considered a bug.
-- AakanaarLaSalle (2006-11-08 18:44:14)
Attach a comment to this page: