|
Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
|
10-09-2008 14:48
I thought it'd be nice if a device that started animations could also stop them, even if it was reset. I don't see a way to do this.
I can get a list of animations (LlGetAnimationList) but this gives me keys, and as far as I can tell I can't get keys for animations I start because llGetInventoryKey won't give them to me for most anims (because they aren't full-perm).
Am I missing something? I'd like to have a script be able to get a list of animations for an avatar and stop only the ones that it started, but not have to rely on remembering which it started. I want it to recognize any of its own by name or key and stop them.
Impossible?
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
10-09-2008 14:51
You might take the "dumb" approach and stop all animations you find in the object's inventory, plus any built-in ones your script may start. It's OK to stop an animation even if it isn't actually running.
|
|
Anya Ristow
Vengeance Studio
Join date: 21 Sep 2006
Posts: 1,243
|
10-11-2008 08:05
There will potentially be a lot of animations in the device. I'll try the dumb approach in a laggy sim and see if it's a problem.
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
10-11-2008 09:44
The extra stops may not be much of a concern regarding lag. The viewer itself does this constantly. Whenever it switches stock stands, it sends stops for all of them to the sim because it doesn't keep track. So, an occasional stream of stops on a script reset isn't really adding much to the mix.
|
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
10-11-2008 18:44
If there's an AO running the avie will restart any required anims so it's simplest just to stop all of the currently running anims by doing something like... stop_animations(key avatar) { if (llGetPermissionsKey() == avatar && llGetAgentSize(avatar) != ZERO_VECTOR) { list animations = llGetAnimationList(avatar); integer index = 0; integer length = llGetListLength(animations); for (index = 0; index < length; index++) { llStopAnimation(llList2Key(animations, index)); } } }hth, /esc
_____________________
http://slurl.com/secondlife/Together
|