talecrafter / animationimporter Goto Github PK
View Code? Open in Web Editor NEWAseprite Animation Importer for Unity
Aseprite Animation Importer for Unity
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.
Our main character file is pretty darn big. For longer imports, it would be nice to show a progress bar.
http://docs.unity3d.com/ScriptReference/EditorUtility.DisplayProgressBar.html
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
when the autoimporter is enabled if the animation has the loop check set to false once the synchronization occurs it enables the check
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:
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.
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);
}
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.
remember the pivot points when importing animations
As referenced in this post in unity, when reimporting a file, the metadata reference gets broken, and sets the Ids to 0.
They should all have IDs.
Unity version 2022.1.20f
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...
This is due to a change in AssetDatabase.CreateFolder
which occured in Unity 2019.4: `The path to the parent folder. Must start with "Assets/".
Previously this could have been an absolute path.
Fixed by modifying lines 88 to 96 in AssetDatabaseUtility
.
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.
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.
macOS Application is not selectable in Aseprite application selection dialog
app
extension is required for supporting macOS
Thank you for nice library ๐
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
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).
For clarity on what the issue/UI confusion actually is, here are Repro steps:
I hope this all makes sense. Please let me know if it doesn't and I will do my best to clarify!
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)
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.
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.
I've tried several projects in 2020.3.17f1, this project seems to do nothing anymore except make the spritesheet image.
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.
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).
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
Implement options to set custom paths for Sprites, Animations and Animation Controller exports.
Would love to see a package included with this repo so it can be easily cloned and imported.
On macOS I selected the Aseprite.app file in the AnimationImporter and it selects /Applications/Aseprite.app/Contents/MacOS/aseprite
, however, it complains it's unable to find Aseprite.
Unity 2018.4.2f1
I tried to extend the shader with an Emissive property, but its way over my head. Would be awesome to have this to control the glow of effects in Unity. Pretty substantial for VFX I think. but maybe this is already possible?
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:
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.
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)
"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.
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
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.