Skip to main content

A non-web Live2D library for Python.

Project description

koe live2d-py


Docker Build Version Python Version CMake C++17
English README

使用 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模型 实现
live2d.v2 Cubism 2.1 以及更早的版本 纯 Python 实现
live2d.v3 Cubism 3.0 及以上版本 Python C Extension 封装

Python 版本及平台

:white_check_mark:: 可用, 支持, 已通过

:question:: 尚未测试

:construction:, :x:: 编译期问题或平台兼容性问题待解决

Platform Python Version live2d.v2 live2d.v3 构建状态 PyPI
MacOS arm64 >3.0, <=3.10 :white_check_mark: :question: :construction: :x:
MacOS arm64 >=3.11 :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Windows x86/x64 >3.0, <3.8 :white_check_mark: :question: :construction: :x:
Windows x86/x64 >=3.8 :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Ubuntu 20.04/Arch, x64 >3.0, <3.8 :white_check_mark: :question: :construction: :x:
Ubuntu 20.04/Arch, x64 >=3.8 :white_check_mark: :white_check_mark: :white_check_mark: :x:

注:

  • 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, @Honghe, @RobertMeow 为本项目提供的帮助和支持。

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

live2d_py-0.4.0-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.4.0-cp311-cp311-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11Windows x86

live2d_py-0.4.0-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.4.0-cp310-cp310-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10Windows x86

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9Windows x86

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8Windows x86

File details

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

File metadata

  • Download URL: live2d_py-0.4.0-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.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fed8d1c67ba252b1efc25f76c3ad4588071d2c70c9831cbd4a657e0aa1968617
MD5 fa036d5f32fe1c4a414d1c2be55cd7ee
BLAKE2b-256 336a7b050c402bdb76309dcf653e998c5f80d2d1093ff3283e400f4c66ae9bb1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.4.0-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.4.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 08b2840d97a1b5c9759542e9643b5a5cfc7c311c33851e6cb1dc322fec928a7c
MD5 9a0d5a4120a7353d56d55998e43aad28
BLAKE2b-256 6850c188e367a3e22ca30dbe435b1c46a4b716364a8e6a51e7f23ec2a5acb0a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for live2d_py-0.4.0-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 83e084b1376784e974fdbecacda3f5aa05f7fda823a021a3074a69de18433ccc
MD5 ee81b9a2b339b816f8cd1140c6d049ac
BLAKE2b-256 5313c982f17e5f340377242174e3b57a06bf51b2c52ba1fa13bde71a551ea0b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.4.0-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.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b5b1a1b4663b327e473b3769e1f2586db0315b4193ae6d49edabdbf3a7213a7d
MD5 1c2de16a719d592f44155fcdc45952cf
BLAKE2b-256 824f729f8fa780487f2616cdfcc9a0d6c6ae7e7c376a70bb7e50eadd3ecd55a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.4.0-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.4.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 ba3fe42d45ee0098c5f8ba4ab33f8624519c765adeadde8fe249248a9534a675
MD5 20fcb31c551652634ae7fa5cc664e9cf
BLAKE2b-256 656d0e403cecba358df99eeff5093ece3173409a0a8b54cbdc6c22d7a79c556e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for live2d_py-0.4.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 c2db442c24d89e351bd1e0861c6fe0d0f7ddf113ef34e09b1f48f57b719b6ac2
MD5 4eb30427df0f05a801eebb29f38ab15a
BLAKE2b-256 ff2d2e04d340015af92c67318af244efc05d87f5b0aa7aea757aaaea260a297c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.4.0-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.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3cb8599ce37bd5b683fb54bb82a541a8df40b8147b235696d3cdd6c3bac8b6bc
MD5 d59fd67584dca787558260aec4463ff6
BLAKE2b-256 95a99d7c7d82c7dc8162dc349b10f3bfc4e9cd713630d6d7c1fd5b3b7860ae36

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.4.0-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.4.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 2230ea13fadc2de01e7f19a14db3d8fea11f8d48e332616f02c632adc2942798
MD5 a1a2596d6a361c79f55f712bcf9573d5
BLAKE2b-256 f241659445961ef105749b20105317d1c0c30d3b3b13d4fd0dee4febc9d1f086

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.4.0-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.4.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d41024c3ec16dbb48be5c3332cbbe1c9be7e6e2d8a42e2e61a3999f5b7acdc12
MD5 2e8e922a44d1c7ad7baafbf4372c0716
BLAKE2b-256 8a830db9632c8e3385961945793448fa8f3d5172436db3e0e74fa62ef11e5e12

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.4.0-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.4.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 ea8cb86fa012179f2b51cba8aebd9c0994e5226dff68dd1059030a2be1d6c96c
MD5 b3866e9f65bc81acef642f71a56e6820
BLAKE2b-256 cdb1d2e5a7350460bf82d740464a5e22fd67b3aad15c0ea6207c23bc433846f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.4.0-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.4.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 05fc7770f156a96d84ce646281e5f138f86fd5b4793245e8aca6095b75dd414f
MD5 134faba4564636041584a8de09be0aac
BLAKE2b-256 d3b00b85be62ae9751dafaf0d9f3c8013d6061bb4d5ab32a1bfbaf81373c5f69

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.4.0-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.4.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 88a61a70be94285496b3fcb3bc8d06c312b928592de40a72540a7420aa1d45bf
MD5 b9e23b850251993e7e91b963332203ba
BLAKE2b-256 f55c9c638052a9527fc46fb2e5ecdd04fb46e115a993dab8502e790657a3e107

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