Difference between revisions of "LlSetTextureAnim"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
{{Issues/SVC-3925}}{{Issues/SVC-1242}}{{Issues/VWR-4018}}{{LSL_Function/negative index|true|start}}{{LSL_Function/face|face}}{{LSL_Function
{{Issues/SVC-3925}}{{Issues/SVC-1242}}{{Issues/VWR-4018}}{{LSL_Function/negative index/ja|true|start}}{{LSL_Function/face/ja|face}}{{LSL_Function/ja
|func_id=211
|func_id=211
|func_sleep=0.0
|func_sleep=0.0
Line 5: Line 5:
|sort=SetTextureAnim
|sort=SetTextureAnim
|func=llSetTextureAnim
|func=llSetTextureAnim
|p1_type=integer|p1_name=mode|p1_desc=mask of Mode flags
|p1_type=integer|p1_name=mode|p1_desc=モードフラグのマスク
|p2_type=integer|p2_name=face
|p2_type=integer|p2_name=face
|p3_type=integer|p3_name=sizex|p3_desc=horizontal frames (ignored for [[ROTATE]] and [[SCALE]])
|p3_type=integer|p3_name=sizex|p3_desc=横フレーム ( {{LSLG/ja|ROTATE}} と{{LSLG/ja|SCALE}} では無視される)
|p4_type=integer|p4_name=sizey|p4_desc=vertical frames (ignored for [[ROTATE]] and [[SCALE]])
|p4_type=integer|p4_name=sizey|p4_desc=縦フレーム ( {{LSLG/ja|ROTATE}} と{{LSLG/ja|SCALE}} では無視される)
|p5_type=float|p5_name=start|p5_desc=Start position/frame number (or radians for [[ROTATE]])
|p5_type=float|p5_name=start|p5_desc=開始位置/フレーム番号 ( {{LSLG/ja|ROTATE}} ではラジアン)
|p6_type=float|p6_name=length|p6_desc=number of frames to display (or radians for [[ROTATE]])
|p6_type=float|p6_name=length|p6_desc=表示するフレーム数 ( {{LSLG/ja|ROTATE}} ではラジアン)
|p7_type=float|p7_name=rate|p7_desc=frames per second (must not be zero)
|p7_type=float|p7_name=rate|p7_desc=毎秒のフレーム数(0 にすべきではありません)
|func_footnote=Frames are numbered from left to right, top to bottom, starting at 0.<br/>If '''rate''' is negative, it has the same effect as using the [[REVERSE]] flag.{{Footnote|Though if '''rate''' is negative and the [[REVERSE]] flag is used, they cancel each other out.}}
|func_footnote=フレームは 0 から始まって、左から右、上から下に数えられます。<br/>'''rate''' がマイナス域の場合、 {{LSLG/ja|REVERSE}} フラグを使っているのと同じ効果があります。{{Footnote|しかし、'''rate''' がマイナスで {{LSLG/ja|REVERSE}} フラグが使用されていると、効果が打ち消されます。|しかし、'''rate''' がマイナスで REVERSE フラグが使用されていると、効果が打ち消されます。}}
|func_desc=Animate the texture on the specified face/faces by setting the texture scale and offset.
|func_desc=テクスチャの大きさとオフセットを設定して、指定した面のテクスチャをアニメーションさせます。
|return_text
|return_text
|spec=
|spec=
===Frames===
===フレーム===
Frames are sub-rectangles within the texture. A set of frames with 2 horizontal ('''sizex''') and 3 vertical ('''sizey''') means the overall texture is divided into 3 rows of 2 columns of images, each of which is a frame. llSetTextureAnim will animate across these 6 starting with the top left image and going across and down, optionally repeating. If [[SMOOTH]] is set the frames slide smoothly from one to the next, if off, each frame is displayed in turn centered on the face.
フレームはテクスチャの中の sub-rectangles です。縦 2 ('''{{LSL Param|sizex}}''') 3 ('''{{LSL Param|sizey}}''') のフレームセットは、テクスチャ全体が 3 2 桁 の画像に切り分けられ、それぞれがフレームとなることを意味しています。llSetTextureAnim will animate across these 6 starting with the top left image and going across and down, optionally repeating. {{LSLG/ja|SMOOTH}} が設定されていると、フレームは次から次へとスムーズにスライドしていき、OFF になっていると、それぞれのフレームはかわるがわる面の中心に表示されます。
|caveats=*You can only have one texture animation on a prim
|caveats=*1 つのプリムに 1 つのテクスチャアニメーションのみ設定することができます。
**Calling llSetTextureAnim more than once on a prim will reset the existing animation.
**llSetTextureAnim を 2 回以上呼び出すと、プリムは既にあるアニメーションをリセットします。
*You cannot combine [[ROTATE]] and [[SCALE]] flags.
*{{LSLG/ja|ROTATE}} フラグと {{LSLG/ja|SCALE}} フラグを併用することはできません。
*'''sizex''' & '''sizey''' are both limited to a range of 0 to 255
*'''sizex''' '''sizey''' は両方とも 0 255 に制限されています。
*llSetTextureAnim when on shows the texture with 1 repeat in X and Y and 0 rotation and offset.
*llSetTextureAnim はオンのとき、 X 方向と Y 方向で 1 回ずつ繰り返し、回転とオフセットは 0 となっているテクスチャを表示します。
|constants={{{!}} class="sortable collapsible" {{Prettytable|style=margin-top:0;}}
|constants={{{!}} class="sortable collapsible" {{Prettytable|style=margin-top:0;}}
{{!}}-{{Hl2}}
{{!}}-{{Hl2}}
! Modes
! モード
! title="Value" {{!}}
! title="" {{!}}
! class="unsortable" {{!}} Description
! class="unsortable" {{!}} 説明
{{!}}-
{{!}}-
{{!}}[[ANIM_ON]]
{{!}}{{LSLG/ja|ANIM_ON}}
{{!}}{{LSL Hex||1|chars=2}}
{{!}}{{LSL Hex/ja||1|chars=2}}
{{!}}Texture animation is on. This must be set to start the animation, cleared to stop it.
{{!}}テクスチャのアニメーションは ON です。アニメーションを開始するときに設定し、停止するときに解除しなければなりません。
{{!}}-
{{!}}-
{{!}}[[LOOP]]
{{!}}{{LSLG/ja|LOOP}}
{{!}}{{LSL Hex||2|chars=2}}
{{!}}{{LSL Hex/ja||2|chars=2}}
{{!}}Loop the texture animation.
{{!}}テクスチャのアニメーションをループさせます。
{{!}}-
{{!}}-
{{!}}[[REVERSE]]
{{!}}{{LSLG/ja|REVERSE}}
{{!}}{{LSL Hex||4|chars=2}}
{{!}}{{LSL Hex/ja||4|chars=2}}
{{!}}Play animation in reverse direction.
{{!}}アニメーションを逆順で再生します。
{{!}}-
{{!}}-
{{!}}[[PING_PONG]]
{{!}}{{LSLG/ja|PING_PONG}}
{{!}}{{LSL Hex||8|chars=2}}
{{!}}{{LSL Hex/ja||8|chars=2}}
{{!}}Play animation going forwards, then backwards.
{{!}}アニメーションを順番に再生し、そのあとで逆順に再生します。
{{!}}-
{{!}}-
{{!}}[[SMOOTH]]
{{!}}{{LSLG/ja|SMOOTH}}
{{!}}{{LSL Hex||16|chars=2}}
{{!}}{{LSL Hex/ja||16|chars=2}}
{{!}}Slide in the X direction, instead of playing separate frames.<br/>In both [[SCALE]] and [[ROTATE]] modes, causes smooth transitions.
{{!}}それぞれのフレームを再生するのではなく、X 方向にスライドさせます。{{LSLG/ja|SCALE}} と {{LSLG/ja|ROTATE}} のモードで、スムーズな切り替えができます。
{{!}}-
{{!}}-
{{!}}[[ROTATE]]
{{!}}{{LSLG/ja|ROTATE}}
{{!}}{{LSL Hex||32|chars=2}}
{{!}}{{LSL Hex/ja||32|chars=2}}
{{!}}Animate texture rotation.<br>Does not work with [[SCALE]]
{{!}}テクスチャを回転させます。<br>{{LSLG/ja|SCALE}} と併用できません。
{{!}}-
{{!}}-
{{!}}[[SCALE]]
{{!}}{{LSLG/ja|SCALE}}
{{!}}{{LSL Hex||64|chars=2}}
{{!}}{{LSL Hex/ja||64|chars=2}}
{{!}}Animate the texture scale.<br>Does not work with [[ROTATE]]
{{!}}テクスチャを拡大させます。<br>{{LSLG/ja|ROTATE}} と併用できません。
{{!}}}
{{!}}}
|examples=
|examples=
This slides a texture smoothly and loops it when it gets to the end.
これはテクスチャを滑らかにずらし、終端についたときに繰り返します。
<lsl>llSetTextureAnim(ANIM_ON | SMOOTH | LOOP , ALL_SIDES, 1, 1, 1, 1, 1);</lsl>
<lsl>llSetLinkTextureAnim(LINK_THIS, ANIM_ON | SMOOTH | LOOP , ALL_SIDES, 1, 1, 1, 1, 1);</lsl>


This slides a texture smoothly in the opposite direction
これは反対方向にテクスチャを滑らかにずらします。
<lsl>llSetTextureAnim(ANIM_ON | SMOOTH | LOOP , ALL_SIDES, 1, 1, 1, 1, -1);</lsl>
<lsl>llSetLinkTextureAnim(LINK_THIS, ANIM_ON | SMOOTH | LOOP , ALL_SIDES, 1, 1, 1, 1, -1);</lsl>


This divides a texture into 64 "cells", 8 across, and 8 down, and flips through them, left to right, top to bottom. This is useful for cell animation.
横8縦8の64セルにテクスチャを分割し、左から右、上から下に通して反転させます。セルアニメーションで使い勝手がいいです。
<lsl>llSetTextureAnim( ANIM_ON | LOOP, ALL_SIDES, 8, 8, 0, 64, 6.4 );</lsl>
<lsl>llSetLinkTextureAnim(LINK_THIS, ANIM_ON | LOOP, ALL_SIDES, 8, 8, 0, 64, 6.4 );</lsl>


This rotates a texture counter-clockwise at 2 revolutions per second. Change the last value to -2*TWO_PI to rotate clockwise.
これは毎秒2回、半時計周りにテクスチャを回転します。最後の値は-2*TWO_PIの時計周り回転に変わります。
<lsl>llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, 2*TWO_PI);</lsl>
<lsl>llSetLinkTextureAnim(LINK_THIS, ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, 2*TWO_PI);</lsl>


This scales a texture larger and smaller.
これはテクスチャを拡大縮小して変形します。
<lsl>llSetTextureAnim(ANIM_ON | SMOOTH | SCALE | PING_PONG | LOOP, ALL_SIDES, 1, 1, 1, 3, 2);</lsl>
<lsl>llSetLinkTextureAnim(LINK_THIS, ANIM_ON | SMOOTH | SCALE | PING_PONG | LOOP, ALL_SIDES, 1, 1, 1, 3, 2);</lsl>


This turns off all texture animations
これはループ再生しているアニメーションを特定のフレームで停止させたり開始させたりします。
<lsl>llSetTextureAnim(FALSE, ALL_SIDES, 0, 0, 0.0, 0.0, 1.0);</lsl>
 
This toggles a looping animation to make it stop at a specific frame.
<lsl>integer ON;
<lsl>integer ON;
default
default
Line 95: Line 92:


|helpers
|helpers
|also_functions={{LSL DefineRow||[[llSetLinkTextureAnim]]}}
|also_functions={{LSL DefineRow||{{LSLG/ja|llSetLinkTextureAnim}}}}
|also_events
|also_events
|also_articles
|also_articles
|notes=
|notes=
Texture animation is a property of the prim (i.e., you can remove the script that started the animation, and the prim will remember the settings anyway.) Note, though, that as of Jan 2009, texture animation is still one of the prim properties that are lost when using the rezzed in world copy method of shift-drag. Originally brought up in {{Jira|VWR-640}}, it got it's own issue in [[#SVC-3925|SVC-3925]]
テクスチャアニメーションはプリムのプロパティです (例えば、アニメーションを開始させてからスクリプトを抜くことができます。いずれにせよプリムはその設定を覚えています)。しかし、2009 年 1 月時点ではまだ、テクスチャアニメーションは Shift ドラッグによってコピーされるとその設定が消えてしまうプリムプロパティとなっています。最初にこの問題が {{Jira|VWR-640}} でもちあがり、[[#SVC-3925|SVC-3925]] で分離独立して議論されています。


An online-tool for rough and ready conversion of moving gifs to animated textures is here: http://www.peregrinesalon.com/anim/ (link valid as of Jan 2009.)
早くざっくりと GIF をアニメーションテクスチャに変換するオンラインツールがこちらにあります。 http://www.peregrinesalon.com/anim/ (2009 年 1 月現在で有効なリンクです)
|cat1=Media
|cat1=Media
|cat2=Effects
|cat2=Effects

Revision as of 14:17, 12 May 2010

要約

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

テクスチャの大きさとオフセットを設定して、指定した面のテクスチャをアニメーションさせます。

• integer mode モードフラグのマスク
• integer face 番号もしくは ALL_SIDES
• integer sizex 横フレーム ( ROTATESCALE では無視される)
• integer sizey 縦フレーム ( ROTATESCALE では無視される)
• float start 開始位置/フレーム番号 ( ROTATE ではラジアン)
• float length 表示するフレーム数 ( ROTATE ではラジアン)
• float rate 毎秒のフレーム数(0 にすべきではありません)

start には 負のインデックス を使用できます。 faceALL_SIDES であれば関数は全ての面に作用します。 フレームは 0 から始まって、左から右、上から下に数えられます。
rate がマイナス域の場合、 REVERSE フラグを使っているのと同じ効果があります。[1]

仕様

インデックス
先頭 0 -length
末尾 length - 1 -1

インデックス

  • 正のインデックスは先頭から数えます。先頭の要素は 0、末尾の要素は (length - 1) のインデックスを持ちます。
  • 負のインデックスは末尾から数えます。先頭の要素は -length、末尾の要素は -1 のインデックスを持ちます。

フレーム

フレームはテクスチャの中の sub-rectangles です。縦 2 (sizex) 横 3 (sizey) のフレームセットは、テクスチャ全体が 3 行 2 桁 の画像に切り分けられ、それぞれがフレームとなることを意味しています。llSetTextureAnim will animate across these 6 starting with the top left image and going across and down, optionally repeating. SMOOTH が設定されていると、フレームは次から次へとスムーズにスライドしていき、OFF になっていると、それぞれのフレームはかわるがわる面の中心に表示されます。

モード 説明
ANIM_ON 0x01 テクスチャのアニメーションは ON です。アニメーションを開始するときに設定し、停止するときに解除しなければなりません。
LOOP 0x02 テクスチャのアニメーションをループさせます。
REVERSE 0x04 アニメーションを逆順で再生します。
PING_PONG 0x08 アニメーションを順番に再生し、そのあとで逆順に再生します。
SMOOTH 0x10 それぞれのフレームを再生するのではなく、X 方向にスライドさせます。SCALEROTATE のモードで、スムーズな切り替えができます。
ROTATE 0x20 テクスチャを回転させます。
SCALE と併用できません。
SCALE 0x40 テクスチャを拡大させます。
ROTATE と併用できません。

警告

  • start が正常なインデックス範囲を外れていても、スクリプトはエラー表示を出さずに処理を続けます。
  • face が存在しない面を指している場合、関数はエラーを出さずに復帰します。
  • 1 つのプリムに 1 つのテクスチャアニメーションのみ設定することができます。
    • llSetTextureAnim を 2 回以上呼び出すと、プリムは既にあるアニメーションをリセットします。
  • ROTATE フラグと SCALE フラグを併用することはできません。
  • sizexsizey は両方とも 0 ~ 255 に制限されています。
  • llSetTextureAnim はオンのとき、 X 方向と Y 方向で 1 回ずつ繰り返し、回転とオフセットは 0 となっているテクスチャを表示します。

Important Issues

~ All Issues ~ Search JIRA for related Bugs
   Some persistent prim properties lost when duplicated
   Texture Animation is not copied (llSetTextureAnim)
   Texture animations ignore repeats per face

サンプル

これはテクスチャを滑らかにずらし、終端についたときに繰り返します。

<lsl>llSetLinkTextureAnim(LINK_THIS, ANIM_ON

注意点

テクスチャアニメーションはプリムのプロパティです (例えば、アニメーションを開始させてからスクリプトを抜くことができます。いずれにせよプリムはその設定を覚えています)。しかし、2009 年 1 月時点ではまだ、テクスチャアニメーションは Shift ドラッグによってコピーされるとその設定が消えてしまうプリムプロパティとなっています。最初にこの問題が VWR-640 でもちあがり、SVC-3925 で分離独立して議論されています。

早くざっくりと GIF をアニメーションテクスチャに変換するオンラインツールがこちらにあります。 http://www.peregrinesalon.com/anim/ (2009 年 1 月現在で有効なリンクです)

関連項目

特記事項

All Issues

~ Search JIRA for related Issues
   Some persistent prim properties lost when duplicated
   Texture Animation is not copied (llSetTextureAnim)
   Texture animations ignore repeats per face

脚注

  1. ^ しかし、rate がマイナスで REVERSE フラグが使用されていると、効果が打ち消されます。

Signature

function void llSetTextureAnim( integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。