[Notice of Holidays]
Please note that our staff will not be available from 2024/Dec/28 - 2025/Jan/5 JST.
The Live2D Creators Forum will remain open during the holidays.
Submissions that require a response will be answered after we reopen for business.
Please note that it will take longer than usual to respond to your request.
CubismModelSettingJson can't read file
Hello. I'm pretty new to c++ development and I try to port Live2D native opengl framework to Qt Quick/Qml (also tried widgets).
I've managed to create cmake project, compile and run it, but right away after startup there is an issue with json reading - all values are empty.
I've played around and figured out that it works if I try to read model before initializing Qt application (by creating QGuiApplication instance) but fails if I try to read it afterwards, even though I pass the same arguments as can be seen in debugger, I've added screenshots with code samples
hereI tried to follow invocation chain and last thing that looks different is the endPos variable inside of method CubismJson::ParseBytes, when parsing works properly it has the same number as count of bytes in file, but if it fails it becomes 1441 instead of 1736. Maybe application starts to treat encoding differently? Is it possible with c++ to change such things in runtime? Any ideas what else might cause this issue? I can attach my project if someone is interested in reproducing it
I'm using CLion on Ubuntu Linux 22. I was able to run sample project without any issues.
0 ·
Comments
Looks like locale is getting changed by Qt and it somehow breaks json parser logic. To fix it I set locale after application instance is created
QGuiApplication app(argc, argv); setlocale(LC_ALL, "C");