Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AnimationClipUtility to use empty string #2501

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Assets/UniGLTF/Runtime/UniHumanoid/AnimationClipUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,23 @@ public static AnimationClip CreateAnimationClipFromHumanPose(HumanPose pose)
new Keyframe(0, pose.bodyPosition.x),
});
var muscle = "RootT.x";
clip.SetCurve(null, typeof(Animator), muscle, curve);
clip.SetCurve(string.Empty, typeof(Animator), muscle, curve);
}
{
var curve = new AnimationCurve(new Keyframe[]
{
new Keyframe(0, pose.bodyPosition.y),
});
var muscle = "RootT.y";
clip.SetCurve(null, typeof(Animator), muscle, curve);
clip.SetCurve(string.Empty, typeof(Animator), muscle, curve);
}
{
var curve = new AnimationCurve(new Keyframe[]
{
new Keyframe(0, pose.bodyPosition.z),
});
var muscle = "RootT.z";
clip.SetCurve(null, typeof(Animator), muscle, curve);
clip.SetCurve(string.Empty, typeof(Animator), muscle, curve);
}

// rot
Expand All @@ -87,31 +87,31 @@ public static AnimationClip CreateAnimationClipFromHumanPose(HumanPose pose)
new Keyframe(0, pose.bodyRotation.x),
});
var muscle = "RootQ.x";
clip.SetCurve(null, typeof(Animator), muscle, curve);
clip.SetCurve(string.Empty, typeof(Animator), muscle, curve);
}
{
var curve = new AnimationCurve(new Keyframe[]
{
new Keyframe(0, pose.bodyRotation.y),
});
var muscle = "RootQ.y";
clip.SetCurve(null, typeof(Animator), muscle, curve);
clip.SetCurve(string.Empty, typeof(Animator), muscle, curve);
}
{
var curve = new AnimationCurve(new Keyframe[]
{
new Keyframe(0, pose.bodyRotation.z),
});
var muscle = "RootQ.z";
clip.SetCurve(null, typeof(Animator), muscle, curve);
clip.SetCurve(string.Empty, typeof(Animator), muscle, curve);
}
{
var curve = new AnimationCurve(new Keyframe[]
{
new Keyframe(0, pose.bodyRotation.w),
});
var muscle = "RootQ.w";
clip.SetCurve(null, typeof(Animator), muscle, curve);
clip.SetCurve(string.Empty, typeof(Animator), muscle, curve);
}

// muscles
Expand All @@ -126,7 +126,7 @@ public static AnimationClip CreateAnimationClipFromHumanPose(HumanPose pose)
{
muscle = TraitPropMap[muscle];
}
clip.SetCurve(null, typeof(Animator), muscle, curve);
clip.SetCurve(string.Empty, typeof(Animator), muscle, curve);
}
return clip;
}
Expand Down