Giter VIP home page Giter VIP logo

animationimporter's People

Contributors

albertofdzm avatar b-reif avatar edwardrowe avatar giezijo avatar hu9o avatar iamallama avatar johnw-ret avatar openlevel avatar talecrafter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

animationimporter's Issues

Error when importing animation sheets that exceed Unity's max texture size

IOException: Sharing violation on path Assets/Editor/KnightModel.json System.IO.File.Move (System.String sourceFileName, System.String destFileName) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:339) AnimationImporter.Aseprite.AsepriteImporter.CreateSpriteAtlasAndMetaFile (AnimationImporter.AnimationImportJob job) (at Assets/Editor/Assets/AnimationImporter/Aseprite/AsepriteImporter.cs:147) AnimationImporter.Aseprite.AsepriteImporter.Import (AnimationImporter.AnimationImportJob job, AnimationImporter.AnimationImporterSharedConfig config) (at Assets/Editor/Assets/AnimationImporter/Aseprite/AsepriteImporter.cs:53) AnimationImporter.AnimationImporter.ImportJob (AnimationImporter.AnimationImportJob job) (at Assets/Editor/Assets/AnimationImporter/AnimationImporter.cs:282) AnimationImporter.AnimationImporter.Import (AnimationImporter.AnimationImportJob[] jobs) (at Assets/Editor/Assets/AnimationImporter/AnimationImporter.cs:264)

The importer works fine with small animations, i am trying to import 600 frames File.

Batch Drag and Drop

It would be nice to be able to drag and drop several aseprite files into the importer and have it batch execute the import process on each file. See image for example.

This isn't a high priority at all. Just an idea.

animationimporter_bulk

Tag names are not updated

So for example if i create a tag, save it and import it into unity, then change it's name to something completely different either:
a: if it's from lower case to caps or vise versa (player <--> PLAYER) then if the original tag was called player it will stay as player
or b: if the name of the tag is changed completely (player --> sprite) a new animation is created instead of overwriting it

New Animations not being updated as new states to an existing AnimatorController

Hey! I've noticed that adding new tags to an already imported Aseprite file does not add these new states to the AnimationController (AC). Perhaps I'm doing something wrong. Since the Animator is not updated automatically with the new AnimationClips/States, you have to re-add them manually.

It does work fine for the most part, since the new animations matching the new tags are being created accordingly in the Animations folder but they're not updated in the AC. Notice that removing any of existing states in the AC does not re-add them when the file is reimported either.

I've tried dragging the Aseprite file in either the "Animations" or "Animation Controller+Animations" windows, as well as trying the Automatic Import feature. Deleting the existing AnimationController to force every state to be re-added is not exactly an ideal option imo.

Steps to reproduce:

  1. Create an Aseprite image with 5 tags.
  2. Import with AnimationImporter.
  3. Check AnimationController and Animations subfolder (5 animation clips, AC has 5 states).
  4. Modify the Aseprite file adding a new 6th tag (e.g., "Walk 6").
  5. Reimport Aseprite file with AnimationImporter or autoimport itself.
  6. Check the AnimationController. Notice "Walk 6" has not been added in the Animator window (6 animation clips, AC still has 5 states).

My Unity version is 2020.2.6f1. I'm attaching a sample file (see below) made with Aseprite 1.2.25 which has 8 tags. To repro, tag the last untagged frames (97-108) with a new tag or add a random tag anywhere and try reimporting it.

Player_Bow_Drawv4_CHAR_192x192 test2.zip

error import animations

in Pyxel Edit Importer line 130 you are using [i] != 100 where need use [frameIndex] != 100, this generate an index out range exception where the animations > animation frames

