mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-03-10 07:44:57 +08:00
fix: cursed interaction with Unity Timeline causes animation curves to be lost (#952)
Closes: #950
This commit is contained in:
parent
0806c621c5
commit
2cd996db55
@ -196,7 +196,7 @@ namespace nadena.dev.modular_avatar.animation
|
||||
}
|
||||
}
|
||||
|
||||
private string MapPath(UnityEditor.EditorCurveBinding binding)
|
||||
private string MapPath(EditorCurveBinding binding)
|
||||
{
|
||||
if (binding.type == typeof(Animator) && binding.path == "")
|
||||
{
|
||||
@ -249,7 +249,10 @@ namespace nadena.dev.modular_avatar.animation
|
||||
{
|
||||
var newBinding = binding;
|
||||
newBinding.path = MapPath(binding);
|
||||
newClip.SetCurve(newBinding.path, newBinding.type, newBinding.propertyName,
|
||||
// https://github.com/bdunderscore/modular-avatar/issues/950
|
||||
// It's reported that sometimes using SetObjectReferenceCurve right after SetCurve might cause the
|
||||
// curves to be forgotten; use SetEditorCurve instead.
|
||||
AnimationUtility.SetEditorCurve(newClip, newBinding,
|
||||
AnimationUtility.GetEditorCurve(originalClip, binding));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user