Ren'Py Pseudo animation / image loop

Deleted member 1121028

Well-Known Member
Dec 28, 2018
1,716
3,292
I got a problem with the most basic thing ever:

Python:
image loop:
    "loop/loop01.png"
    pause 0.5
    "loop/loop02.png"
    pause 0.5
    repeat
Whatever the number of the pause value, it doesn't do anything (I could put 0.1 or 10000 it doesn't change anything), the two image will always 'play' at the same speed... I looked everywhere but I can't see why it does that and it drives me crazy lol o_O
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,685
In my example I use the images directly, without declaring (I usually do that), but if you need to declare them as you do, you can try this:

Code:
image loop:
    "loop/loop01.png"
    pause 0.5
    "loop/loop02.png"
    pause 0.5
    repeat

label start:
    show loop
    pause  # Maybe you're missing this pause
 

Canto Forte

Post Pro
Jul 10, 2017
20,926
25,547
If the images are too big .. I dunno ... maybe the speed of the game, the one in the settings, might be messing with how quickly the engine can show them images looped ... might be a trick to the eye
 

Deleted member 1121028

Well-Known Member
Dec 28, 2018
1,716
3,292
Try this:
Code:
scene loop01:
    pause 0.5
    "loop02"
    pause 0.5
    repeat
pause
Maybe your problem is that the "pause" at the end is missing.
Thanks!

Tried with your first exemple, and it worked!
If I do like your second exemple (without declaring), it just skip all pauses (I'm not sure why, it's basically the same thing, no?).

That said thank you very much again!

If the images are too big .. I dunno ... maybe the speed of the game
1980x1200, around 3,2 Mo, iirc speed is at max.
 
  • Like
Reactions: Porcus Dev

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,685
Thanks!

Tried with your first exemple, and it worked!
If I do like your second exemple (without declaring), it just skip all pauses (I'm not sure why, it's basically the same thing, no?).

That said thank you very much again!


1980x1200, around 3,2 Mo, iirc speed is at max.
I'm glad to hear it worked :)

The second example (as you did) is by declaring it before; my first example, the one that has worked for you, is undeclared.

