r/RenPy • • 5d ago

Question Blinking animation question

Okay so I'm still currently figuring out how to do blinking/lip flap animations, but I thought I'd ask before I get too deep into writing code: can blinks be "dynamic" for lack of a better word?

Like if I have the images "eyes relaxed," "eyes happy," and "eyes sad" but I don't want to have to make new animations for every single one, as I have only one "blink" image, is there a way to tell Ren'Py that "eyes normal" = whatever image is showing?? Like I have my eyes grouped in a layered image, so in my head it should work, but does it in practice?

Let me know if this explanation doesn't make any sense

4 Upvotes

4 comments sorted by

1

u/AutoModerator 5d ago

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/mazkof_games 5d ago

Yes, but there isn't an alias that means "whatever eyes are showing." Reuse one closed-eye image with a transform that takes the open expression:

transform blink(eye):
eye
pause 3.0
"eyes_blink"
pause 0.15
repeat

In the layeredimage eyes group, each attribute is just blink("eyes_relaxed"), blink("eyes_happy"), and so on, so you don't write a new animation per emotion. Make the blink image the same size and crop as the open eyes or the face will jump.

0

u/CrimsonDiamond98 5d ago

I personally animate my characters and their eye movement with another program and then save them as "character_happy", "character_sad" etc. and use a simple renpy code like "show character_happy at left" e.g.

2

u/shyLachi 5d ago

Totally irrelevant to this topic but you shouldn't use underscore for sprites

The official documentation explains how it works.  https://www.renpy.org/doc/html/displaying_images.html