Renpy Live2D Tutorial for Renpy 7.4.0

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
galatra303
Newbie
Posts: 12
Joined: Fri Jan 22, 2021 2:31 pm
Completed: 1
Organization: Galatra Games
Github: galatra303
Soundcloud: galatra303
itch: galatra303
Location: Houston, TX
Contact:

Renpy Live2D Tutorial for Renpy 7.4.0

#1 Post by galatra303 »

Hi everyone,

My name is Carl from Galatra Games and I'm here to introduce my tutorial for displaying Live2D characters in Renpy 7.4.0.

I have a video here that I posted in my Youtube Channel, Galatra Games, which explains instructions on how to display any Live2D characters properly based on what I read in the Renpy.org's documentation, link: https://www.renpy.org/dev-doc/html/live2d.html

Please note at the time of this video recording, I was using the Renpy 7.4.0 build.
***UPDATE: Renpy 7.4.1 was released today and the coding in this tutorial will work the same way.***

Here is the video:



First off, I want to give kudos to the forum user: asfdfdfd, who attempted to display Live2D characters in the previous Renpy build version, but now with Renpy 7.4.0, it is now possible to bring Live2D characters to life based on my tutorial video. I also want to thank PyTom for creating this wonderful visual novel engine, Ren'py.

Background image is from UncleMugen, @mugenjohncel

All Live2D characters used in this tutorial were from the Live2D Cubism 3 free edition.

You're welcome to leave any comments, questions, or suggestions in this topic.

Thank you and enjoy the video.

-Carl
Galatra Games, 2021.

User avatar
Tiger Lyz
Newbie
Posts: 11
Joined: Fri Jan 17, 2020 4:09 am
Projects: Curvy heroine&Virtual Boyfriend, Homunculus, Voice of Paradaise, The Ugly Princess...
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#2 Post by Tiger Lyz »

Thanks, thanks, thanks!