I think that as you did it should also work, but I don't know what can happen, as I say, I don't usually declare if it isn't really necessary.
(Have you tried to change the name you declare? "loop", maybe renpy won't like it, try with "loop_1" for example)


BTW, 3,2Mb is quite... Daz generates very big PNG, it's better to convert them to webp or jpg and for sure that size can be reduced to 0.6Mb ;)
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,685
Another thing... if you need to make dissolves between the images you can too:
Code:
scene loop01 with dissolve:
    pause 0.5
    "loop02" with dissolve
    pause 0.5
    repeat
pause
 
  • Wow
Reactions: Canto Forte

Deleted member 1121028

Well-Known Member
Dec 28, 2018
1,716
3,292
The weird thing is, if I don't declare my image and use a direct path ("loop/loop1.png"), it skip all pauses.
As soon I use an alias(declare), it "play" the pause. And it makes no sense for me lol. I'm sure it's something I do wrong and I'm retarded but still confused. (iirc I can add any transitions with an alias/declare but does nothing with direct path method)
 

Canto Forte

Post Pro
Jul 10, 2017
20,926
25,547
Recently ...
One very well known dev put damper on cache in ren'Py and got it from 1GB down to 300MB
for compatibility with slower PCs.

Also ... seemingly nicely coded animation of 3-5 renders full HD using pauses did not comply and did not show ... because game speed was above 30% in the settings.

Fiddle with game speed and text speed ... Maybe too large images just do not compile at high speeds.
 

the66

beware, the germans are cumming
Modder
Respected User
Donor
Jan 27, 2017
7,581
23,484
Python:
show loop:
    alpha 0.
    "loop01.png"
    linear 1. alpha 1.
    block:
        "loop01.png"
        .5
        "loop02.png"
        .5
        repeat
"some dialogue"
just to show, that you can use all of Ren'Py's atl stuff here. you need no pause statement, the value is enough.
and the created image/animation is shown till the next scene statement or you hide the image. however you can show other images infront of it. ok also behind, but where's the point unless your animation has transparent areas.
 

Honey hunters

Member
Jan 23, 2020
118
26
Hi guy I'm new in Daz and Ren'Py , I want to know how to create a sex animation for my visual novel, please help me if you know and give me some tip for making sex animation
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,553
2,166
Hi guy I'm new in Daz and Ren'Py , I want to know how to create a sex animation for my visual novel, please help me if you know and give me some tip for making sex animation
I can't speak for the practice... but I can speak in general terms.

You create a scene in a package like Daz3D.
Then you use the timeline functions to create a "keyframe" at the end of the animation which is exactly the same as the beginning of the animation. Then create another keyframe somewhere in the middle of your animation, select that keyframe as being the active position within the timeline and move your models' arms, legs, whatever to be at the extreme points of their movement during the animation.

Let's call the keyframe right at the beginning "A", the one at the end "C" and the one in the middle "B".

If you render your animated sequence now, Daz would count the number of frames between "A" and "B" and calculate how far each skeletal bone would move per frame. It would then render "A", then move the bones by the amount it's calculated, render the next frame , and rinse and repeat until it reaches "B". Then it would do the same between "B" and "C".

Since"A" and "C" are identical, you can throw away the last frame and then stitch all the rendered images together like it's described above, putting in a tiny delay between each frame if needed.

When shown, it's be like the old style cartoons or drawing a stick figure in the corner of a school book, each image slightly different than the one before, but always returning back to the starting point... so when it repeats, you don't notice where the join is.

A much simpler way is to start at "A", forget the timeline and save it and then render it. Then Save As... "A1" and move the arms, legs, whatever a bit again, save and render it again. What you've created is a 2 frame animation. You create an RenPy image based on those two images. It's crude, but it gets the job done. Lots of games only use 2 or 3 frame animations on a loop.

Now human bodies doesn't move in linear straight lines from A -> B -> C... so you may want "B" to not be in the direct middle, or you may want there to the more keyframes than just 3, to create a more realistic human movement. That's entirely down to your skill and commitment.

In purely practical terms, if "A" and "C" were identical and "B" was directly in the middle... you wouldn't need to render from "B" to "C", because the movements from "A" to "B" would just be repeated in reverse order from "B" to "C". However I'm assuming that using only 3 keyframes wouldn't look right and "B" wouldn't be in the middle and more keyframes than just 3 would be used.

Alternatively, there are a lot of animation assets available on the Daz store. They will take all the "stop motion" animation type movements out of your hands and do it all for you. This is by far the simplest solution... if you can get your head around how they work.

The details in the posts above this one are about stitching images together if you get Daz to render each frame to a separate static image file. Although you could in theory get Daz to render each frame into a movie file instead (.mp4, .avi, .webm, etc.) and just play that instead.

Here's the first video I found when I did a .
(Now personally, I wouldn't create a 30 FPS video for a RenPy game... but that's entirely up to you).

You don't have permission to view the spoiler content. Log in or register now.
 
Last edited:

Trash_Panda

Member
Game Developer
Jan 9, 2019
471
2,344
1649954039887.png

Hello. This tip was really useful for me but i have a little problem here. Without sound my loop plays normally but renpy gives me an error when i try to play a sound file while loop is playing. Is there a workaround for this?
 

rayminator

Engaged Member
Respected User
Sep 26, 2018
3,040
3,114
View attachment 1756514

Hello. This tip was really useful for me but i have a little problem here. Without sound my loop plays normally but renpy gives me an error when i try to play a sound file while loop is playing. Is there a workaround for this?
it's giving you an error because you put it inside of the animation put it below show loop
 

Trash_Panda

Member
Game Developer
Jan 9, 2019
471
2,344
it's giving you an error because you put it inside of the animation put it below show loop
Well yes it works like that i already tested it. In my scene the guy first fondles the girl's ass then slaps at the end, its a loop and i wanted to play an audio at the end of each loop but if i put the audio after 'show' command, then whenever player clicks it, the sound is played and loop is stopped, but if i dont play any audio, the story text continues to appear and loop plays normally.

Ultimately im wanting to play the loop with audio while player is able to scroll through texts. I've made some research on it and it seems impossible as image command doesnt support audio playback. If anyone has a workaround that i would be very grateful.
 
Last edited: