Skip to main content

Live2D Python SDK

Project description

live2d-py

Docker Build Version Python Version CMake C++17

使用 Python 直接加载和操作 Live2D 模型,不通过 Web Engine 等间接手段进行渲染。

基于 Python C++ API 对 Live2D Native SDK (C++) 进行了封装。理论上,只要配置好 OpenGL 上下文,可在 Python 中将 live2d 绘制在任何基于 OpenGL 的窗口。

代码使用示例:package

详细使用文档:https://arkueid.github.io/live2d-py-docs/

加载 Cubism 2.1 及以下版本的 Live2D 模型使用 v2 分支

兼容UI库

理论上兼容所有能使用 OpenGL 进行绘制的UI库: Pygame / PyQt5 / PySide2 / PySide6 / GLFW / FreeGlut / Qfluentwidgets ...

支持功能

  • 加载模型
  • 视线跟踪
  • 点击交互
  • 动作播放回调
  • 口型同步
  • 模型各部分参数控制
  • 各部件透明度控制

平台支持

live2d-py 支持的live2d模型 支持的Python版本 支持平台
live2d.v2 Cubism 2.1 以及更早的版本 仅 32 位,支持Python 3.0 及以上版本,但除 Python 3.10.11 外需要自行编译 Windows
live2d.v3 Cubism 3.0 及以上版本 支持 32 / 64 位,支持Python 3.0 及以上版本,但除 Python 3.12 外需要自行编译 Windows、Linux

注:

  • Cubism 2.X 导出的模型:文件名格式常为 XXX.mocXXX.model.jsonXXX.mtn
  • Cubism 3.0 及以上导出的模型:文件名格式常为 XXX.moc3XXX.model3.json, XXX.motion3.json
  • 对于 Cubism 2.0 模型,网络上能找到的现存 live2d opengl 静态库只有 32 位,因此只能使用 32 位 Python 解释器加载。

安装方式

  1. 通过 PyPI 安装
pip install live2d-py
  1. Release 中下载对应版本的 whl 文件并安装(推荐)
pip install live2d_py-0.X.X-cpXXX-cpXXX-win32.whl
  1. 从源码构建,参考 安装#源码构建

简易面部动捕示例

源码见 main_facial_bind_mediapipe.py

面捕-期末周破防

基于 live2d-py + qfluentwidgets 实现的桌面应用预览

live2d-desktop

alt

贡献

特别感谢 @96bearli@Ovizro, @AnyaCoder 为本项目提供的帮助和支持。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

live2d_py-0.2.5.tar.gz (24.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

live2d_py-0.2.5-cp312-cp312-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86-64

live2d_py-0.2.5-cp312-cp312-win32.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86

live2d_py-0.2.5-cp311-cp311-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.11Windows x86-64

live2d_py-0.2.5-cp311-cp311-win32.whl (1.8 MB view details)

Uploaded CPython 3.11Windows x86

live2d_py-0.2.5-cp310-cp310-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.10Windows x86-64

live2d_py-0.2.5-cp310-cp310-win32.whl (1.8 MB view details)

Uploaded CPython 3.10Windows x86

File details

Details for the file live2d_py-0.2.5.tar.gz.

File metadata

  • Download URL: live2d_py-0.2.5.tar.gz
  • Upload date:
  • Size: 24.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for live2d_py-0.2.5.tar.gz
Algorithm Hash digest
SHA256 fdc9bb8b3e559050861c8cf259b69166c9519f3188a5359967691770cbcdbf3e
MD5 d8498c01878f4966885a775c34650ccd
BLAKE2b-256 d93b67294f402d7f61a4de6bf6461a87729a092038b99c15469473c3427f1e97

See more details on using hashes here.

File details

Details for the file live2d_py-0.2.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: live2d_py-0.2.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for live2d_py-0.2.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 49d76dd950e20d2c44d010c4af063a18f2a4515c55505bb1e430ba567e804fd0
MD5 ce637b3aa092ac1c1eb30c827b3c79b6
BLAKE2b-256 689a4e68ea609501f7f7b5fd240afb9ecfd4b5fd270df5130fe4fb9a078a4947

See more details on using hashes here.

File details

Details for the file live2d_py-0.2.5-cp312-cp312-win32.whl.

File metadata

  • Download URL: live2d_py-0.2.5-cp312-cp312-win32.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for live2d_py-0.2.5-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 61492debf4c501d3bb53389b469ebea6a717737a0cdbd0a62719c4b4c3ebe56b
MD5 5ce9217dac78ea19c96948d6bc1950ca
BLAKE2b-256 e155a96e0408d6d6c1150b1af756212c6c4cdc7cd5d5eeff2bf439d52d868afb

See more details on using hashes here.

File details

Details for the file live2d_py-0.2.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: live2d_py-0.2.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.0

File hashes

Hashes for live2d_py-0.2.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 02314d3fc47780377f4a42197458e0e17b84d046c9c71834d15b8f3b4bb226ed
MD5 c0b2834adc2f38d64b4118252fd7df9d
BLAKE2b-256 a66be7f6eb5ad0db3b1765864d1280119b7bcad278871ecb7177cede46ebbb31

See more details on using hashes here.

File details

Details for the file live2d_py-0.2.5-cp311-cp311-win32.whl.

File metadata

  • Download URL: live2d_py-0.2.5-cp311-cp311-win32.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.0

File hashes

Hashes for live2d_py-0.2.5-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 951c37efb13eec8ecf910b0202475d5aeee04b135fd5c65046c4605316165d9f
MD5 0e0980a507306f63ce63292a505aac1f
BLAKE2b-256 ba7da58664d8e6f67ec5735c14c741a64e493aafb9bfdf12dafcc910296be988

See more details on using hashes here.

File details

Details for the file live2d_py-0.2.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: live2d_py-0.2.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for live2d_py-0.2.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3132b5a1166e4bc4c82f0e4f591dd1f2ca388975c49b1ac198da175153a72f47
MD5 3d5fe5d6ae8dc6a21f7a7d338d98f7af
BLAKE2b-256 b5473c9bc2063cda5fe12a3ae05952799c40dbb1f03d780baba893ba2cacb569

See more details on using hashes here.

File details

Details for the file live2d_py-0.2.5-cp310-cp310-win32.whl.

File metadata

  • Download URL: live2d_py-0.2.5-cp310-cp310-win32.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for live2d_py-0.2.5-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 b2cd5cc5d720ee08b00eab0feb66a658ef1599ec281efae7faf2aa9349d9ac70
MD5 669db54ada59a45cd9954a34e85d5ad5
BLAKE2b-256 a8472594db8f7dd1cb632cb3bb9ccc15384e0db526c213c1d29b19a81749f3be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page