(I'm sorry, my english is very bad)

Maybe I shouldn't ask in this thread, but I would like to use this tool and animate my characters in my project, but if I use my Live2D character in my visual novel, do I have to pay the SDK Release License (Publication License Agreement) just as it says here: https://www.live2d.com/en/download/cubi ... e-license/, or is the payment of the annual subscription Live2D Cubism PRO for indie enough to avoid that charge?

Again, thank you, thank you, thank you for your input. It's great! :D

galatra303
Newbie
Posts: 12
Joined: Fri Jan 22, 2021 2:31 pm
Completed: 1
Organization: Galatra Games
Github: galatra303
Soundcloud: galatra303
itch: galatra303
Location: Houston, TX
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#3 Post by galatra303 »

Hi, Tiger Lyz,

According to Pytom via Renpy.org, I recommend a "yes" to that answer because you have to pay a Live2D Indie license via Live2D's website: https://store.live2d.com/en/ before you distribute your game either Steam, Itch.io, or other game distribution platforms. Even though you're using the free models from Live2D, it won't cut it, but you can use them as examples for your visual novel project and present them on your Youtube channel.

Also, if you have any problems loading your custom Live2D model in Renpy. Please let me know. I'll be glad to help to best of my ability. Thank you.

sankaman31
Newbie
Posts: 1
Joined: Mon Dec 28, 2020 1:22 am
Contact:

Renpy Live2D Custom Model, Motion File Problem

#4 Post by sankaman31 »

Hi, I'm having a problem with showing custom exported live2D motion files. `show character` shows the character as a still image but when you add the motion file behind it it just shows a Renpy template model with the motion file as text.

The thing is that I tested this with 2 premade live2d characters and it seemed to work fine, but when I used a custom character and custom motion file it would not work. So this leaves me to believe that the problem lies with the motion file itself.

Code: Select all

image hiyori = Live2D("resources/hiyori/runtime/hiyori_free_t06.model3.json", loop=True)
image borone = Live2D("resources/borone/runtime/borone.model3.json", loop=True)
show hiyori hiyori_m02
show borone hiyori_m02
The hiyori motion file works, but the motion file for "borone" does not, even when I exported it with the exact same name as the working one.
They should be equal in every way, so the only problem I could see is that the motion file itself is messed up or I'm missing something obvious.

Upon inspecting the log.txt you could see that Renpy was not loading my exported motion file:

Loading Live2D from u'resources/hiyori/runtime/hiyori_free_t06.model3.json'.
- motion hiyori_m06 -> motion/hiyori_m06.motion3.json
- motion hiyori_m02 -> motion/hiyori_m02.motion3.json
- motion hiyori_m08 -> motion/hiyori_m08.motion3.json
- motion hiyori_m07 -> motion/hiyori_m07.motion3.json
- motion hiyori_m05 -> motion/hiyori_m05.motion3.json
- motion hiyori_m01 -> motion/hiyori_m01.motion3.json
- motion hiyori_m04 -> motion/hiyori_m04.motion3.json
- motion hiyori_m03 -> motion/hiyori_m03.motion3.json
Loading Live2D from u'resources/borone/runtime/borone.model3.json'.
- nothing

So after nothing seemed to work I made a new test character named blokman and made a simple eye animation, exported all the necessary files that were also included in the sample character. File structure and live2d files being identical to the working samples. Made a quick new game and imported it only to get the exact same result.

https://gyazo.com/fa510491e85450f105bfe1139c32ef61 (introducing blokman) (yes his name is "kaas" in these pics)
https://gyazo.com/fb8911028b5634aa073bed349d5f4770 (blokman happy with his friends)
https://gyazo.com/ed8823c34bdff15c8907dae33bfdfb22 (code w/ name only)
https://gyazo.com/66666fee2fb99fd1942872672e7e0b22 (blokman dieded rip)
https://gyazo.com/fb538d5b70ae94646760f48cc97e1b2a (code w/ name and motionfile)


While I was trying all these things, Renpytom who I assume is the creator of Renpy was helping me find a solution but eventually I sent him the demo of Blokman for him to take a look at what could be the problem.

https://gyazo.com/ad249ac9648bcc2008723ee53077979f (chat log)

So he is also not sure about what the problem is, but it just looks like Renpy is not detecting the file and he says that there will be a fix for the problem in Ren'Py 7.4.2 which will release soon.

Basically, I'm left with this quote: "Well I'm interested to see if other people had custom live2d characters working but I'm struggling to find that, I might post it on the forum. I'm also a complete beginner at live2d and I'm exporting without changing much at all and have no idea if I'm missing important settings that could have some impact on things."

So I basically wanna ask if anyone has made a custom live2d character move with motion files and if so how did you get it working?
Also if anyone wants to try to implement Blokman and make his eye jiggle work to solve this mystery that would be great, because I'm done at this point.

I'll attach the files if anyone wants to try.

Discord if you want to talk: Toasty#2332
Attachments
blokman game.rar
blokman renpy game files
(8.61 MiB) Downloaded 69 times
blokman.rar
blokman live2d character files
(41.48 KiB) Downloaded 52 times

galatra303
Newbie
Posts: 12
Joined: Fri Jan 22, 2021 2:31 pm
Completed: 1
Organization: Galatra Games
Github: galatra303
Soundcloud: galatra303
itch: galatra303
Location: Houston, TX
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#5 Post by galatra303 »

Hi sankamen31,

This is galatra303 from Galatra Games. I believe you're the one who spoke to me yesterday via Youtube on my YT channel, Galatra Games from the comments section.

Ok, now I happen to figure out the problem.

This is somewhat a bug within Ren'py when using the Pro Version of Live2D Cubism. When exporting the .can3 animation file into a motion.model3.json file, it somehow does not play the animation thoroughly. I've noticed Ren'py provided an error code when playing the eyeroll.model3.json animation, "None Type" object is not iterable. What this means here is Ren'py cannot read the .can3 files completely. Of course the only way to hack it would be is converting the .can3 files into a movie player, i.e. .OGV movie format, and then play it back as an animation movie display. However, we've already know that we don't want that. Overall, we might have to wait unti the next Ren'py update fixes this issue, but at the moment, this is an alternative solution to play back the Live2D animation motions in Ren'py. Took me long hours to figure this issue out.

How I did it was a signed up for the Live2D Cubism Pro Trial Edition, converted the blokman .can3 animation into a movie. Converted the .mp4 into .OGV movie format by using FFmpeg2theora. Placed the movie file into scene and wondrously, the movie played seamlessly with the Haru Live2D character appearing on left of the screen, but only plays at 30FPS.

I gave it a shot, but we will have to wait and see.

If you have any questions, comments, or suggestion, you're welcome to let me know.

Thank you.

galatra303
Newbie
Posts: 12
Joined: Fri Jan 22, 2021 2:31 pm
Completed: 1
Organization: Galatra Games
Github: galatra303
Soundcloud: galatra303
itch: galatra303
Location: Houston, TX
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#6 Post by galatra303 »

One following note is to play back the movie scene files, the code here is:

Code: Select all

image eyeroll movie = Movie(play="movie/eyeroll.ogv")

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#7 Post by Remix »

In the interim before updating to 7.4.2 you could just rename the ./motion/ folder to ./motions/

if motions and expressions are not defined in the model3.json file:

7.4.0 and 7.4.1 -- Ren'Py will look in a subfolder called exactly "motions" (with an s)

7.4.2 -- Ren'Py will look through all files in the base model folder and any sub folders as deep as needed and interpret any file ending motion3.json as a motion (similar with expressions, exp3.json if I recall).
(this would find them ok)
Frameworks & Scriptlets:

TEMbl4
Newbie
Posts: 2
Joined: Tue Feb 02, 2021 5:31 am
Github: Neko-Tyomka
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#8 Post by TEMbl4 »

Hello! I am from the comments.
I already wrote about an error when I try to create a new project and use your Resources folder.
Please look at the screenshots at this link: https://imgur.com/a/KHAJaAT

galatra303
Newbie
Posts: 12
Joined: Fri Jan 22, 2021 2:31 pm
Completed: 1
Organization: Galatra Games
Github: galatra303
Soundcloud: galatra303
itch: galatra303
Location: Houston, TX
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#9 Post by galatra303 »

Hi TEMbl4,

This is galatra303 from Galatra Games from the Galatra Games YT comment section.

https://imgur.com/a/SwV0NJ7

I have two questions regarding about the picture file above.

1) I've noticed there is a green check mark and a blue figure next to the motion and expression folder, what does this mean? I do apologize.

