Jump to content

Dengar

Members
  • Posts

    189
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by Dengar

  1. Alas, this is where my expertise with Unity's mecanim system ends. I was hoping someone else would get interested in helping out with this aspect by now. :(

    This is in fact a known issue, and I do have a feeling there's some kind of fix for it, but at this point in time, I wouldn't know about that.

  2. 16 hours ago, Pixelpoint said:

    Good day all! 

    I have this small issue with Spriter2Unity (PS: it's not your fault! It's darn unity's fault). 

    I have animated all of my animations now and imported it successfully into Unity. All works well, EXCEPT one small thing:

    The animation will be slightly changed in Unity: Look at this example (from my project): http://imgur.com/eVbkWxB

    Seems like Unity is trying to "simulate physics" or something. Tried to fiddle around with the animation curve-tangents inside Unity, but I can't get the animations to look exaclty like it does in Spriter.

     

    The ONLY work-around I have found so far is: 

    1. Find all the parts where the animation doesn't look good inside Unity

    2. Go back to Spriter, find the same part in the timeline

    3. Spam "key all" button over that part, thus there are soo many keyframes in the animation that Unity can't get the chance to slerp/simulate physics/do random crap

     

    I think the problem inside Unity is maybe that all of the keyframe tangents are set to Free Smooth instead of Linear (or something like that).

    If anyone (especially you Dengar) have any advice for me, that would be great. As my work-around is very bad if I should decide to go and change parts of the animation (a lot of keyframes to change!)

     

    EDIT: even with 100 extra keyframes each 5th millisecond gives some weird artifacts in Unity. It looks better though

    This has something to do with the way Unity interpolates to form a tween. I'm not exactly sure what I can do about it. I have this distinct feeling that there is something I can do thoug.

  3. Alright, I have an update on the matter. I made a sort of intermediary build of the importer.

     

    You can now from the main menu go Edit > Project Settings > Spriter2UnityDX.

     

    There you can select whether you want your animations to be nested in the prefab, or placed in a separate folder.

     

    I won't up the version number because as of today it's really just a very fast and crude solution that may cause some unexpected behavior if you try some weird things. Also it's fairly untested. Try it and see if you like the results.

  4. Another feature planned for a future version is some implementation for CharacterMaps. That theoretically lets you store all your skin data in the prefab, or maybe a collection of ScriptableObjects, I haven't figured that part out.

    I understand your idea though. At the moment I'm not in a position to make one of those "Quick fixes" though, maybe this weekend I'll write up a quick fix, or someone else can write one up.

  5. Gots a quickfix for you that will fix the error (but won't actually implement the curve type):

    -Open the file "ScmlSupport".

    -Find the "CurveType" enum.

    -Add the word "bezier" to the list of possible CurveTypes.

     

    Basically, the short story is, the documentation never mentioned anything about a "bezier" curve type.

     

    That said, while the enum is there in the file, it's really just a thing for future implementations. The CurveType enum doesn't actually DO anything at this point in time.

  6. Updated the source folder as well as the package to v1.0.4. Contains a few minor fixes:

     

    -AnimationEvents are now preserved between reimports

    -SpriteSwapper renamed to TextureController to avoid confusion

    -Fixed a z-position issue with the SortingOrderUpdater

     

    I decided to wait with implementing the above fix until I know what it does exactly.

  7. Is the old version still in your project by chance?

     

    ...Also, looking at my code I suddenly realise something. See, reimporting works by basically deleting the old and then recreating it.

     

    There should be a few lines of code that basically grabs all the events from the previous version and copies them into the new version, but apparently I forgot to add that.

     

    As a "quick fix", open AnimationBuilder.cs and find the following block of code:

    if (OriginalClips.ContainsKey (animation.name)) { //If the clip already exists, copy this clip into the old one	var oldClip = OriginalClips [animation.name];	EditorUtility.CopySerialized (clip, oldClip);	clip = oldClip;	ProcessingInfo.ModifiedAnims.Add (clip);

    Then insert a few lines

    if (OriginalClips.ContainsKey (animation.name)) { //If the clip already exists, copy this clip into the old one	var oldClip = OriginalClips [animation.name];        var cachedEvents = oldClip.events;	EditorUtility.CopySerialized (clip, oldClip);	clip = oldClip;        AnimationUtility.SetAnimationEvents (clip, cachedEvents);	ProcessingInfo.ModifiedAnims.Add (clip);

    That should fix your problem.

     

    I'll also add this to the list of known issues.

  8. Hi, is there any possibility to make it so that the animation events don't get overwritten?

     

    Basically I want to manually go in my animation in unity, and add events myself. But when the spriter file gets updated, these events will disappear.

    Would it be possible for it to read where the events were, remember them, and add them to the newly imported animation? This would be amazing c:

     

    The DX version does nothing with events (precisely because of what you just said). Are you using the Mythgarr version?

  9. I... am not quite sure how that works? I mean, the importer should already do this for you. Also, what if the path does not contain the word spriter?

     

    That said, if it works for you, as well as for anyone else, it's a decent "quickfix".

     

    In addition, if, during your ventures, you make some improvements to the pipeline, I'd like to hear about it.

  10. If I ever get into a programming mood again, character maps are one of the highest things on the priority list. It would only be a quality of life thing though. If you want to reskin an existing sprite, you just write a script that does the following:

     

    1) If no sprite swapper is present for that body part, write a script that replaces the texture on the SpriteRenderer component.

    2) If there is a sprite swapper, write a script that replaces any of the textures on the SpriteSwapper component. (the SpriteSwapper overrides the SpriteRenderer, so don't use that one)

     

    @Mike:

     

    The spriter file is converted into a collection of objects: A Prefab object, and a series of Animation objects. The Animation objects only contain curve data. No texture data.

     

    Implementing the CharacterMap is not as difficult as it sounds. I (or someone else) just has to translate the CharacterMap data to a C# class and write a script that automatically replaces all the textures on the Prefab. No need to play with the Animations at all.

×
×
  • Create New...