Giter Club home page Giter Club logo

renpy-live2d's Introduction

DEPRECATED

RenPy has native Live2D support now. Use it.

Introduction

This is attempt to create Live2D module for RenPy. This is WIP and not production version. Project has no ETA. This source code is invitation to developers that are willing to help with development of module.

This module works only with OpenGL renderer.

Installing

As for now prebuild version of this module available only for macOS and Windows.

  1. Go to the 'release' section and download latest release.
  2. Extract files and place 'live2d' folder to the 'game' folder of your RenPy project.
  3. Download Cubism Native SDK and replace 'CubismSDK/Core' folder of this library with 'Core' folder from downloaded SDK.
  4. You are ready to go.

Usage example

define h = Character("Hiyori")

init python:
    from live2d.displayable import Live2DDisplayable
    from renpy.loader import transfn

    sprite_live2d = Live2DDisplayable()

init:
    image sprite_live2d = sprite_live2d

label start:

    show sprite_live2d

    $ live2d_model_hiyori = sprite_live2d.scene.create_model(transfn(u'live2d_resources/Hiyori/'), u'Hiyori.model3.json')

    $ live2d_model_hiyori.start_random_motion(group = u"Idle", priority = 3)

    h "You've created a new Ren'Py game."

    $ live2d_model_hiyori.start_motion(group = u"TapBody", no = 0, priority = 3)

    h "Once you add a story, pictures, and music, you can release it to the world!"

    return

Building

This section is for those who wants to participate in extension development. If you do not want to participate in development and just want to use your Live2D models in RenPy — read 'Installing' section.

macOS

Extensions for RenPy should be built with custmoized Python 2.7.10 version that is configured for RenPy. The most convenient way is to use pyenv.

  1. Install pyenv.
brew install pyenv

If you want want to integrate pyenv into your shell read 'installation' section in pyenv manual. I assume that you want to use pyenv just to build module and do not want to make deep integration.

  1. Install python.
PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs4 --enable-shared" pyenv install 2.7.10    

If it fails with error read pyenv common build problems.

If you need to have multiple Python 2.7.10 installs use pyenv-alias plugin.

  1. Create folder to store python virtual environment. It will be mentioned as %TARGET_DIR%.
  2. Create virtual environment and install required packages.
cd %TARGET_DIR%
pyenv local 2.7.10
$(pyenv root)/versions/2.7.10/bin/pip install --upgrade pip
$(pyenv root)/versions/2.7.10/bin/pip install virtualenv
$(pyenv root)/versions/2.7.10/bin/virtualenv .
bin/pip install pyasn1==0.1.7 rsa==3.1.4 altgraph==0.12 macholib==1.7 cython==0.29.7

Now you have special Python build that is suitable for building Live2D module for RenPy:

  1. Download Cubism Native SDK and replace 'CubismSDK/Core' folder of this library with 'Core' folder from downloaded SDK.
  2. Open console and go to the folder where you placed content of this repository
  3. Launch
%TARGET_DIR%/bin/python setup.py build_ext --inplace
  1. Module is ready. Now you could launch RenPy game.

Linux

Should be similar to macOS but i could not confirm.

Windows

  1. Download and install Microsoft Visual C++ Compiler for Python 2.7
  2. Download and install x86 version of Python 2.7.10
  3. Download Cubism Native SDK and replace 'CubismSDK/Core' folder of this library with 'Core' folder from downloaded SDK.
  4. Launch 'Visual C++ 2008 32-bit Command Prompt' from 'Start' menu and go to 'CubismSDK/Core/dll/windows/x86' folder.
  5. Launch
dumpbin /EXPORTS Live2DCubismCore.dll > Live2DCubismCore.exports
  1. Edit 'Live2DCubismCore.exports' to create 'Live2DCubismCore.def' file. Also you could get ready 'def' file here but it may be a bit outdated so i recommend to create it by yourself.
  2. Launch
lib /def:Live2DCubismCore.def /out:Live2DCubismCore.lib
  1. Go to root module folder and launch
%PATH_TO_PYTHON%\python.exe setup.py build_ext --inplace --compiler=msvc
  1. Module is ready. Now you could launch RenPy game.

renpy-live2d's People

Contributors

asfdfdfd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

renpy-live2d's Issues

[Feature Request] DirectX Implementation

Hello, there.

Is it possible for you to implement DirectX support?
I'm not sure how often DirectX is used in Renpy, though.
If you don't think it is important, then perhaps it is better to just leave it.

Live2D Inc.: Regarding Cubism 3.0 SDK Core on this repository

Dear @asfdfdfd

Thank you so much for your contribution. It is very exciting to see a Live2D expert like you create unique and useful Framework.

However, we noticed that Cubism 3.0 SDK Core has been redistributed on this repository for the Framework. It is prohibited by our SDK regulation to redistribute the Core. Therefore we'd like you to delete the Core from this repository and ask your end users to download Live2D Native SDK from our official GitHub repository for the implement.
https://live2d.github.io/index.html#native

Again, we trully appreciate your devotion to Live2D community.

Thank you for your understanding.

Not compatible with cubism native sdk 4

C:\WINDOWS\system32>lib /def:Live2DCubismCore.def /out:Live2DCubismCore.libMicrosoft (R) Library Manager Version 9.00.30729.01Copyright (C) Microsoft Corporation.  All rights reserved.LINK : warning LNK4068: /MACHINE not specified; defaulting to X86LINK : fatal error LNK1104: cannot open file 'Live2DCubismCore.def'

Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

Dump of file Live2DCubismCore.dll
LINK : fatal error LNK1181: cannot open input file 'Live2DCubismCore.dll'

load_dynamic is unable to find the wrapper procedure

When init calls load_dynamic (triggered by a "from live2d.displayable import Live2DDisplayable") it blows up on my machine. I'm on Windows 10, with the latest renpy & cubism installed. I double checked it's able to actually "find" the wrapper.pyd, it's blowing up inside that module. Possibly because I have Python 3.6 installed on this machine, too? Not sure, going to recompile the plugin and report here if that fixes it.

Windows support

Windows support is missing because Live2D Core does not have precompiled library for MSVC9 that is required for building Python modules for RenPy on Windows.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.