for (int frameIndex = 0; frameIndex < animationData.length; frameIndex++)
{
ImportedAnimationFrame frame = new ImportedAnimationFrame();

frame.duration = animationData.frameDuration;
if (animationData.frameDurationMultipliers[i] != 100)
{
	frame.duration *= (int)(animationData.frameDurationMultipliers[i] / 100f);
}

Support Pixel-based pivot points

Currently the Importer only accepts normalized pivot points. Since I'm using this tool to import pixel art, it's more useful for me to be able to specify the pivot in terms of pixels.

I currently work around this by importing once, specifying the pixel value, converting it to the normalized value, then importing again.

Add alternative Sprite Naming schemes

Right now the Sprites get named like "Hero 0", "Hero 1"...
For some people it might be useful to have the Sprites named according to Animation names (e.g. for skinning/replacing).
As we don't want to break existing projects this should be added as a config option with the standard being the current scheme.
Possible other schemes:
hero_idle_0, hero_idle_1...
idle0, idle1...

issue when importing pyxelEdit animations

the tool splits the sprite just fine but the "pieces" appear to be flipped vertically in their order.
I have to manually open the generated spritesheet, flip the image vertically and save, after doing so the "squares" representing the animation frames are correctly disposed.

immagine

if you notice in the image, the last row has 13 frames, which should be on the first row, the 4th and the 2nd are inverted too, the middle one is fine. So if i would flip the sprite vertically everything would be fine.

Animtion

Hi,

I tried new version and looks like only Sprites (with sprite sheet) folder is created and Animations missing (Anim controller is created).
I have used Aseprite 1.1.3.

Tried on both drag zones.

Best regards,
AndyGFX

Pivot point settings only applied to new animation files (UI/UX confusion?)

Changing the config setting for the pivot point only seems to work if you are importing a new file.

Looking at previously closed Issues, I have the feeling that this may be by design? I understand that remembering previous settings is very useful when re-importing the same file, in which case, feel free to ignore this issue, but because I was trying to update the pivot point for a file that I had previously imported, I found it confusing.

A way to perhaps avoid this issue might be to adjust the UI slightly? It could be clearer what settings will actually be used during the import by having a way to select the file, load previous settings so that they can be modified (or not) and then a separate "Import Anim" button that actually does the importing. (See quick and dirty mockup attached).
animationimporter_ui_suggestion

For clarity on what the issue/UI confusion actually is, here are Repro steps:

  1. In the Config section of the Animation Importer window, set Sprite Alignment to something, say "Center" (but it could be any of the settings)
  2. Import a new Aseprite file, anim_01.ase (just for the purpose of this example) by dragging it
  3. Now find the Sprite sheet that was created (anim_01.png) and open it up in Unity's Sprite Editor to see the slices and pivot points. And the pivots are correctly placed in the center.
  4. Go back to the Animation Importer window, change the Sprite Alignment to something else, say "Top Right" (anything BUT Center)
  5. Re-Import the SAME Aseprite file, anim_01.ase by dragging it
  6. Find the Sprite sheet that was created (anim_01.png) and open it up in Unity's Sprite Editor. The pivot points are still in the center. They haven't been updated to be in the Top Right of the sprites.

I hope this all makes sense. Please let me know if it doesn't and I will do my best to clarify!

Exception is thrown when opening the editor window in Unity 2018.3

The exception "AssetDatabaseUtility CreateDirectoriesInPath expects full Unity path, including 'Assets". Adding Assets to path." is thrown on line 71 of the file 'AssetDatabaseUtility.cs'. It appears that Unity has changed to nature of its path separator characters to be the standard platform separator Path.DirectorySeparatorChar?

Full exception stack trace:

UnityException: AssetDatabaseUtility CreateDirectoriesInPath expects full Unity path, including 'Assets". Adding Assets to path.
AnimationImporter.AssetDatabaseUtility.CreateDirectoriesInPath (System.String unityDirectoryPath) (at Assets/3rd Party/AnimationImporter/Editor/Utilities/AssetDatabaseUtility.cs:71)
AnimationImporter.AssetDatabaseUtility.CreateAssetAndDirectories (UnityEngine.Object unityObject, System.String unityFilePath) (at Assets/3rd Party/AnimationImporter/Editor/Utilities/AssetDatabaseUtility.cs:31)
AnimationImporter.ScriptableObjectUtility.LoadOrCreateSaveData[T] (System.String unityPathToFile) (at Assets/3rd Party/AnimationImporter/Editor/Utilities/ScriptableObjectUtility.cs:59)
AnimationImporter.AnimationImporter.LoadOrCreateUserConfig () (at Assets/3rd Party/AnimationImporter/Editor/AnimationImporter.cs:141)
AnimationImporter.AnimationImporterWindow.OnEnable () (at Assets/3rd Party/AnimationImporter/Editor/AnimationImporterWindow.cs:51)
UnityEditor.EditorWindow:GetWindow(Type, Boolean, String)
AnimationImporter.AnimationImporterWindow:ImportAnimationsMenu() (at Assets/3rd Party/AnimationImporter/Editor/AnimationImporterWindow.cs:42)

No Error is reported to the user when path to Application is invalid

When the user has an improperly configured path to Aseprite, they are unable to drag and drop files into the drop area. This has confused me from time to time, as I couldn't immediately tell whey the file was being rejected.

A fix would be to allow them to drop the file into the area, but show a popup explaining how to fix the problem.

Here's a gif of the described behavior:
animation-importer-badpath-no-error

Set standard framerate to 1000

According to my knowledge, the framerate value of Unity animations has no performance impact, it's only the number of keyframes that's important. Imported keyframes have exact timing in playback. Once the user modifies the animation in the Unity Editor though, keyframes might get aligned to the framerate (e.g. 60 per second), and thus changed from the original timings.
Therefore it would be useful to have the framerate at 1000, aligning with the millisecond values of Aseprite.
I have no definite knowledge of this, so I leave this issue open for a while.

Colors for indexed Aseprite images are wrong unless the first color is transparent

When I imported an indexed image, the colors were all wrong. I realized that the order of the colors wasn't normal, so I shuffled them around. The issue went away. After playing with it, I now know that the first color in the color palette must be transparency for it to correctly import the image.

This is what it should look like:
LightPerson

This is what it looks like if transparency isn't first:
LightPersonIndexed

Error while Path to Aseprite has not been configured

Currently the DropButton for importing files is disabled when the application path to Aseprite has not been set up (https://github.com/talecrafter/AnimationImporter/blob/master/Assets/AnimationImporter/Editor/AnimationImporterWindow.cs#L217)

In my opinion, a more elegant solution would be to show an error when they try to drop a file onto the button which would prompt them to set up the path.

An alternative solution (and maybe even better) would be to render the window with a single call to action button when launching the window for the first time. Clicking this button would then prompts them to find the path to Aseprite (as if they pressed the "Select" button in the current Config for Aseprite path).

Project maintained?

Hei

Just wanted to know if there is any plan on continuing maintenance for this project or if we should move to a new fork?
I made a couple of changes which I think could benefit other people (specifying sprite renderer path, retaining per sprite pivot, stuff like that) but if pull requests are not considered I don't think there is much use in sending them here.

Cheers, and again, thanks a lot for this amazing tool.

Best
Giezi

Custom Path

Implement options to set custom paths for Sprites, Animations and Animation Controller exports.

Animation Non-Looping Is Honored Only for New Animation Clips

After you've generated Animation Clips for an Aseprite file, the Non-Looping rules are ignored. This seems to be by design, but I'd argue it's unintuitive.

To clarify, here are the repo steps:

  1. Create an Aseprite file with at least one Animation tag. (example tag: "Attack_D")
  2. Make sure the Non-Looping rules don't match any of the file's tags.
  3. Import the file's Animation Clips, and observe that they are flagged looping.
  4. Add a new Non-Looping rule that matches one of the tags. (ex: "Attack_D")
  5. Reimport the file
  6. Observe that the clip that matches the Non-Looping rule is still flagged looping (in this case Attack_D)

Here's why I think this is a bug. To me the settings and Aseprite file are the truth of the assets. When you change pivot, or pixels per unit, the spritesheet will change accordingly. If you change visuals or numbers of frames, or timings inside Aseprite, the clips will change. If we could actually flag the Tag as looping inside Aseprite, it would hold that the looping flag inside Aseprite should be observed inside Unity. Unfortunately we can't do that, but to me the Non-Looping settings are essentially a workaround on that fact.

I'd argue this may hold true for AnimationTargets, but I haven't used those yet so I'm not sure about the use cases. But in theory if you change the target type inside settings and reimport the file, it should retarget the animation clip.

I understand this is a subjective call, so I won't be offended if you close this as a non-issue.

Here's a GIF in case it helps to clarify what I'm talking about.

looping-bug

NullReferenceException when selecting Aseprite application path

I am unable to setup this package while using the Select button for selecting the Aseprite.app folder, which is located at ~/Library/Application Support/Steam/steamapps/common/Aseprite/Aseprite.app.

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at /Users/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:296)
UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at /Users/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:306)
UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options) (at /Users/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:293)
AnimationImporter.AnimationImporterWindow.ShowAsepriteApplicationSelection () (at Assets/AnimationImporter/Editor/AnimationImporterWindow.cs:286)
AnimationImporter.AnimationImporterWindow.ShowUserConfig () (at Assets/AnimationImporter/Editor/AnimationImporterWindow.cs:137)
AnimationImporter.AnimationImporterWindow.OnGUI () (at Assets/AnimationImporter/Editor/AnimationImporterWindow.cs:76)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:305)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:313)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:261)
UnityEditor.DockArea.OldOnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:383)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at /Users/builduser/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:195)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at /Users/builduser/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:333)
UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at /Users/builduser/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:317)
UnityEngine.Experimental.UIElements.EventDispatcher.DispatchEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at /Users/builduser/buildslave/unity/build/Runtime/UIElements/Managed/EventDispatcher.cs:250)
UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at /Users/builduser/buildslave/unity/build/Runtime/UIElements/Managed/UIElementsUtility.cs:251)
UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/builduser/buildslave/unity/build/Runtime/UIElements/Managed/UIElementsUtility.cs:78)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUIUtility.cs:175)

