Skip to main content

Live2D Python SDK

Project description

koe 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

详细使用文档:Wiki

修改和开发的一点提示:CONTRIBUTING

兼容UI库

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

支持功能

  • 加载模型:Cubism 2.1Cubism 3.0 及以上版本
  • 视线跟踪
  • 点击交互
  • 动作播放回调
  • 口型同步
  • 模型各部分参数控制
  • 各部件透明度控制
  • 精确到部件的点击检测

兼容性

Python 版本

Python 版本支持:从 live2d-py 0.3.2 开始使用 Python C Limited API,理论上兼容 Python 3.2 以上的所有版本。

Cubism Live2D 版本

live2d-py 支持的live2d模型 实现 支持的Python版本 支持平台
live2d.v2 Cubism 2.1 以及更早的版本 纯 Python 实现 支持 32 / 64 位,支持Python 3.0 及以上版本 Winodws、Linux、MacOS(理论上)
live2d.v3 Cubism 3.0 及以上版本 Python C Extension 封装 支持 32 / 64 位,支持Python 3.2 及以上版本 Windows、Linux

注:

  • live2d.v2 由 Cubism Web SDK 转写为纯 Python,尚未使用 numpy 等优化的库,性能有待提升。
  • Cubism 2.X 导出的模型:文件名格式常为 XXX.mocXXX.model.jsonXXX.mtn
  • Cubism 3.0 及以上导出的模型:文件名格式常为 XXX.moc3XXX.model3.json, XXX.motion3.json

使用说明

  1. 将仓库中的 package/live2d 直接作为 Python 模块集成到你的项目中即可。

  2. Release 中下载对应版本的 whl 文件并安装(推荐)

pip install live2d_py-0.X.X-cpXXX-cpXXX-win32.whl
  1. 通过 PyPI 安装
pip install live2d-py
  1. 从源码构建,参考 安装#源码构建

简易面部动捕示例

源码见 main_facial_bind_mediapipe.py

面捕-期末周破防

贡献

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

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

live2d_py-0.3.3-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

live2d_py-0.3.3-cp312-cp312-win32.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86

live2d_py-0.3.3-cp311-cp311-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.11Windows x86-64

live2d_py-0.3.3-cp311-cp311-win32.whl (1.6 MB view details)

Uploaded CPython 3.11Windows x86

live2d_py-0.3.3-cp310-cp310-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.10Windows x86-64

live2d_py-0.3.3-cp310-cp310-win32.whl (1.6 MB view details)

Uploaded CPython 3.10Windows x86

live2d_py-0.3.3-cp39-cp39-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.9Windows x86-64

live2d_py-0.3.3-cp39-cp39-win32.whl (1.6 MB view details)

Uploaded CPython 3.9Windows x86

live2d_py-0.3.3-cp38-cp38-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.8Windows x86-64

live2d_py-0.3.3-cp38-cp38-win32.whl (1.6 MB view details)

Uploaded CPython 3.8Windows x86

File details

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

File metadata

  • Download URL: live2d_py-0.3.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.6 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.3.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 258b912a2a920305a24c3ed9a5ae9002521ec5bfe7549b400b95b225a5e5708e
MD5 17c66ca099d7cf27b4b24ffe53e4de2d
BLAKE2b-256 363bb3d6f46a25eea174e7fa65c7a019036a48747c58cb2b539ae1658ab180cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.3-cp312-cp312-win32.whl
  • Upload date:
  • Size: 1.6 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.3.3-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 096983ee69157a7a1638f4032c3be3379b924cc410dfc2e2b45e495680b90bd1
MD5 30aa25a2e517dc5e608eb7bb5b478e98
BLAKE2b-256 3ca76893faa933e871f82a2d1e78507c12672bfc005ec8b084146e42360f709c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.6 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.3.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2f9875c6a02edb08ed9b4536a431084eadbd81e643a95bfda24f3df87df43149
MD5 11a9dae2ca755ddadc793a693b6fca3b
BLAKE2b-256 fd95606d4e45634e900fb892aef0abfe0b46028f53224d41d431a83c7537018e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.3-cp311-cp311-win32.whl
  • Upload date:
  • Size: 1.6 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.3.3-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 a8c6e20a82133b79772ddc682c57d009d265e4825f3b53057675b95fa934abf6
MD5 f246fd0783e985c74e348e06525360d8
BLAKE2b-256 77fc6c35cc1409a06ac46465a981daeafe4c70d7bc12086e254197a8ef64ed6a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.6 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.3.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f466a67957bf497d1f851f5c04ee0da90b4660507e7d4f1eabf8d144b4ba699a
MD5 4701001946eb00cafafdae1ba8d35438
BLAKE2b-256 10da96407b4a9c747f64be6c46c044ed857374952bc3aadd212fd6c70bb1fec4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.3-cp310-cp310-win32.whl
  • Upload date:
  • Size: 1.6 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.3.3-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 1ed2b9efd60f52c20b35857cabbb1a4df18c7f7cdd50f42d4b0bf9b973df5a84
MD5 2e31d85e45251dfc4fca948c8b1c291e
BLAKE2b-256 bca5a3f4513a5b5a78435f352a3b6a4ef3b453a5708d04b6b66b40a5e7f5c07b

See more details on using hashes here.

File details

Details for the file live2d_py-0.3.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: live2d_py-0.3.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.0

File hashes

Hashes for live2d_py-0.3.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9d29e187ff4bac7819d8a239013f9aaafd550fe02375879a94826b02086907ea
MD5 36b92b88e2426efe23e195fc212f3dbc
BLAKE2b-256 fe320b061d1423601447d1a0c68d67614b27825d30669cbc3336960ff82c06dd

See more details on using hashes here.

File details

Details for the file live2d_py-0.3.3-cp39-cp39-win32.whl.

File metadata

  • Download URL: live2d_py-0.3.3-cp39-cp39-win32.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.0

File hashes

Hashes for live2d_py-0.3.3-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 a742d4f17f6c3cf6744893caa561c0cfc20adab6c884eda8ad01e47ac2e9bf02
MD5 551d8580e2f5a300538f6c5dc625061c
BLAKE2b-256 b0373f075e4668b5c1ac092455a56cc68a088222ce413107364c52ada2004bd6

See more details on using hashes here.

File details

Details for the file live2d_py-0.3.3-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: live2d_py-0.3.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.0

File hashes

Hashes for live2d_py-0.3.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 db11872be46611c14186280477e421d3072a6e581c81897e19dce197a9e654f1
MD5 65e869132ecbbf985ef4a1dd56029a5d
BLAKE2b-256 a9cc2bc5785165ec03f488e68cefd0d802b77407d671766204d62e9ae7555aca

See more details on using hashes here.

File details

Details for the file live2d_py-0.3.3-cp38-cp38-win32.whl.

File metadata

  • Download URL: live2d_py-0.3.3-cp38-cp38-win32.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.0

File hashes

Hashes for live2d_py-0.3.3-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 108e063fa296884cec87d43a8e9a82fc9e83e80379b9402e31ea0cae556e2b5a
MD5 6edd36abcf9ed0e12f201818beccc2c4
BLAKE2b-256 eb08f37adb4cbd42183083ebcb33ea5d2c8f4d24b67344fd909efa1fce36c761

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