- fixed IStreamedClip.CurveCount() being incorrect for some Unity versions
- fixed GameObject Curves not using the calculated Slopes
This commit is contained in:
FACS01-01 2024-05-07 10:53:49 -04:00 committed by GitHub
parent 35b9d8d954
commit d520c5fa91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -413,7 +413,7 @@ namespace AssetRipper.Processing.AnimationClips
switch (binding.GetClassID())
{
case ClassIDType.GameObject:
AddGameObjectCurve(binding, path, time, value);
AddGameObjectCurve(binding, path, time, value, inTangent, outTangent);
break;
case ClassIDType.MonoBehaviour:
@ -426,18 +426,18 @@ namespace AssetRipper.Processing.AnimationClips
}
}
private void AddGameObjectCurve(IGenericBinding binding, string path, float time, float value)
private void AddGameObjectCurve(IGenericBinding binding, string path, float time, float value, float inTangent, float outTangent)
{
if (GameObject.TryGetPath(binding.Attribute, out string? propertyName))
{
CurveData curve = new(path, propertyName, ClassIDType.GameObject);
AddFloatKeyframe(curve, time, value, 0, 0);
AddFloatKeyframe(curve, time, value, inTangent, outTangent);
}
else
{
// that means that dev exported animation clip with missing component
CurveData curve = new(path, GetReversedPath(MissedPropertyPrefix, binding.Attribute), ClassIDType.GameObject);
AddFloatKeyframe(curve, time, value, 0, 0);
AddFloatKeyframe(curve, time, value, inTangent, outTangent);
}
}

View File

@ -8,7 +8,7 @@ namespace AssetRipper.SourceGenerated.Extensions
public static int CurveCount(this IStreamedClip clip)
{
return clip.Has_CurveCount_UInt32() ? (int)clip.CurveCount_UInt32 : clip.CurveCount_UInt16;
return clip.Has_CurveCount_UInt32() ? (int)clip.CurveCount_UInt32 : clip.CurveCount_UInt16 + clip.DiscreteCurveCount;
}
}
}