Problems Creating Movie with Transparency

Questions, skill improvement, and respectful critique involving music, sound, and movies.
Post Reply
Message
Author
CDIII
Newbie
Posts: 9
Joined: Sun Mar 17, 2019 2:12 am
Contact:

Problems Creating Movie with Transparency

#1 Post by CDIII »

This is not a purely Renpy, or even mainly Renpy question, but relates directly to what I am trying to do, and I hope someone using a similar toolset ( Renpy, Blender and Spine 2D) might have an answer to my problem.

I recently purchased the Spline 2D Animation app and am trying to use it's rendered output for character overlays/animations in Renpy. I am trying to get a movie with a transparent background. I have tried exporting the animated sequence directly from Spine as a movie using the webm format which Renpy can read. In spite of the preview having a transparent background, and checking "Transparent Background" in the export settings, the background shows as black in Renpy.

So I exported as a PNG sequence, which does come out as expected with a transparent background and I tried exporting a movie of the sequence using the Blender Compositor. In spite of the Viewer preview showing Transparent, still renders having a transparent background and the background showing transparency as it renders the animation, once again the rendered video has a black background when viewed and in Renpy.

I can assemble the stills laboriously into a sequence in Renpy and have tried it out, but I feel like these sequences don't load smoothly, are time consuming to create and take up a lot of space in the script, as my sequence is currently 40 frames long.

I've looked into this a bit and apart from Spine, I'm not a super newbie. In Blender, I have transparency checked in the film tab. I've tried plugging the alpha directly into the composite node. I have RGBA selected in the render output panel. I have Use Alpha checked on both the Viewer and the Composite nodes.

The movie export settings I'm using are:

File Format: FFmpeg Video - Color RGBA

Encoding - Container: I've tried both WebM and Matroska

Video Codec: WEBM/VP9

Output Quality: I've tried High, Perceptually Lossless and Lossless.

Encoding Speed: Slowest

Audio Codec: No Audio

In the compositor I am using a transform node to position the PNG sequence, an Alpha Over node (compositing over an empty image for placement) and two instances of the Filter node. Whether is arrangement might cause some sort of problem I'm not sure, but as I've said the stills show the transparency and I've also tried plugging the PNG sequence directly into the Composite node to test this and the result was still a movie with black background

If anyone has a clue why I can't get a video with transparency from Blender for use in Renpy, any help or tips would be great.

Thanks!

CDIII
Newbie
Posts: 9
Joined: Sun Mar 17, 2019 2:12 am
Contact:

Re: Problems Creating Movie with Transparency

#2 Post by CDIII »

OK, sort of worked it out thanks to this video: https://youtu.be/6tNE5fRhIzM

Not crazy about having to use a command-line interface app, but since the video above lays out how to use FFmpeg to create the movie file and the mask file in good detail, I can manage it.

If anyone knows a non-command line way to do this, I'd love to hear, otherwise thanks to anyone that took a look to try to help!

User avatar
Sarchalen
Regular
Posts: 29
Joined: Tue Aug 08, 2017 5:23 pm
Projects: Sugawara Chronicle
Contact:

Re: Problems Creating Movie with Transparency

#3 Post by Sarchalen »

Yes, this is the correct way to do it. Renpy doesn't currently have the ability to use alpha channels for video, so instead you provide the video itself, and a mask to tell it which part should be transparent.

FFMPEG is the best tool, yes it's command line, but it sort of has to be, as it would be ridiculously complex to put on a GUI.

It's a good program to learn as you get further into development! You can use it to rescale and compress videos, easily convert any format to any format, and do some crazy processing. The more you can "bake" into your videos, the less rendering Renpy has to do, and you can make your games look absolutely amazing without lag.

CDIII
Newbie
Posts: 9
Joined: Sun Mar 17, 2019 2:12 am
Contact:

Re: Problems Creating Movie with Transparency

#4 Post by CDIII »

Thanks for the reply.

Even though command-line/scripting type work is a bit out of my normal wheelhouse, I really do need to learn to embrace it more if I want to do this type of work more efficiently. I have to admit that once I set up a target directory and I had the pre-written commands prepared, FFmpeg proved an extremely fast and efficient way to turn a series of PNG images into the two movie files needed for Renpy.

Post Reply

Who is online

Users browsing this forum: No registered users