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

Many bugs when imported to Unity #10

Open
gabrieltva opened this issue Oct 17, 2016 · 3 comments
Open

Many bugs when imported to Unity #10

gabrieltva opened this issue Oct 17, 2016 · 3 comments

Comments

@gabrieltva
Copy link

Hi guys,

I am trying to import an animation to Unity, and in the 80% of the cases, it's fail.
Why this happen?

Here is an animation on the Spriter Pro, and the same in the Unity, after the import:
out-17-2016 13-28-31

In Unity:
out-17-2016 13-28-15

Is not only this animation that the problem occurred.

Can you help me?

@gabrieltva gabrieltva changed the title So many bugs when import to Unity Many bugs when imported to Unity Oct 17, 2016
@CarlosHBP
Copy link

This is old, but if anyone have this problem could try insert this at the end of Build method inside AnimationBuilder (Spriter2UnitDX/Editor):

EditorCurveBinding[] curveBindings = AnimationUtility.GetCurveBindings(clip);
AnimationCurve animCurve;
foreach (EditorCurveBinding curveBinding in curveBindings)
{
    if (curveBinding.propertyName != "DisplayedSprite" && curveBinding.propertyName != "m_IsActive")
    {
        animCurve = AnimationUtility.GetEditorCurve(clip, curveBinding);
        for (int i = 0; i < animCurve.length; i++)
        {
            AnimationUtility.SetKeyLeftTangentMode(animCurve, i, AnimationUtility.TangentMode.Linear);
            AnimationUtility.SetKeyRightTangentMode(animCurve, i, AnimationUtility.TangentMode.Linear);
        }
        AnimationUtility.SetEditorCurve(clip, curveBinding, animCurve);
    }
}

That solution was done by @FedericoCara. I just added the "if". You could try to remove it if not work.

@TheItCrOw
Copy link

I know this is old but I wanted to thank you anyways. I was not able to use any animationen I made in spriter without practically redoing them in unity after the import crashed so many weird sprite movement. This solution is CRUCIAL and should be added immeadiatly into the repository!

@Dharengo
Copy link
Owner

Dharengo commented May 18, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants