Comments (7)
This seems to be a problem of the model itself, as I got the same effect when testing it on Live2D's official web demo (https://github.com/Live2D/CubismWebSamples). Have you been able to load this model successfully on another platform?
from live2d-viewer-web.
Thanks for replying!
I managed to have it loaded in unity's SDK, and the file and motion both work fine after deleting the 'hitbox' artmesh.
The image first loaded (without deleting the mesh) looks identical to what was on the web version, motion and mesh are fine but with a box covering it. But it is not very convenient and alpha motions are weird
Is it possible to implement 'delete or hide art mesh' function on the web version? Thanks in advance
from live2d-viewer-web.
Alright, according to the information, I've got it to work by adding the following code:
model.internalModel.coreModel.getDrawableOpacity = function (i) {
// make the HitArea transparent
if (this._model.drawables.ids[i] === 'HitArea') {
return 0;
}
return this._model.drawables.opacities[i];
};
It's quite ugly but I couldn't find a better solution.
And unfortunately the web viewer does not support scripting, so you'll probably need to fork this repo and make your own changes.
from live2d-viewer-web.
Got it, thanks again!
from live2d-viewer-web.
Sorry but one last question, I forgot to ask since I know close to nothing for coding, where do I add that script on? sorry again for the bother ;;
from live2d-viewer-web.
No problem.
Actually I just realized that you can run a patch script on the fly, without having to look into the source code.
First load your model in the web viewer, then press F12, paste the following code into console, and hit enter to run.
App.models.forEach((model) => {
model.pixiModel.internalModel.coreModel.getDrawableOpacity = function (i) {
if (this._model.drawables.ids[i] === "HitArea") {
return 0;
}
return this._model.drawables.opacities[i];
};
});
However you have to do this every time you enter the page, let me know if that doesn't fit your need.
from live2d-viewer-web.
Thanks a lot, it worked perfectly! No more problems, thank you again for your patience!
from live2d-viewer-web.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from live2d-viewer-web.