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.6-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

live2d_py-0.3.6-cp312-cp312-macosx_10_9_universal2.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 10.9+ universal2 (ARM64, x86-64)

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11Windows x86

live2d_py-0.3.6-cp311-cp311-macosx_10_9_universal2.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10Windows x86

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9Windows x86

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8Windows x86

File details

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

File metadata

  • Download URL: live2d_py-0.3.6-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.1.0 CPython/3.12.0

File hashes

Hashes for live2d_py-0.3.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 09b70f972d886f7368f5e185a93ea561fad262f146b8963d304a618ba2078780
MD5 859fa1a786ed9351d1c0178a8c0b6f44
BLAKE2b-256 8e7a9fc03688ead0cfe5bd136a9e8c76c1657eb238e187240c3d8b7c1f45152f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.6-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.1.0 CPython/3.12.0

File hashes

Hashes for live2d_py-0.3.6-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 c0cddb75ce783ce0e930d8078b01b4d9fe7616d43834859d7fb4d46fe4f1796a
MD5 3cb99f6de25efef31ddad6f235506a35
BLAKE2b-256 4024ceaa410ad188197f736f28515d5fbf1f52f01650cb324736ca54479c8656

See more details on using hashes here.

File details

Details for the file live2d_py-0.3.6-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for live2d_py-0.3.6-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 152bb98bb2028df945b031901aa387aa4b4773fef64141f4c9fdad4b2833ee69
MD5 ba5be992e99ef6589836ca478cef500b
BLAKE2b-256 9e5ac98abdc691c37f1bc2319f6a64bda2beaf1648f1bf8d0381a2ff644a0b85

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.6-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.1.0 CPython/3.11.0

File hashes

Hashes for live2d_py-0.3.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 acd38c0752cb4fb166626a504ee2994d9e71d8153dd8ad3eaa6a36b04ce0874b
MD5 9cda2605a12dec23c6f18fa3992a1584
BLAKE2b-256 afeb89c135fb4be3e905c6e7801c86844dea0461f63e533870c4ebefa9e21b1b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.6-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.1.0 CPython/3.11.0

File hashes

Hashes for live2d_py-0.3.6-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 eb25e4e4cb99df5616df02fc74c1d864bdd51ec3f8aa022e2e0990ed6dbf94bf
MD5 20bfb5fbae14e4a1c9564719f012c8cf
BLAKE2b-256 d3eea7bfcb2661a6f2a14c033bc1163126bcb962f0b5eb0635bc84d3c9005223

See more details on using hashes here.

File details

Details for the file live2d_py-0.3.6-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for live2d_py-0.3.6-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 80259899a14397d13c09219871c03cb706b132051b5f23c9b552f80f176e0591
MD5 4a51e6be21c4e43b8967c24c9ac7d70b
BLAKE2b-256 fb911a844b4fa838ba5c109889477c7cb6412353b8f5c6f0019908a0ca6b5d60

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.6-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.1.0 CPython/3.10.0

File hashes

Hashes for live2d_py-0.3.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8f31e54d89679e356db9b8a22ec892f17a9a911641f96123751e238a87cb4a5d
MD5 3d61488615afe88c2597b051b3426907
BLAKE2b-256 d38c6e5f9c56fcdc6e00025828c4d9f41b9b736c853c9f60fc08ca1d8a8699f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.6-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.1.0 CPython/3.10.0

File hashes

Hashes for live2d_py-0.3.6-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 2556ed9cc7e9629d5608408644009eaa1e76cff27baf4078e0af11f23d6424bb
MD5 b7bcfd69a966e017263d25b32410f24b
BLAKE2b-256 16555597cfe1176acabd33a754579b7f2a9e08823d7b51a781278b7c6e5373e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.6-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.1.0 CPython/3.9.0

File hashes

Hashes for live2d_py-0.3.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 4cf80c51d0856a5f9fafb95842061a7042b9c91a6e718ca1a93dc47f2f9cc374
MD5 3fb0b7ae4dcc7ce2fe809c70273c21aa
BLAKE2b-256 f5041bfc7ffc37a7d5653fed4bbd48d8b4c26fead7fbdc93c2a5289dca9c2d73

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.6-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.1.0 CPython/3.9.0

File hashes

Hashes for live2d_py-0.3.6-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 364b16413a549cb86edb66ed24bf017dbd6f73620b1cd03bf45237857d1dff22
MD5 4df00a6bbf5750bc13ab6af5de9f8660
BLAKE2b-256 de3919308ed8d04134a85bff0891d6226026b8f2c91fd34d28df720bbfa81778

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.6-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.1.0 CPython/3.8.0

File hashes

Hashes for live2d_py-0.3.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b390078222a0ba4355eec425dbbee31e7941b345ab5740eadc3257873a574ad9
MD5 2cec075499b12fd40869722a2986caa1
BLAKE2b-256 0d354dfae6dc94bd9667e0b5fa6ae2ab618ace00cb54f848033db19708e099ce

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.6-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.1.0 CPython/3.8.0

File hashes

Hashes for live2d_py-0.3.6-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 6a8c17aa4c7c2a41d906262fb96ba7ff5d8604095d3df0c7bded5932a55d154a
MD5 65ad53b51755d612806b945584d0ea0e
BLAKE2b-256 bb8df8192061a1ac9aa070d8014d24c2b1cab443f83912f0de1d39b7d461d759

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