Movie Sprites

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Message
Author
maricore
Regular
Posts: 41
Joined: Fri Jan 22, 2016 5:48 pm

Re: Movie Sprites

#31 Post by maricore »

okay, something is wrong with my animation, it made the character transparent but not the bg, is it something wrong with the webm format? because when i exported it as gif it was fine, when i converted it, it switched the hole thing

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Movie Sprites

#32 Post by PyTom »

Did you also export a mask movie?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
ketskari
Veteran
Posts: 296
Joined: Tue Dec 21, 2010 6:22 pm
Completed: Asher, Sunrise, Tell a Demon
Projects: Asher Remake, TEoA
Organization: Sun Labyrinth
Tumblr: sunlabyrinth
Deviantart: sunlabyrinth
itch: sunlabyrinth
Contact:

Re: Movie Sprites

#33 Post by ketskari »

Tried my project, built with 6.99.10, on a friend's new Windows 10 laptop and the looping animation is freezing after a few seconds.

maricore
Regular
Posts: 41
Joined: Fri Jan 22, 2016 5:48 pm

Re: Movie Sprites

#34 Post by maricore »

PyTom wrote:Did you also export a mask movie?
Well...yeah, both are actually the same file

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Movie Sprites

#35 Post by xela »

Red channel of the mask movie is used as alpha channel for the main movie. The only more or less passable scenario where you can use the same movie for both is a really "reddish" movie on a black background. Like an intense campfire in night time... it will still prolly not be "perfect" but it might be ok.
Like what we're doing? Support us at:
Image

User avatar
firecat
Miko-Class Veteran
Posts: 540
Joined: Sat Oct 25, 2014 6:20 pm
Completed: The Unknowns Saga series
Projects: The Unknown Saga series
Tumblr: bigattck
Deviantart: bigattck
Skype: bigattck firecat
Soundcloud: bigattck-firecat
Contact:

Re: Movie Sprites

#36 Post by firecat »

nyaatrap wrote:I think ffmpeg should be documented somewhere. I couldn't find other free applications that can make a mask video file. (except commercial applications like Adobe AE)
found one free and it has almost everything AE offers, the only problem is how hard it is to use.
https://www.blackmagicdesign.com/products/fusion
Image


Image


special thanks to nantoka.main.jp and iichan_lolbot

maricore
Regular
Posts: 41
Joined: Fri Jan 22, 2016 5:48 pm

Re: Movie Sprites

#37 Post by maricore »

PyTom wrote:Did you also export a mask movie?
oh yes that was the problem hehe.

thanks so much, Also is there a way to make it stop looping?

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Movie Sprites

#38 Post by PyTom »

There's no way to make it stop looping. Basically, if the looping stopped, the movie would no longer be playing and the sprite would go away.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Movie Sprites

#39 Post by xela »

maricore wrote:
PyTom wrote:Did you also export a mask movie?
oh yes that was the problem hehe.

thanks so much, Also is there a way to make it stop looping?
The movie will go away just as PyTom said but you can edit the code a little bit to specify the amount of loops you want before that happens.

Looping was unacceptable for our project because we use complex conditioned animation sequences and we had to make sure that movie stopped after x amount of loops, so I've edited the class a bit to take amount of loops you want as an argument:

Code: Select all

    class MovieLooped(renpy.display.video.Movie):
        """Play Movie Sprites without loops. Until Ren'Py permits that by default, this can be used.
        """
        def __init__(self, *args, **kwargs):
            super(MovieLooped, self).__init__(*args, **kwargs)
            self.loops = kwargs.get("loops", 1)
            
        def play(self, old):
            if old is None:
                old_play = None
            else:
                old_play = old._play
    
            if self._play != old_play:
                if self._play:
                    renpy.audio.music.play([self._play]*self.loops, channel=self.channel, loop=False, synchro_start=True)
    
                    if self.mask:
                        renpy.audio.music.play([self.mask]*self.loops, channel=self.mask_channel, loop=False, synchro_start=True)
    
                else:
                    renpy.audio.music.stop(channel=self.channel)
    
                    if self.mask:
                        renpy.audio.music.stop(channel=self.mask_channel)
This worked really well for us so far. You simply copy/paste this to init python add amount of loops that you want as extra argument:

Code: Select all

image north = MovieLooped(channel="main_gfx_attacks", loops=2, play="content/gfx/be/webm/air/north/movie.webm", mask="content/gfx/be/webm/air/north/mask.webm")
You can replay the movie by hiding/showing the image as many times as you want, it works exactly as you'd expect.