2) Try placing the motion folder with an 's' next to motion, as the previous forum user mentioned that tip above.

Please let me know.

Thank you.

galatra303
Newbie
Posts: 12
Joined: Fri Jan 22, 2021 2:31 pm
Completed: 1
Organization: Galatra Games
Github: galatra303
Soundcloud: galatra303
itch: galatra303
Location: Houston, TX
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#10 Post by galatra303 »

I finished making detailed instructions from the Renpy Live2D video tutorial of how to setup Live2D in Renpy on my website, galatragames.net. This includes step-by-step instructions to display your Live2D characters, whether you are using the FREE or PRO versions of the Live2D Cubism Editor.

Please note this will work with the latest Renpy version, 7.4.2. and beyond.

Link: http://www.galatragames.net/renpy-live-2d

Any comments, suggestions, or feedback are welcomed.

TEMbl4
Newbie
Posts: 2
Joined: Tue Feb 02, 2021 5:31 am
Github: Neko-Tyomka
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#11 Post by TEMbl4 »

Thanks for your tutorial site! Everything worked!

galatra303
Newbie
Posts: 12
Joined: Fri Jan 22, 2021 2:31 pm
Completed: 1
Organization: Galatra Games
Github: galatra303
Soundcloud: galatra303
itch: galatra303
Location: Houston, TX
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#12 Post by galatra303 »

Sounds perfect, TEMbl4,

I'm glad I can help.

MaxLib
Newbie
Posts: 6
Joined: Sat Feb 13, 2021 3:25 pm
Completed: none yet.
Projects: Under Development
Deviantart: MaximumLiberty
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#13 Post by MaxLib »

Hi Everyone!

I would like to ask your advice on Renpy + Live2d. I went through the renpy+live2d tutorial video it is very useful and, well understood. In the video your live2d model animation is showing with continuous fps, while on my side I experience a huge slowdown in the editor.

If others have experienced such a slowdown, what could be the solution?

For me, the "wanko" model alone runs stably. I have already tried a scene with Hiyori, Haru, Mark hopelessly tearing. I experience the same issue from Renpy Editor 7.4.0 to 7.4.3 Nightly build.

In Tyranobuilder I can display 10 Hiyori at a time without fps drop.

galatra303
Newbie
Posts: 12
Joined: Fri Jan 22, 2021 2:31 pm
Completed: 1
Organization: Galatra Games
Github: galatra303
Soundcloud: galatra303
itch: galatra303
Location: Houston, TX
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#14 Post by galatra303 »

Hi MaxLib,

Question: Do you happen to know what kind of PC specs are on your computer? Have you tried updating your video drivers?

The Renpy Live2D tutorial was recorded on my ASUS ROG gaming laptop with i7-4700HQ (4th Gen) and NVIDIA Geforce 765M. Supports OpenGL ES 2.0 and 3.0.
The latest video driver for my Nvidia Geforce765 installed is up to 425.19 (The last supporting driver for my graphics card since April 11, 2019.)

Thank you.

galatra303
Newbie
Posts: 12
Joined: Fri Jan 22, 2021 2:31 pm
Completed: 1
Organization: Galatra Games
Github: galatra303
Soundcloud: galatra303
itch: galatra303
Location: Houston, TX
Contact:

Re: Renpy Live2D Tutorial for Renpy 7.4.0

#15 Post by galatra303 »

On another note, the last Renpy Live2D video I'd created shows three characters displaying at once with no slowdowns, but I have not tried out placing four Live2D characters altogether at once.

Example video here below:


Post Reply

Who is online

Users browsing this forum: No registered users