[About macOS Ventura 13.0] (12/20/2022)
The currently released Live2D Cubism SDK is not guaranteed to work with macOS Ventura.
Please refrain from upgrading the macOS as they may not work properly.
The Cubism Editor license file may be lost after the macOS upgrade.
Please make sure to deactivate the Cubism Editor license before upgrading the macOS.
For more details
About the support for Mac models
Cubism Editor is not supported with Apple M1 processors.
Please refer to System Requirements
We will not respond to any related inquiries with this message.
Have automatic blinking/breathing.
How do I make a character have automatic blinking and breathing? I have made a variant of the SDK's SimpleModel.cs and I use .mtn files to change the pose and show emotions, but after the animation is played, the character stays still and stiff. I'd be very thankful if someone could tell me how to have her appear alive with breathing and blinking.
You can make automatic blinking and breathing the following code .
In the case of you , it is better not to use the EyeBlink function .
There was EyeBlink motion function in Live2D Animator .
I think that good to make motion with Live2D Animator !
My models look like this in the game:
Normal open (0.5)
Semi-open (aproximately 0.3)
Wide open (1.0)
As shown, the eye "open" parameter value depends on what .mtn is loaded into the model. I'm using the SimpleModel.cs as a base.
Perhaps I need to use a different base?
I test code is as follows . Please try to adjust the value .
Here is an eye parameter without any blinking:
This is what I am looking for:
This is what your code currently does.
So, the "eyeblink-down" works well. The problem is the "eyeblink-up". It needs to return to the "original" curve.
Is a way to achieve that?
If there is no different or better way to achieve the result I'm looking for, I have two ideas. I'd like to know which one would be more wise for me to choose. Please note that I really really want to find a coded and more elegant solution than these ideas I have, but I'm determined to achieve the eyeblink result.
Would it be possible to create a "ghost" of the eyeblink parameter, which doesn't blink, and then a "real" version that blinks?
The ghost is the eyeblink value without any blinking. The on-screen blinking will take the Ghost value when it is not blinking, but when the blinking motion is activated, it will do the blink and ignore the Ghost value, until it returns to it.
I could make an additional parameter called "Force Blinking", which looks like the chart above, and then control the blinking through it by having the value of "Force Blinking" change from 1.0 to 0.0 and then back at random moments, like normal blinking.
I repeat that I would much prefer to find a simpler and coded solution, but I am currently not knowledgeable enough in coding and Live2D's SDK to know how to do it in a better way, so please forgive my clumsiness.
I deeply appreciate the input until now, and thank you in advance for reading my long post.
Thanks for the detailed explanation. As naotaro pointed out
multParamFloat()should be the way to go. But this might be an issue with the framework. Could you replace the the file in the framework with the one attached to this message and check whether it works better?
In your own code use the initial version naotaro posted, i.e.:
// Breath double timeSec = UtSystem.getUserTimeMSec() / 1000.0; double t = timeSec * 2 * Math.PI; live2DModel.setParamFloat("PARAM_BREATH", (float)(0.5f + 0.5f * Math.Sin(t / 3.0))); // EYE Blink eyeBlink.setParam(live2DModel);
Please let me know if that worked.
I'm sorry, but your proposed code does not work. The cs file you have linked me is missing the "setParam" function which you're asking me to add.
However, "updateParam()" does exist, so I've tried with "eyeBlink.updateParam(live2DModel)" instead.
That didn't work either. Full experience and testing with this in the spoiler.
I tried adding a Debug.Log() to every switch case within the EyeBlink code and then I ran it, but without "Debug.Log("EyeStateInterval")" because it was too spammy (https://i.gyazo.com/7fa6857f21d74a318d19cacd59c9170b.png). I got the following:
I tried changing "MultParamfloat" to "SetParamFloat", and it worked!...But I got the 100% open eye problem again.
Does the "Mult" in MultParamfloat mean Multiply? Maybe the eyes remain closed because once the eyes are at 0, the eyeblink is then multiplying something by zero to open it again and getting more zero?
Since "SetParam" works, but had the 100% eye-open problem, what I did was to adjust to what value the SetParam reached upon performing the eye-opening action by setting it to be what value it has when motionMgr.isFinished() is called. My solution unfortunately doesn't work for mtns that are being played live due to that, but the result still looks natural and a couple of my motions actually implement blinking as part of the emotion being shown (especially in the Tsundere's case, example here: http://i.imgur.com/Oqw9gzO.gif, as she condescends people or blinks repeatedly while being flustered and blushing). So it's a feature that works in my favor, since automated blinking without that feature could've interfered with the expression.
Here it is if you'd like to check it out. It's a variation of the regular L2DEyeblink but its within the Model's cs file.