Skip to content

Commit 919ca58

Browse files
committed
Fix MotionFade and PoseMotionImporter
1 parent f9a1e52 commit 919ca58

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

Assets/Live2D/Cubism/Framework/MotionFade/CubismFadeController.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ private void UpdateFade(ICubismFadeState fadeState)
137137

138138
var time = Time.time;
139139

140-
var isDoneAllFadeIn = true;
141-
142140
// Calculate MotionFade.
143141
for (var i = 0; i < playingMotions.Count; i++)
144142
{
@@ -222,18 +220,10 @@ private void UpdateFade(ICubismFadeState fadeState)
222220
fadeMotion.ParameterFadeInTimes[index], fadeMotion.ParameterFadeOutTimes[index],
223221
motionWeight, DestinationParts[j].Opacity);
224222
}
225-
226-
227-
if (erapsedTime > fadeInTime)
228-
{
229-
continue;
230-
}
231-
isDoneAllFadeIn = false;
232223
}
233224

234-
if (!isDoneAllFadeIn || !fadeState.GetStateTransitionFinished())
225+
if (!fadeState.GetStateTransitionFinished())
235226
{
236-
// Do not process any motion that has never finished fade-in.
237227
return;
238228
}
239229

@@ -250,7 +240,7 @@ private void UpdateFade(ICubismFadeState fadeState)
250240
continue;
251241
}
252242

253-
// If fade-in of all motion has been completed, delete the motion that has been played back.
243+
// If fade-in has been completed, delete the motion that has been played back.
254244
fadeState.StopAnimation(i);
255245
}
256246
}

Assets/Live2D/Cubism/Framework/Pose/Editor/CubismPoseMotionImporter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ private static void RegisterModelImporter()
4747
private static void OnModelImport(CubismModel3JsonImporter sender, CubismModel model)
4848
{
4949
var shouldImportAsOriginalWorkflow = CubismUnityEditorMenu.ShouldImportAsOriginalWorkflow;
50+
var pose3Json = sender.Model3Json.Pose3Json;
5051

5152
// Fail silently...
52-
if(!shouldImportAsOriginalWorkflow)
53+
if(!shouldImportAsOriginalWorkflow || pose3Json == null)
5354
{
5455
return;
5556
}
5657

5758
var assetsDirectoryPath = Application.dataPath.Replace("Assets", "");
5859
var assetPath = sender.AssetPath.Replace(assetsDirectoryPath, "");
5960
var fileReferences = sender.Model3Json.FileReferences;
60-
var pose3Json = sender.Model3Json.Pose3Json;
6161

6262
// Create pose animation clip
6363
var motions = new List<CubismModel3Json.SerializableMotion>();

0 commit comments

Comments
 (0)