Skip to content

Commit 3c92f00

Browse files
committed
v0.2.3
1 parent 1865254 commit 3c92f00

File tree

11 files changed

+38
-24
lines changed

11 files changed

+38
-24
lines changed

Diff for: .github/workflows/publish-to-pypi.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
python-version: ['3.10', '3.11', '3.12']
20+
python-version: ['3.10.0', '3.11.0', '3.12.0']
2121
architecture: ['x86', 'x64']
2222

2323
steps:
@@ -33,7 +33,7 @@ jobs:
3333
run: python -m pip install build
3434

3535
- name: Build a source tarball
36-
if: ${{ matrix.python-version == '3.10' && matrix.architecture == 'x86' }}
36+
if: ${{ matrix.python-version == '3.10.0' && matrix.architecture == 'x86' }}
3737
run: python -m build --sdist . --outdir dist/
3838

3939
- name: Build a binary wheel
@@ -65,7 +65,7 @@ jobs:
6565
6666
- name: Upload Source Distribution to Release
6767
uses: softprops/action-gh-release@v2
68-
if: ${{ matrix.python-version == '3.10' && matrix.architecture == 'x86' }}
68+
if: ${{ matrix.python-version == '3.10.0' && matrix.architecture == 'x86' }}
6969
with:
7070
# tag_name: v0.2.2-alpha
7171
files: |

Diff for: LAppModelWrapper.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#include <GL/glew.h>
2+
#ifdef WIN32
3+
#include <GL/wglew.h>
4+
#endif // WIN32
5+
16
#include <LAppModel.hpp>
27
#include <CubismFramework.hpp>
38
#include <LAppPal.hpp>
@@ -682,8 +687,7 @@ static PyMethodDef live2d_methods[] = {
682687
{"clearBuffer", (PyCFunction)live2d_clear_buffer, METH_VARARGS, ""},
683688
{"setLogEnable", (PyCFunction)live2d_set_log_enable, METH_VARARGS, ""},
684689
{"logEnable", (PyCFunction)live2d_log_enable, METH_VARARGS, ""},
685-
{NULL, NULL, 0, NULL} // 哨兵
686-
};
690+
{NULL, NULL, 0, NULL}};
687691

688692
// 定义live2d模块
689693
static struct PyModuleDef liv2d_module = {
@@ -729,7 +733,7 @@ PyMODINIT_FUNC PyInit_live2d(void)
729733

730734
#ifdef WIN32
731735
// 强制utf-8
732-
SetConsoleOutputCP(65001);
736+
// SetConsoleOutputCP(65001);
733737
#endif
734738

735739
return m;

Diff for: Main/live2d/LAppModel.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -537,13 +537,13 @@ void LAppModel::DoDraw()
537537

538538
void LAppModel::Draw(CubismMatrix44 &matrix)
539539
{
540-
_model->Update();
541-
542540
if (_model == NULL)
543541
{
544542
return;
545543
}
546544

545+
_model->Update();
546+
547547
matrix.MultiplyByMatrix(_modelMatrix);
548548

549549
GetRenderer<Rendering::CubismRenderer_OpenGLES2>()->SetMvpMatrix(&matrix);

Diff for: Main/live2d/Log.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void _LOG(const int level, const char *fmt, ...)
5252
{
5353
format = LOG_INFO_CONSOLE_FORMAT;
5454
}
55-
else if (level == LogLevel::ERROR)
55+
else if (level == LogLevel::_ERROR)
5656
{
5757
format = LOG_ERROR_CONSOLE_FORMAT;
5858
}

Diff for: Main/live2d/Log.hpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ enum LogLevel
44
{
55
INFO,
66
DEBUG,
7-
ERROR
7+
_ERROR
88
};
99

1010

11-
void setLogEnable(bool on);
1211
void _LOG(const int format, const char *fmt, ...);
1312

1413
#define Debug(fmt, ...) _LOG(LogLevel::DEBUG, fmt, ##__VA_ARGS__)
1514
#define Info(fmt, ...) _LOG(LogLevel::INFO, fmt, ##__VA_ARGS__)
16-
#define Error(fmt, ...) _LOG(LogLevel::ERROR, fmt, ##__VA_ARGS__)
15+
#define Error(fmt, ...) _LOG(LogLevel::_ERROR, fmt, ##__VA_ARGS__)

Diff for: README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,10 @@ pip install live2d_py-0.2.2-cp310-cp310-win32.whl
7272

7373
[live2d-desktop](https://github.com/Arkueid/Live2DMascot)
7474

75-
![alt](./docs/2.png)
75+
![alt](./docs/2.png)
76+
77+
## 贡献
78+
79+
感谢 [@96bearli] 为本项目提供的帮助和支持。
80+
81+
[@96bearli]: https://github.com/96bearli

Diff for: package/live2d/utils/log.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ def Error(*args, **kwargs):
3535
print(
3636
time.strftime(f"{RED}[ERROR %Y-%m-%d %H:%M:%S]", time.localtime(time.time())),
3737
*args,
38-
RESET
38+
RESET,
3939
**kwargs
4040
)

Diff for: package/live2d/v3/live2d.pyd

1.5 KB
Binary file not shown.

Diff for: package/main_glfw.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ def init_window(width, height, title):
1616
glfw.terminate()
1717
return None
1818

19-
glfw.make_context_current(window)
2019
return window
2120

2221

2322
# 渲染循环
2423
def main():
25-
window = init_window(270, 200, "Simple GLFW Window")
24+
window = init_window(270, 200, "pyside6")
2625
if not window:
2726
print("Failed to create GLFW window")
2827
return

Diff for: package/main_pygame.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@
1313
live2d.setLogEnable(True)
1414

1515

16-
def draw():
17-
pygame.display.flip()
18-
pygame.time.wait(10)
19-
20-
2116
def main():
2217
pygame.init()
2318
pygame.mixer.init()
2419
live2d.init()
2520

2621
display = (700, 500)
27-
pygame.display.set_mode(display, DOUBLEBUF | OPENGL)
22+
pygame.display.set_mode(display, DOUBLEBUF | OPENGL | NOFRAME)
23+
pygame.display.set_caption("pygame window")
2824

2925
live2d.glewInit()
3026
live2d.setGLProperties()
@@ -130,9 +126,10 @@ def on_finish_motion_callback():
130126

131127
model.SetOffset(dx, dy)
132128
model.SetScale(scale)
133-
live2d.clearBuffer(0.0, 0.0, 1.0, 0.0)
129+
live2d.clearBuffer(1.0, 0.0, 0.0, 0.0)
134130
model.Draw()
135-
draw()
131+
pygame.display.flip()
132+
# pygame.time.wait(10)
136133

137134
live2d.dispose()
138135

Diff for: updates.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# 更新内容
22

3+
## 2024/9/24
4+
* 更正`HitTest`的参数类型
5+
* 移除动态库内全局动作回调函数
6+
* 添加`live2d.clearBuffer`的可选背景色参数 by [@96bearli]
7+
* 修正`live2d.utils.log.logEnable`与动态库的状态同步
8+
* 修复简易面捕的抖动问题 by [@96bearli]
9+
10+
[@96bearli]: https://github.com/96bearli
11+
312
## 2024/8/22
413
添加:
514

0 commit comments

Comments
 (0)