Skip to main content

A non-web Live2D library for Python.

Project description

koe live2d-py


Docker Build Version Python Version CMake C++17 CsmSDK

English README

注意:本项目中使用到的Live2D Core模块,需要自行前往Live2D官网下载。同时,将暂时停止python build库的发布。

使用 Python 直接加载和操作 Live2D 模型,不通过 Web Engine 等间接手段进行渲染。

基于 Python C Extension 对 Live2D Native SDK (C++) 进行了封装。理论上,只要配置好 OpenGL 上下文,可在 Python 中将 live2d 绘制在任何基于 OpenGL 的窗口。

代码使用示例:examples

详细使用文档: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. 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

面捕-期末周破防

基于 live2d-py C 模块及 Qt 开发的 Live2DViewer

Live2DViewer

多模型加载

源码见 main_pygame_three_model.py

three_model

添加背景

源码见 main_pygame_background.py

background

模型变换 & 口型同步音频 & 点击测试

源码见 main_pygame.py

完整用例

模型整体透明度示例

源码见 main_pyqt5_canvas_opacity.py

opacity

鸣谢

特别感谢以下用户为本项目提供的帮助和支持: 96bearli, Ovizro, AnyaCoder, jahtim, Honghe, RobertMeow, LUORANCHENG, TinyKiecoo, Barracuda72, GuangChen2333, makabakadot, thynetruly, mastwet, KyvYang, @Mozilla88, @CooperWang0912, @minghf85

非常感谢以下项目及其贡献者们的帮助:

CubismNativeSamples (live2d.v3)

Cubism2 Web SDK (live2d.v2)

de4jsJavaScript 反混淆工具)

JsConvert (JavascriptPython 工具)

D2Evil (moc 文件分析)

facial-landmarks-for-cubism (面捕参考)

