Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Texture Anim help - Blinking eyes

Merry Calliope
The 13th Rabbit
Join date: 24 Mar 2005
Posts: 89
04-27-2005 13:47
So I've got 'test' eyes texture mapped onto a sphere and now I'm trying to animate a blink. I managed to get it to blink once, quite nicely, and then the animation stops.

This is my first time attempting to script at all. Someone pointed me toward the merry-go-round at the Withnail Estate which has a tutorial on a blinking ram but for some reason I am unable to retrieve the scripts said to be free for the taking on the merry-go-round itself. *_*

So with the smallest amount of skill and information to go this is what I've come up with so far...

default {
state_entry() {
llSetTextureAnim(ANIM_ON | PING_PONG, ALL_SIDES,2,2,0,0,5.0);
}
}

I'm sure there's got to be more to this! ^o^

Thanks for any help!
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
04-27-2005 13:50
Found here.

CODE
// Add "LOOP" to the params
llSetTextureAnim(ANIM_ON | PING_PONG | LOOP, ALL_SIDES,2,2,0,0,5.0);

Thank you, drive through. :D
_____________________
---
Merry Calliope
The 13th Rabbit
Join date: 24 Mar 2005
Posts: 89
04-27-2005 13:56
*facepalms*

I can't believe how long I stared at that wiki page and it never occurred to me to try 'loop'.

Thank you! *^-^*
Merry Calliope
The 13th Rabbit
Join date: 24 Mar 2005
Posts: 89
04-27-2005 14:03
Oops...that just seems to make the eyes 'flutter'. No pause between the blinks. Looks like my sphere is having a bad contacts day. :D

Any ideas how to get a more natural blink cycle? ^-^;
Psyra Extraordinaire
Corra Nacunda Chieftain
Join date: 24 Jul 2004
Posts: 1,533
04-27-2005 14:14
Chances are, you'll have to hav multiple frames with the eyes open, then your frames with them closing/closed....

It loops all frames at the same speed, so if you have one frame of open eyes, one frame of half-lidded eyes, one frame of closed eyes... you'll get BLINKBLINKBLINKBLINKBLINKBLINK! To get a long delay you'll have to add copies of the open frame on.... so, say, have 20 open eyes frames, then your halfclosed then closed frame.

They probably will still blink pretty quick, and with 20 frames of eyes you'll have a huge texture forming. May have to resort to other methods. :>
_____________________
E-Mail Psyra at psyralbakor_at_yahoo_dot_com, Visit my Webpage at www.psyra.ca :)

Visit me in-world at the Avaria sims, in Grendel's Children! ^^
Arito Cotton
Still Addicted
Join date: 25 Aug 2003
Posts: 131
04-27-2005 14:15
Something like this may work (building off of Jeffrey's example):

You may need to play with the llSetTextureAnim options some also.

CODE

default
{
state_entry()
{
llSetTimerEvent(7.0);
}
timer()
{
llSetTextureAnim(ANIM_ON | PING_PONG, ALL_SIDES, 2, 2, 0, 0, 5.0);
}
}
_____________________
Merry Calliope
The 13th Rabbit
Join date: 24 Mar 2005
Posts: 89
04-27-2005 14:30
Hm...still not blinking. At least not consistantly. Blinks once when the prim is changed in any way...like being linked or unlinked. Blinks once when the script is changed and saved.

I'm trying to go through the wiki myself but I'm afraid I'm just not clever enough to know what I'm looking for! ^-^;

Thanks for the help!
Davy Flytrap
Registered User
Join date: 21 Feb 2005
Posts: 146
04-27-2005 18:44
Hi Merry...you could always ask Forseti...cant remember the surname.

She has made a tutorial for this..

Regards, Davy
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
04-27-2005 18:52
I think there is a blinking script in the script library.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Ursula Madison
Chewbacca is my co-pilot
Join date: 31 Jul 2004
Posts: 713
04-27-2005 19:06
From: Merry Calliope
Hm...still not blinking. At least not consistantly. Blinks once when the prim is changed in any way...like being linked or unlinked. Blinks once when the script is changed and saved.

I'm trying to go through the wiki myself but I'm afraid I'm just not clever enough to know what I'm looking for! ^-^;

Thanks for the help!

Ari's script with the timer event is the right track, but the LOOP was left out again. :D
_____________________
"Huh... did everything just taste purple for a second?" -- Philip J. Fry
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
04-28-2005 03:04
Huh. This a bug or something? I know for fact there's an example of a texture animation that's smooth in the newbie inventory, and LOOP is the parameter to go for.... hm. :o

It's worked for me in the past.

Edit: Nevermind. Yeah, you want a timer. I'm too used to building long frames into my animations instead.

Posting when tired: Bad idea.
_____________________
---
Logan Bauer
Inept Adept
Join date: 13 Jun 2004
Posts: 2,237
04-29-2005 18:21
From: Merry Calliope
Any ideas how to get a more natural blink cycle? ^-^;


Here's what I use in my pet moogles and devils. It doesn't use animated textures (which would probably be more efficient), but might accomplish what you're aiming for...

CODE

default
{
state_entry()
{
llSetTimerEvent(30.0);
llSetTexture("NORMAL PET FACE",ALL_SIDES);
}

timer()
{
llSetTexture("BLINKING PET FACE",ALL_SIDES);
llSleep(.2);
llSetTexture("NORMAL PET FACE",ALL_SIDES);
llSetTimerEvent(llFrand(20)+3);

}



}



Replace "BLINKING PET FACE" and "NORMAL PET FACE" with your eyes-shut and eyes-open textures. As is, once rezzed it will wait 30 seconds, blink, and then set reset the timer for X seconds, where X is the last line above " llSetTimerEvent(llFrand(20)+3);", I.E random number between 3 and 23 seconds.