Difference between revisions of "LlSetTextureAnim"

From Second Life Wiki
Jump to navigation Jump to search
Line 1: Line 1:
{{LSL_Function/negative index|true|start}}{{LSL_Function/face|face}}
{{LSL_Function
{{LSL_Function
|func_id=211
|func_id=211
Line 5: Line 6:
|sort=SetTextureAnim
|sort=SetTextureAnim
|func=llSetTextureAnim
|func=llSetTextureAnim
|p1_type=integer|p1_name=mode
|p1_type=integer|p1_name=mode|p1_desc=bitfield of Mode flags
|p2_type=integer|p2_name=face
|p2_type=integer|p2_name=face
|p3_type=integer|p3_name=sizex
|p3_type=integer|p3_name=sizex|p3_desc=frames on the x-axis (left to right)
|p4_type=integer|p4_name=sizey
|p4_type=integer|p4_name=sizey|p4_desc=frames on the y-axis (left to right)
|p5_type=float|p5_name=start
|p5_type=float|p5_name=start|p5_desc=Start position/frame number
|p6_type=float|p6_name=length
|p6_type=float|p6_name=length|p6_desc=number of frames to display
|p7_type=float|p7_name=rate
|p7_type=float|p7_name=rate|p7_desc=frames per second
|func_footnote
|func_footnote
|func_desc=Animate the texture on the specified face/faces
|func_desc=Animate the texture on the specified face/faces by setting the texture scale and offset
|return_text
|return_text
|spec
|spec=
You can only have one texture animation on an object, calling llSetTextureAnim more than once on an object will reset it.
 
You can only do one traditional animation, ROTATE or SCALE at a time, you cannot combine masks. In the case of ROTATE or SCALE, sizex and sizey are ignored, and start and length are used as the start and length values of the animation. For rotation, start and length are in radians.
 
The face specified which face to animate. If face is ALL_SIDES, all textures on the object are animated.
 
The sizex and sizey describe the layout of the frames within the texture. sizex specifies how many horizontal frames and sizey is how many vertical frames.
 
start is the frame number to begin the animation on. Frames are numbered from left to right, top to bottom, starting at 0.
 
length is the number of frames to animate. 0 means to animate all frames after the start frame.
 
rate is the frame rate to animate at. 1.0 means 1 frame per second, 10.0 means 10 frames per second, etc.
 
|caveats
|caveats
|constants={{LSLC|FixMe}}
|constants={{{!}} {{Prettytable}}
{{!}}-{{Hl2}}
! colspan="2" {{!}}Modes
! Description
{{!}}-
{{!}}[[ANIM_ON]]
{{!}}{{LSL Hex||1}}
{{!}}Texture animation is on.
{{!}}-
{{!}}[[LOOP]]
{{!}}{{LSL Hex||2}}
{{!}}Loop the texture animation.
{{!}}-
{{!}}[[REVERSE]]
{{!}}{{LSL Hex||4}}
{{!}}Play animation in reverse direction.
{{!}}-
{{!}}[[PING_PONG]]
{{!}}{{LSL Hex||8}}
{{!}}play animation going forwards, then backwards.
{{!}}-
{{!}}[[SMOOTH]]
{{!}}{{LSL Hex||16}}
{{!}}slide in the X direction, instead of playing separate frames.
{{!}}-
{{!}}[[ROTATE]]
{{!}}{{LSL Hex||32}}
{{!}}Animate texture rotation.<br>Does not work with [[SCALE]]
{{!}}-
{{!}}[[SCALE]]
{{!}}{{LSL Hex||64}}
{{!}}Animate the texture scale.<br>Does not work with [[ROTATE]]
{{!}}}
|examples
|examples
|helpers
|helpers
Line 27: Line 74:
|negative_index
|negative_index
|cat1=Media
|cat1=Media
|cat2
|cat2=Effects
|cat3
|cat3
|cat4
|cat4
}}
}}

Revision as of 15:18, 23 February 2007

Summary

Function: llSetTextureAnim( integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate );

Animate the texture on the specified face/faces by setting the texture scale and offset

• integer mode bitfield of Mode flags
• integer face face number or ALL_SIDES
• integer sizex frames on the x-axis (left to right)
• integer sizey frames on the y-axis (left to right)
• float start Start position/frame number
• float length number of frames to display
• float rate frames per second

start supports negative indexes. If face is ALL_SIDES then the function works on all sides.

Specification

Index Positive Negative
First 0 -length
Last length - 1 -1

Indexes

  • Positive indexes count from the beginning, the first item being indexed as 0, the last as (length - 1).
  • Negative indexes count from the far end, the first item being indexed as -length, the last as -1.

You can only have one texture animation on an object, calling llSetTextureAnim more than once on an object will reset it.

You can only do one traditional animation, ROTATE or SCALE at a time, you cannot combine masks. In the case of ROTATE or SCALE, sizex and sizey are ignored, and start and length are used as the start and length values of the animation. For rotation, start and length are in radians.

The face specified which face to animate. If face is ALL_SIDES, all textures on the object are animated.

The sizex and sizey describe the layout of the frames within the texture. sizex specifies how many horizontal frames and sizey is how many vertical frames.

start is the frame number to begin the animation on. Frames are numbered from left to right, top to bottom, starting at 0.

length is the number of frames to animate. 0 means to animate all frames after the start frame.

rate is the frame rate to animate at. 1.0 means 1 frame per second, 10.0 means 10 frames per second, etc.

Modes Description
ANIM_ON 0x1 Texture animation is on.
LOOP 0x2 Loop the texture animation.
REVERSE 0x4 Play animation in reverse direction.
PING_PONG 0x8 play animation going forwards, then backwards.
SMOOTH 0x10 slide in the X direction, instead of playing separate frames.
ROTATE 0x20 Animate texture rotation.
Does not work with SCALE
SCALE 0x40 Animate the texture scale.
Does not work with ROTATE

Caveats

  • If start is out of bounds the script continues to execute without an error message.
  • The function silently fails if its face value indicates a face that does not exist.
All Issues ~ Search JIRA for related Bugs

Examples

See Also

Articles

•  Negative Index

Deep Notes

Search JIRA for related Issues

Signature

function void llSetTextureAnim( integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate );