Live2D Python SDK
Project description
live2d-py
使用 Python 直接加载和操作 Live2D 模型,不通过 Web Engine 等间接手段进行渲染。
基于 Python C++ API 对 Live2D Native SDK (C++) 进行了封装。理论上,只要配置好 OpenGL 上下文,可在 Python 中将 live2d 绘制在任何基于 OpenGL 的窗口。
代码使用示例:package
详细使用文档:https://arkueid.github.io/live2d-py-docs/
兼容UI库
理论上兼容所有能使用 OpenGL 进行绘制的UI库: Pygame / PyQt5 / PySide2 / PySide6 / GLFW / FreeGlut / Qfluentwidgets ...
支持功能
- 加载模型:Cubism 2.1 和 Cubism 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++ API 封装 | 支持 32 / 64 位,支持Python 3.0 及以上版本 |
Windows、Linux |
注:
live2d.v2由 Cubism Web SDK 转写为纯 Python,尚未使用 numpy 等优化的库,性能有待提升。- Cubism 2.X 导出的模型:文件名格式常为
XXX.moc,XXX.model.json,XXX.mtn - Cubism 3.0 及以上导出的模型:文件名格式常为
XXX.moc3,XXX.model3.json,XXX.motion3.json
安装方式
- 通过 PyPI 安装
pip install live2d-py
- 在 Release 中下载对应版本的
whl文件并安装(推荐)
pip install live2d_py-0.X.X-cpXXX-cpXXX-win32.whl
从源码构建,参考 安装#源码构建
简易面部动捕示例
源码见 main_facial_bind_mediapipe.py
基于 live2d-py + qfluentwidgets 实现的桌面应用预览
贡献
特别感谢 @96bearli,@Ovizro, @AnyaCoder, @jahtim 为本项目提供的帮助和支持。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file live2d_py-0.3.0.tar.gz.
File metadata
- Download URL: live2d_py-0.3.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8281eef5c32dc45421ad89de59b9ff8745add4083ac2be024eae6edd6ac03579
|
|
| MD5 |
65d7db3544bc302db1c34dfa582c9ad2
|
|
| BLAKE2b-256 |
5be13c08fc014cdf73f8f4e9c994cdb543dc15850b1674d0de57c347adabdc5c
|
File details
Details for the file live2d_py-0.3.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: live2d_py-0.3.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 1.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62f4cfb28de623ec8b9c5518dddd638013e02152f760dbf79f629bd3be8e4392
|
|
| MD5 |
0b2d04f4347bb3915812d50632edbeac
|
|
| BLAKE2b-256 |
5a67c37d5032220900215b1fde08ae54067a278fdc267a894de61f164aabdf7d
|
File details
Details for the file live2d_py-0.3.0-cp312-cp312-win32.whl.
File metadata
- Download URL: live2d_py-0.3.0-cp312-cp312-win32.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22dfbcf191e317fe11410ae456e3bd1a7d27dfdde7f3f032520d681adebe2ba2
|
|
| MD5 |
d3dd938bbaa04f16681f2a4740ddffbc
|
|
| BLAKE2b-256 |
9e72c886863d53683c73a896fc1bba1d19643dbde08e4bc56869be1df8805cfb
|
File details
Details for the file live2d_py-0.3.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: live2d_py-0.3.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 1.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c25e816021698bedf7946101a1a6024096a3f81a2236906eda59b272d38f682
|
|
| MD5 |
3690e504acb0477c70f1e24bcaa7fb79
|
|
| BLAKE2b-256 |
0db9bebb47ec9c37e061ffe32e08cfe9b6579c5b1b0a140696f81da22db761d6
|
File details
Details for the file live2d_py-0.3.0-cp311-cp311-win32.whl.
File metadata
- Download URL: live2d_py-0.3.0-cp311-cp311-win32.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63f27781fca8e53428b6b1cfb3f3b7de1c8fd75c259f4a454bc5b98880690034
|
|
| MD5 |
6c8a97d34b4497fdad989737fdf2d4e5
|
|
| BLAKE2b-256 |
0ff6866eab4c9d60fcea361643376aaf71a38ac115c0a520e5d4433036875f30
|
File details
Details for the file live2d_py-0.3.0-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: live2d_py-0.3.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 1.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0483614480cf8d0169f0f27792213e7e3aafe51f265873f769888e737da76d91
|
|
| MD5 |
88f385386bf9d4c0d483f827bd01d7b6
|
|
| BLAKE2b-256 |
597493b3214b37ddfbb2784b8ade634e8bd9451f30670874a9dc22b458e8e0e4
|
File details
Details for the file live2d_py-0.3.0-cp310-cp310-win32.whl.
File metadata
- Download URL: live2d_py-0.3.0-cp310-cp310-win32.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1ee05a20cce1b5625372eccb36f95191291dfa69134497e56e136275890822b
|
|
| MD5 |
224e267cc19dc9d3029173579a4fc306
|
|
| BLAKE2b-256 |
ace52431673cf697971da5af3452fb5ab81e48a7f8f1bdb60cf62ff492bf46ae
|
File details
Details for the file live2d_py-0.3.0-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: live2d_py-0.3.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 1.7 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d67f5a1bd4cd39c3053cb4bb7719d81e5df62bf6e5cad703713770604fb1422f
|
|
| MD5 |
0a7f95a68e8e55b17c967d772e42eead
|
|
| BLAKE2b-256 |
4ec737b04082e1113f8eb5f247ac9fec99d6411af0a9e54cbab1f2b8694f028d
|