diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2024-08-30 21:17:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-30 21:17:39 +0300 |
commit | 487973d3f0ee9b8583b3d977ca6a405cba5fe518 (patch) | |
tree | 8ed6d43d2c79e57edef5e1b92f19ca310eef2089 /indra/newview/scripts/lua/require | |
parent | 11e6c77129ae27756df627ccc1ea0ffa279976e6 (diff) | |
parent | 4312a2b7703f6ba35a1cdcd1edc48dddfe084270 (diff) |
Merge pull request #2470 from secondlife/lua-play-anim
Add Lua api to start/stop playing animation
Diffstat (limited to 'indra/newview/scripts/lua/require')
-rw-r--r-- | indra/newview/scripts/lua/require/LLAgent.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/require/LLAgent.lua b/indra/newview/scripts/lua/require/LLAgent.lua index 5ee092f2f6..07ef1e0b0b 100644 --- a/indra/newview/scripts/lua/require/LLAgent.lua +++ b/indra/newview/scripts/lua/require/LLAgent.lua @@ -53,4 +53,22 @@ function LLAgent.removeCamParams() leap.send('LLAgent', {op = 'removeCameraParams'}) end +-- Play specified animation by "item_id" locally +-- if "inworld" is specified as true, animation will be played inworld instead +function LLAgent.playAnimation(...) + local args = mapargs('item_id,inworld', ...) + args.op = 'playAnimation' + return leap.request('LLAgent', args) +end + +function LLAgent.stopAnimation(item_id) + return leap.request('LLAgent', {op = 'stopAnimation', item_id=item_id}) +end + +-- Get animation info by "item_id" +-- reply contains "duration", "is_loop", "num_joints", "asset_id", "priority" +function LLAgent.getAnimationInfo(item_id) + return leap.request('LLAgent', {op = 'getAnimationInfo', item_id=item_id}).anim_info +end + return LLAgent |