Closed dannylin0711 closed 3 years ago
I don't get it, that sounds like it's working as expected, since setting the fading duration to 0 means there will be an instant transition between two motions.
The idle animations should not have any transition between it, I think. It should loop smoothly, instead of looping with transition between every individual animation.
I'm still not clear, hmm, isn't "smoothly" equivalent to "with transition"? Or perhaps, did you mean to let the model loop a single idle motion instead of looping between multiple idle motions?
Ummm, yeah that's probably what I mean, there is a weird interval the model just stop animating when transition between the idle motion(one idle animation only)
OK I get it, this is a problem indeed, I'll investigate it.
Well, I realized setting the duration to 0 can actually fix this problem. The reason it doesn't work in your case is probably because the durations are overwritten by the ones that the idle motion defines. You can check if the idle motion in your model's settings file looks like this:
{"file": "abc.mtn", "fade_in": 2000, "fade_out": 2000}
If so, removing the fade_in
and fade_out
should fix it.
And if it's a model of Cubism 3 or 4, the keys will instead be FadeInTime
and FadeOutTime
.
Ok, I will look into that,thanks!
OK, so I open up the motion.json, and the FadeInTime and FadeOutTime are both 0.0.
You need to check the model.json as well, because the durations will only be read from the model.json, and those in motion.json will be ignored. This is basically another bug that I'll fix later.
I didn't see that two parameters in my model.json , hmmm.
That's strange, I've tested various models and they all behaved well.
Could you share the model you used so I can test with it? If it's a proprietary model, you can replace the textures with solid black images before sharing, in order to prevent any potential abuse.
left_sen.zip I've also test the models with the viewer in the readme.md, the problem stills happen.
Thanks.
During the test, I can still see that it makes difference when setting 0 durations, as the picture below, the left model gets 0 durations applied and the right model remains default.
Here's how the config should be set up, did you do it like this?
import { config } from 'pixi-live2d-display';
config.idleMotionFadingDuration = 0;
Yes, that's what I did. This set of models' motion changes expression(not using the expressions in Live2D), so some models would stop at the end of the motion and give a weird face in the time between the motions.
I'm not sure if this is the correct usage
const live2d = PIXI.live2d;
and use it as
live2d.config.motionFadingDuration = 0;
live2d.config.idleMotionFadingDuration = 0;
live2d.config.expressionFadingDuration = 0;
I did not use nodeJS.
https://github.com/dannylin0711/SDVX-Wallpaper This is the project, the code is open to public, but not the model.
Okay so I actually made some idiot error I initialize the model before I change the config BEFORE
let modelData = await live2d.Live2DModel.from(jsonPath, { idleMotionGroup: 'Idle', motionPreload: "ALL" });
...
live2d.config.motionFadingDuration = 0;
live2d.config.idleMotionFadingDuration = 0;
live2d.config.expressionFadingDuration = 0;
AFTER
live2d.config.motionFadingDuration = 0;
live2d.config.idleMotionFadingDuration = 0;
live2d.config.expressionFadingDuration = 0;
...
let modelData = await live2d.Live2DModel.from(jsonPath, { idleMotionGroup: 'Idle', motionPreload: "ALL" });
I firstly thought that model have the duration time set already, so I should edit the time after I initialize the model, however I just figure out while I was taking a shower that the config should be changed before I initialize the model if the model didn't specify a fadein/out value.
Hope that the fade in/out timing would implement in the future, good work and thanks for helping
Even I didn't think of this possibility, it's good to see it works.
Sorry, I would like to ask if there's a way to custom the auto focus function(e.g. disable the auto focus, and add my own event listener) on cursor?
Thanks!
Already set the motionFadingDuration and idleMotionFadingDuration to 0, but it doesn't work like the idle motion interval in Cubism Viewer, which is continuous and would not stop the previous idle animation before the next idle animation play.