=========>>>
You can also ATL it, showing the movie, pausing for the duration*x loops and switching to Null() but that worked less reliably and it sometimes went on for a couple more frames that it was supposed to... the above hasn't crapped out once so far and we're using them quite a bit.
Like what we're doing? Support us at:
Image

User avatar
The Monkey Ninja
Regular
Posts: 34
Joined: Mon Jul 05, 2010 5:06 pm
Projects: 3^07, OneTimeValentine, OtomeDesign
Organization: MooseCake Productions
Deviantart: the-monkey-ninja
Location: South Africa
Contact:

Re: Movie Sprites

#40 Post by The Monkey Ninja »

I've been trying this out for the last two days so I thought I'd ask now, haha.

Does Movie Sprites only support .webm? While I can get .mpg videos to play, the mask doesn't appear to work (and it is a different file). I'm actually trying to implement it for effects like little floating embers and such playing on loop.

Code: Select all

#######ANIMATED SCENIC EFFECTS:

    image movie = Movie(channel="movie", play="Embers_CO.mpg", mask="Embers_Al.mpg", size=(1920, 1080),  xpos=0, ypos=0, xanchor=0, yanchor=0)  
Has been defined in init before the start label and:

Code: Select all

    show movie with dissolve
is in the script following.

I've tried it with .avi, but .avi, even though supported I think, doesn't play or show at all. Of course, if Movie sprites only work for .webm then I guess this makes sense.

I'm also curious as to if there's a way to implement playing movies without the mask -- .avi, .mpg, .mov, as well as .mp4 all have the capability to export alpha channels and when dropped into AfterEffects they work as such. Or if I can support in some way to getting that implemented (I really want animated effects, but so far they produce 375 images which will take ages to define and I imagine would drive up the RAM use quite a bit).
--
Cloaks are wonderful things~ <3

My DA page for all my art:
http://the-monkey-ninja.deviantart.com/

Ex-Nanoreno2017 game One Time Valentine has a (very rough) demo out now!
viewtopic.php?f=43&t=43314

rawkinghorse
Newbie
Posts: 1
Joined: Sat Nov 24, 2018 6:43 pm
Contact:

Re: Movie Sprites

#41 Post by rawkinghorse »

Is there a way to ensure that the current loop of a movie sprite finishes before another movie sprite is shown?
I'm hoping to ensure continuity and prevent sudden jumps in a sequence of movie sprites.

I figure that it may be done through the play_callback function but I'm not sure where to start. (I didn't find much by Googling)

User avatar
Googaboga
Eileen-Class Veteran
Posts: 1395
Joined: Wed Dec 12, 2012 1:37 pm
Completed: https://gbpatch.itch.io/
Projects: Floret Bond, XOXO Blood Droplets, Our Life
Organization: GB Patch Games
Tumblr: gb-patch
itch: gbpatch
Contact:

Re: Movie Sprites

#42 Post by Googaboga »

I've been trying to get movie sprites to work for a project of mine. I used the ffmpeg method to turn pngs into webm with a mask. It works, but for some reason occasionally the mask fails and a black box appears behind the character for a moment. I'm not sure if it's an issue with my computer or if it's because I'm using 1920x1080 instead of a smaller scale or something else. Does anyone have a suggestion on where I should start to try potentially solving this? Oh, and my renpy is up to date.

Here's how it is usually-
https://gyazo.com/c2615e056e5326e48a2690ac9758e2c2

And here's the error-
https://gyazo.com/149553945a70767cae50657bea528680
[I'm sorry for the short loop]
In-Progress:
Floret Bond, XOXO Blood Droplets, Our Life
Released:
A Foretold Affair, My Magical Divorce Bureau, XOXO Droplets, Lake of Voices

User avatar
RVNSN
Regular
Posts: 36
Joined: Mon Apr 08, 2019 3:54 pm
Projects: Lust & Piracy
itch: rvnsn
Contact:

Re: Movie Sprites

#43 Post by RVNSN »

Can you use this to switch between displaying a video in a box and fullscreen without interruption?

And is it possible to play a movie and music at the same time? I want to make a lounge where the player can play music tracks from the game with the option of having a looping video play on a tv set in the lounge room or fullscreen.

Post Reply

Who is online

Users browsing this forum: No registered users