Live2D 模型:

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.6.0.tar.gz (453.3 kB 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.6.0-cp313-cp313-win_amd64.whl (288.8 kB view details)

Uploaded CPython 3.13Windows x86-64

live2d_py-0.6.0-cp313-cp313-win32.whl (261.3 kB view details)

Uploaded CPython 3.13Windows x86

live2d_py-0.6.0-cp313-cp313-macosx_15_0_universal2.whl (349.3 kB view details)

Uploaded CPython 3.13macOS 15.0+ universal2 (ARM64, x86-64)

live2d_py-0.6.0-cp313-cp313-macosx_13_0_universal2.whl (375.4 kB view details)

Uploaded CPython 3.13macOS 13.0+ universal2 (ARM64, x86-64)

live2d_py-0.6.0-cp312-cp312-win_amd64.whl (288.7 kB view details)

Uploaded CPython 3.12Windows x86-64

live2d_py-0.6.0-cp312-cp312-win32.whl (261.5 kB view details)

Uploaded CPython 3.12Windows x86

live2d_py-0.6.0-cp312-cp312-macosx_15_0_universal2.whl (349.2 kB view details)

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

live2d_py-0.6.0-cp312-cp312-macosx_13_0_universal2.whl (374.7 kB view details)

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

live2d_py-0.6.0-cp311-cp311-win_amd64.whl (288.7 kB view details)

Uploaded CPython 3.11Windows x86-64

live2d_py-0.6.0-cp311-cp311-win32.whl (261.5 kB view details)

Uploaded CPython 3.11Windows x86

live2d_py-0.6.0-cp311-cp311-macosx_15_0_universal2.whl (349.2 kB view details)

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

live2d_py-0.6.0-cp311-cp311-macosx_13_0_universal2.whl (374.7 kB view details)

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

live2d_py-0.6.0-cp310-cp310-win_amd64.whl (288.7 kB view details)

Uploaded CPython 3.10Windows x86-64

live2d_py-0.6.0-cp310-cp310-win32.whl (261.5 kB view details)

Uploaded CPython 3.10Windows x86

live2d_py-0.6.0-cp39-cp39-win_amd64.whl (289.1 kB view details)

Uploaded CPython 3.9Windows x86-64

live2d_py-0.6.0-cp39-cp39-win32.whl (261.4 kB view details)

Uploaded CPython 3.9Windows x86

live2d_py-0.6.0-cp38-cp38-win_amd64.whl (289.1 kB view details)

Uploaded CPython 3.8Windows x86-64

live2d_py-0.6.0-cp38-cp38-win32.whl (261.3 kB view details)

Uploaded CPython 3.8Windows x86

File details

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

File metadata

  • Download URL: live2d_py-0.6.0.tar.gz
  • Upload date:
  • Size: 453.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for live2d_py-0.6.0.tar.gz
Algorithm Hash digest
SHA256 2adf1d6228dbc5d24a6b2c53b0e05305d1f070fd29399a75278df84eab35ed4a
MD5 d1f123f7d2dabba42de699b92ef89b22
BLAKE2b-256 ea512dad2a4c0cea0441d743f1f29ed856f0ac29bf4467974ec50569d7f1da4f

See more details on using hashes here.

File details

Details for the file live2d_py-0.6.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: live2d_py-0.6.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 288.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for live2d_py-0.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3a65f07ec881d2e78481df42fc47bfff7cf47c024f6242b283ca4ab464eab412
MD5 abb8f938fe8ca4112191ff91ae68b026
BLAKE2b-256 17f370230cb4b79c10113e9cd94a97b31669c0356f0bbe3429698e0f8685fc53

See more details on using hashes here.

File details

Details for the file live2d_py-0.6.0-cp313-cp313-win32.whl.

File metadata

  • Download URL: live2d_py-0.6.0-cp313-cp313-win32.whl
  • Upload date:
  • Size: 261.3 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.10

File hashes

Hashes for live2d_py-0.6.0-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 008831fc7e32dc54955ae5846e05ece39616592f392acbb5ed7795393fe9f16d
MD5 99d55885fbbbd221c4b7fdeb92e9fde9
BLAKE2b-256 494a147d1918b4420b321b1d2892a9f4fde9358052d6c85c63ea2976cb693e2d

See more details on using hashes here.

File details

Details for the file live2d_py-0.6.0-cp313-cp313-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for live2d_py-0.6.0-cp313-cp313-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 06fa1fa7dbef1138a166bc71a025f6af39e64082987145b4f9763c5d9ee29abb
MD5 86e1c873c0a12c4b7292d56d3eaa5ad1
BLAKE2b-256 8d55a1d474a065b0611d75417540a45994011f40ca13b3ac7711a827f2dd48c2

See more details on using hashes here.

File details

Details for the file live2d_py-0.6.0-cp313-cp313-macosx_13_0_universal2.whl.

File metadata

File hashes

Hashes for live2d_py-0.6.0-cp313-cp313-macosx_13_0_universal2.whl
Algorithm Hash digest
SHA256 6bcdc753eba312a36b67caf47a7d2006b0158bb2f65b5ca7adbaa88e13ed9d83
MD5 213092c63d89bbed2e3bbb238f3978c6
BLAKE2b-256 400f4d8c97216089041f89d4ada7e85bda3bb08495ab65b0fbcdc7af724007bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.6.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 288.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for live2d_py-0.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 680ceafbc14496ca33123490f7c16add64f7fffa7ca14a4e9c81e7c5656e56c1
MD5 0e58ff9c706752b4da36dd0d04d33dd1
BLAKE2b-256 776a759e9078943da5fc7dbdb671bc7bc476ba96aaceb1eb5531cd5ff1bd9d4f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.6.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 261.5 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for live2d_py-0.6.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 0d6f4d84557d74b7bc231e2d04cb921c631d7bf8897b0a8d4777fd6f2f640272
MD5 e468c6cee80c7460b8338d902e224549
BLAKE2b-256 decf1202b9a7defb192de00e0fac150f077dd3ed49dc942e84e7ae9abd137180

See more details on using hashes here.

File details

Details for the file live2d_py-0.6.0-cp312-cp312-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for live2d_py-0.6.0-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 c44efe8d50aa05130733b298e39cd920f5006e738e2df5c41b4dbe2fa4b41e83
MD5 3316d58aef86934c2a901621040d9a9e
BLAKE2b-256 237798fea979fa46e0ae4799b55c3f083cb11504ad8fd19fdf9a461d24ad97c8

See more details on using hashes here.

File details

Details for the file live2d_py-0.6.0-cp312-cp312-macosx_13_0_universal2.whl.

File metadata

File hashes

Hashes for live2d_py-0.6.0-cp312-cp312-macosx_13_0_universal2.whl
Algorithm Hash digest
SHA256 6d7de5b2a3ae0010568f9dfcdd6aef947084f06af9352e9a77c011b121088718
MD5 5623782adacf38bc01e1f875e87bba46
BLAKE2b-256 762b68f8b4ad9eee3b9e2c4997687057c67cee559dc47755be49eba6d49f6504

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.6.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 288.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for live2d_py-0.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e363792e5365d89dea4b74169dd32841ab6bd8f9b80f9b66b0055aca77ee7e4f
MD5 d4eaaccd26edd3fac7811f17cef763b1
BLAKE2b-256 6fe8d59c73afab1c486ddfc68e142a0e8dbb614eae0386d7cb695f9d3d21a9bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.6.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 261.5 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for live2d_py-0.6.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 399024f9fee9dab83c9f6c9977168a8c9176cd589a43504c6856cd2a3ad80f1e
MD5 15a546820b7cab28787d306e9c370afc
BLAKE2b-256 37609c5cb8b2abce7a433da8b16816cdd8a34aa978a8ff03066a5e7e2ce28149

See more details on using hashes here.

File details

Details for the file live2d_py-0.6.0-cp311-cp311-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for live2d_py-0.6.0-cp311-cp311-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 85946fc680ab17c876460de6337f2da6bd1d460a2be2f9059c79c4985329e73a
MD5 9359ae1323b80472546f2600bfe7581b
BLAKE2b-256 8f8edccd9f7b5a0182a7fcd7f37973da51956b8fc28398cb16aa9fe01ac41198

See more details on using hashes here.

File details

Details for the file live2d_py-0.6.0-cp311-cp311-macosx_13_0_universal2.whl.

File metadata

File hashes

Hashes for live2d_py-0.6.0-cp311-cp311-macosx_13_0_universal2.whl
Algorithm Hash digest
SHA256 74df5ccb615f7910b398d3e3fd8a7b53ae37a2366103188cc00adddb71ac9210
MD5 3db7b0f5039cf7514f45872f63905cb0
BLAKE2b-256 7c0987f4cda517bf1d1b90cf26b8b9b05d8597f56fb612b21b6757cc473c812b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.6.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 288.7 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for live2d_py-0.6.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4b107d634d62b04e4622d43668d74abe2e7a615d06726f03eb5de89ef62f4503
MD5 28bb62bf3b19284847e24e8f3eb53f41
BLAKE2b-256 1eca729ea9698ca54e1bcb7b807fdf0ae3841f7b30b464d0d33582ae9745dd1a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.6.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 261.5 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for live2d_py-0.6.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 3c25f01d7e016abb8c6e56efe9912e452322b7fe857a9f64597d49e582e2e649
MD5 4c60702173b33aaafe1a81bf92ad6d2c
BLAKE2b-256 9f55df8c8670ac140fe4f36bc6680934fa1ac35a6b99567a7f0f30c66d8b6580

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.6.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 289.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.0

File hashes

Hashes for live2d_py-0.6.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8c6597a5a429785ac1ff352541e02be2edeb6a786007a61d62fb3a46a2ee4ad0
MD5 e5701bd6c101d3d4f21cc94092d7cb8d
BLAKE2b-256 a82376fdb065634f474a110d286acfc6e4331f45c826a71dd8694dca461ae347

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.6.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 261.4 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.0

File hashes

Hashes for live2d_py-0.6.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 036ae406a7df41a3074c0d4d6d506ed47268f1110fdd83c522984f4939605e5f
MD5 592b229e2aaa054e1d634db4009a6cf2
BLAKE2b-256 9b522426984dd4149e324f4742e572aacc7468cf525222e3f14cbdbc58a308ce

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.6.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 289.1 kB
  • 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.6.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a06b99d2714fe89751cfa435c37fb64e9a438abbf280ed328dcaddbe4f5356a3
MD5 892b04f4179ea0fcd5002d6d480ba917
BLAKE2b-256 aeae779598eeafd53ad57107157c22e05f04188a1f3333a4fc026eedef24519e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: live2d_py-0.6.0-cp38-cp38-win32.whl
  • Upload date:
  • Size: 261.3 kB
  • 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.6.0-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 438929cdc92404abd52a3e4f639fcbfcf0ea3e42d620931f0ae429b4f0c3ccc5
MD5 ddb3abfbeb0151ae1a32a769bed12928
BLAKE2b-256 cfe639016d1d4e484bb617e27ebe6864056077098c4608c61504720fd43605a5

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