Please rename the repository

"PixelAnimationImporter" or "AcespriteAnimationImporter" are good names reflecting the specifics of this project.
Just "AnimationImporter" will always imply first and foremost import of animated skeletal meshes, in the unity context.

Store preferences per project

Change the way that the preferences get stored to allow having different configurations on each project.

Currently all the preferences are being stored with EditorPrefs which saves those values on the system and are shared with all the project.

The settings should be stored in the project folder, maybe the only value that should be stored in the EditorPrefs is the Aseprite path.

Note: Use of PlayerPrefs could solve the problem or this tool could be helpful ProjectPrefs

AnimationImporter.cs is giving me an error

i recently tried to use your asset after i downloaded but no matter i try to get a clean install of unity, i always get this message:

Assets\AnimationImporter\Editor\AnimationImporter.cs(159,21): error CS0234: The type or namespace name 'standardApplicationPath' does not exist in the namespace 'AsepriteImporter' (are you missing an assembly reference?)

even when i deleted the library, it didn't change anything... i also don't understand why my previous unity install worked with it... i use unity 2020.1, 2020.2, 2020.3 and 2021.1 all of them are not working despite from the fact that i upgraded my previous project from 2016.1 to 2021.1 throughout the years without no problem.

Set root name of generated assets / generate a new set of assets for each layer

