Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Do you know a way to "preload" an animation?

Zozo Plympton
Registered User
Join date: 26 Oct 2006
Posts: 26
12-30-2006 07:30
Here is my issue:
- I have 2 animations A and B
- I would like to start them one after other in a seqvence: A and THEN B.
- The code I am using is something like:
llStartAnimation(A);
llSleep(0.1);
llStartAnimation(B);

The problem I have is that the first time when I trigger this even the animations have to be downloaded to the avatar. Animation A takes longer to download than animation B.
So B will actually start before A! Because of this the final animation resulting for superposing B on A is wrong.
If I grigger this for the second time - after both animations have downloaded - then everithing works fine.

Now the Question: Do you know any clever way to somehow preload the Animations?
Obviously there is no API for this... but maybe you know a clever workaround?!

Thanks.
Zozo Plympton
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
12-30-2006 18:03
Let me think....


Okay!,

How about adding a llStartAnimation(x); followed by a llStopAnimation(x); in the on_rez() event. This could cause the animation to load, yet not be played when it arrives. You could do this for all your animation sequences so they'll be ready for the main event.

I've not tested this idea, so I don't know if llStopAnimation() actually stops the downloading of an animation or just stops the playing of it.

Give it a whirl!
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
12-30-2006 18:12
I realize this may have already occurred to you, but you could make a new animation that does precisely what you want, instead of overriding certain parts of another animation?
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
12-30-2006 21:07
just play the animations on a hidden prim or the inside of a hollow sphere.
that way they are loaded and running when you do play them
-LW
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
12-31-2006 04:19
From: Lightwave Valkyrie
just play the animations on a hidden prim or the inside of a hollow sphere.
that way they are loaded and running when you do play them
-LW


The animations here are referring to Avatar animations, not texture animations (which your method does work for).
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
12-31-2006 11:35
Looks to me Zozo that the code lines will trigger both animations on exit of the event. The last one triggered will override the first, so...

Try this... trigger the first and set a timer for 0.1 instead of a sleep, then trigger the second from the timer event. I'd bet the preload issue will go away for you.

/esc
_____________________
http://slurl.com/secondlife/Together
Zozo Plympton
Registered User
Join date: 26 Oct 2006
Posts: 26
01-01-2007 19:49
From: Escort DeFarge
Looks to me Zozo that the code lines will trigger both animations on exit of the event. The last one triggered will override the first, so...

Try this... trigger the first and set a timer for 0.1 instead of a sleep, then trigger the second from the timer event. I'd bet the preload issue will go away for you.

/esc


No... this doesn't help.
The animation may be triggered on exit of event. But they start playing when downloaded to the avatar.
Usually the sacond animation is the same.. so that is always there while the first animation changes.

So a lot of times Animation A will start way after animation B started.. timer or no timer...

Thanks for the input though!
Zozo
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
01-04-2007 01:09
oops boy was i way off hehe.
how about playing both anims at same time, anim A as priority4 and anm B as
priority3, A will override B but will B still preload? this will require anim A to use all the
bones anim B uses to override it. but i think that would work...
-LW