Skip to main content

A non-web Live2D library for Python.

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

详细使用文档:Wiki

兼容UI库

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

支持功能

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

平台支持

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.0 及以上版本 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. 通过 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

面捕-期末周破防

贡献

特别感谢 @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 Distribution

live2d_py-0.3.1.tar.gz (24.5 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.3.1-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11Windows x86

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10Windows x86

File details

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

File metadata

  • Download URL: live2d_py-0.3.1.tar.gz
  • Upload date:
  • Size: 24.5 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.3.1.tar.gz
Algorithm Hash digest
SHA256 09203cbb4a444ecebede7a964e2bf39b10641b99f10da33b27926e41101dfa59
MD5 bb84f8e116ef1d15f5c7e61cd79be71a
BLAKE2b-256 68e83b67a49d0d160febee67bf2231241a71a779d93f91b227e4614602c2f045

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.1-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.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7f89c7f9a774b62feae5b45c32669a92fa0e42194158f86017176a3b3c31eb89
MD5 5ab2c7c1481b27951bc901486393d7b4
BLAKE2b-256 d14e80f0d51b2ec6c627c5b4a262b300c6f6074d28af3814ba215b954783b3ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.1-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.1-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 2d3e2bd118e4c85418f24a48453a144e538454bb223c74fc9266bb4982685a99
MD5 003fbd5a0cedf3747844b4575d6e1ef9
BLAKE2b-256 5a0b5424eb656c973092144450588c2429fbf645aedb141fa67e86e247093217

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.1-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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 768217d2f1f20927f5f8410e7838e6fb9d60af61def18ff8d2b6f0ed6c5a5869
MD5 0e9e61a07e0cd3ba6a0a39abc0fbca80
BLAKE2b-256 c37c0f11d38a090e0ff3ba478a7aa5506cc16c8f0283f5d8cac1a67ba78da4ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.1-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.1-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 632edf33b6bc73580efd6b1f38153ceaab9e10727933b7dec9af231099da9160
MD5 adf35b48dd8b5caf265859d4780aeff8
BLAKE2b-256 0ac3a3490cf9f7aab47beba53f6cf36f18f55106dca3a98e4612a69e91523800

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.1-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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 025c2135fdb97587981955ffaa15896ffa44b9cbd60b7a8446c1254d67535d80
MD5 e7ecbc8218c4b7303006a6a5120fbfd2
BLAKE2b-256 75d280cb99dd8da1bc7decf1321c68c01bea8a2c3c8ea2c7efd04dfb70150460

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.3.1-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.1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 ff58bf6452e6883e0d348b11bc09b1f8a535355551beffe2d286984b9442e7fe
MD5 dd4960f535df937c50a1cb42fe9382fe
BLAKE2b-256 f1a956f8c48d8954515c352442ba26fe02351e397bf8545b97b9cd59afbd2f82

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