I have multiple layers in my aseprite project, and I want to control each layer with a different controller (example, characters upper body and lower body are independently controlled). There is not a good workflow to get this to import nicely with AnimationImporter. Because the name of the generated assets is based on the name of the aseprite file, I would need to have multiple asesprite files, which would make it hard to reference one layer to the other.

By having the name specifiable in the importer, I could simply toggle visibility of layers in aseprite between each layer import. Or there could be an option for each layer to be a different controller and set of animations. This could act similarly to the "non looping animation" section, where you specify the names of layers / layer groups to import.

NonLooping clips could be specified using RegularExpressions

Our project is a top down game, so our main character has 8 different facing directions currently. We specify the direction with a suffix. For example, our Idle animation is made up of 8 clips: Spawn_U, Spawn_UR, Spawn_R, etc.

To keep us from having to enter every animation 8 times, we allow users to add regular expressions as our "nonLoopingClipNames". The regex we use right now is:
Spawn(_U|_UR|_R|_DR|_D|_DL|_L|_UL|\b) to allow any of the valid suffixes if preceded by an underscore, or to simply allow Idle (which we sometimes use for animations with no blends.)

I also add a word boundary character at the start and end of the supplied names, so that it doesn't break expected behavior for older entries that were expected to match exactly.

The major downside is this may have a performance hit. I'm not exactly sure how slow Regex is, especially when tested against every clip.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.