Search Unity

PowerSprite Animator - Edit your sprite animations in style

Discussion in 'Assets and Asset Store' started by PowerhoofDave, Sep 29, 2016.

  1. PowerhoofDave

    PowerhoofDave

    Joined:
    Jun 26, 2015
    Posts:
    75
    No video, but the pdf documentation explains how to use the nodes, and the example project/scene shows some basic code for attaching things.
     
  2. Alucardjh

    Alucardjh

    Joined:
    Jun 4, 2015
    Posts:
    6
    Thank you I did realize everything I needed was in the PDF document a couple hours ago. I still have a problem though... I think there is maybe a bug. Everytime I touch any of my nodes (regardless of the sprit it is in) I get some of my events removed.
     
  3. PowerhoofDave

    PowerhoofDave

    Joined:
    Jun 26, 2015
    Posts:
    75
    Hrmm I haven't seen anything like that before, what version of unity are you using? Maybe it's a new bug.
     
  4. BifDog

    BifDog

    Joined:
    Aug 1, 2013
    Posts:
    2
    Hello, I just bought this asset and I love it! For some reason I cannot delete frames from the timeline... I am using unity 2020 LTS. I can delete a frame with the minus symbol from the list, but not from the timeline with the delete key. Am I just doing something wrong? :p
     
  5. BifDog

    BifDog

    Joined:
    Aug 1, 2013
    Posts:
    2
    I figured it out in case anyone else is having this issue... I am on a Mac, and I need to press CMD + Delete.
     
  6. PowerhoofDave

    PowerhoofDave

    Joined:
    Jun 26, 2015
    Posts:
    75
    Hrmm, glad you figured this out. I don't have a mac to test on, but I'll see if I can find a fix.
     
  7. choijaeyoung

    choijaeyoung

    Joined:
    Feb 8, 2020
    Posts:
    13
    Hi,

    Is there a way to rename multiple Sprite Path of selected animation clip at once? Multiple selection will only change the first of the selected. It'd save me quite some time if I could multiple edit the sprite path of hundreds of animation clip I needed to edit...
     
  8. PowerhoofDave

    PowerhoofDave

    Joined:
    Jun 26, 2015
    Posts:
    75
    I don't think there's a way with PSA, I know that unity kinda broke multi-object editing with the new prefab system, though not sure if that really affected animations anyway.

    One way you could try is to open all the anims in a text editor (like notepad++) and do a find-replace-all. Like replace "path: OldPath" with "path: NewPath"

    That might work?
     
  9. NikoBay

    NikoBay

    Joined:
    Aug 15, 2018
    Posts:
    39
    Hi Dave,
    Currently the PowerSprite(PS) does not update its sprite whenever new edit on sprites is commit, like changing pivot points, bounds... So users have to choose another animation and back for it to refresh and update its sprites.
    Could you please look into it? It's a small problem but it's getting annoying since I'm doing these sequences a lot.
    Thanks,
     
  10. PowerhoofDave

    PowerhoofDave

    Joined:
    Jun 26, 2015
    Posts:
    75
    Yeah, I'll take a look. Is this just a problem when you're editing the pivots? I wouldn't have thought bounds would change how the sprite looks in PS anyway... And if you re-import the sprite (like when editing the actual image) is it updating in that caes? I thought it was but might be wrong.
     
  11. NikoBay

    NikoBay

    Joined:
    Aug 15, 2018
    Posts:
    39
    I think whatever I do change in sprites editor will not be updated in PS. For example: changing bounds that cut sprites in half, apply and still see sprite whole in PS editor. Same with pivot.
    Not the case with reimporting, I think.
     
  12. kurismakku

    kurismakku

    Joined:
    Sep 18, 2013
    Posts:
    66
    Hi there, amazing asset, saves me a lot of time when handling animations :)

    Just a quick question, why does changing the Sample Rate changes the Length, but it doesn't work vice versa?

    EDIT: I also notice that sometimes even if I change the Sample Rate, it doesn't affect the Length. It doesn't work if I change from 12 to 24, but works if I change from 24 to 25 sample rate.
     
    Last edited: Sep 21, 2021
  13. Sparkrai

    Sparkrai

    Joined:
    Oct 21, 2021
    Posts:
    1
    Hey there! First of all, amazing job with this, it's really nice to have a proper editor for sprite animations :)

    I'm not sure if it's just a thing of using 2022.1 or the HDRP but the preview in the Powe Anim window seems to be "ghosting" or draing all the sprites at the same time.
    Do you know what could cause this?
    upload_2022-6-12_14-41-53.png
     
  14. PowerhoofDave

    PowerhoofDave

    Joined:
    Jun 26, 2015
    Posts:
    75
    Ah, someone else had that, yeah, seems to be a unity 2022 issue. No idea if it'll fix itself in a future version or not yet :p
    But for now, I *think* this fixes it (mostly) I haven't had a chance to properly check it works in older unity versions, etc, so just a zip here for now.

    Unzip it into your Assets\PowerSpriteAnimator\Scripts folder. (Maybe make a backup first ;) )
     

    Attached Files:

  15. brittany

    brittany

    Joined:
    Feb 26, 2013
    Posts:
    93
    Hello! I am interested in this asset but I am wondering if it has any functionality for adjusting collider sizes? For example, when my character goes into a slide, the collider needs to change. Currently I do that with Unity's Animation but I don't really like it that much. I'm wondering what the workflow is like for that when using PowerSprite?
     
    Last edited: Jun 15, 2022
  16. PowerhoofDave

    PowerhoofDave

    Joined:
    Jun 26, 2015
    Posts:
    75
    There's nothing built in specifically for that, no. We usually add an animation events like "SlideOn" and "SlideOff", and use those to switch colliders in a component. Alternateively, you can use unity's generated sprite shape to set the polygon collider shape for hit detection (though it's not very accurate, for an action game you probably want to use custom drawn collider)

    You can use both powersprite anim and unity's animator together too, btw. If you want to use both for different things.
     
    brittany likes this.
  17. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    273
    Hello Dev!

    great asset

    im using this in my game and was wondering what the best approaches for using multiple sprite images in a single animation is? The multi-sprite animator asset is buggy and before I write my own system I'd like to see if you've designed something in place I should look for in the API before I write more than I need to.

    I just want to manage a system of animations making use of a few renderers and also figure out the most optimal way of syncing multiple sprite animation of different renderers at one time, if nothing like this is built in, I guess i can just cycle through objects in a list and sync anim times and types... (seems slow)
     
  18. PowerhoofDave

    PowerhoofDave

    Joined:
    Jun 26, 2015
    Posts:
    75
    There's no features specifically for this.

    I've done a project where you could swap out sprites for various parts of characters. We had a set of master animations, and then also saved separate "part" animation images to a different folder (they were animated as separate layers in the same source file). Then in code we looked at the name of the current sprite, as set in the "master" animation, and set each part sprite based on that name. It worked fine, though if we had a lot of animations I'd probably want to write some import scripts to make the process more streamlined.

    If you actually want to have more like "skeletal" animation, there's nothing really for that though. You can attach other objects to nodes, like the gun sprite in the included sample, but it's not intended as a full skeletal anim system like spine or something.

    Hopefully that's helpful!
     
    the_unity_saga likes this.
  19. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    273
    Yes this was the system I had planned.

    It even seems Unity does it this way with image libraries and the 2D animation package. It seems like there is no way around it. Thanks.
     
  20. Sinister-Design

    Sinister-Design

    Joined:
    Sep 19, 2015
    Posts:
    66
    Hey Dave! Just gotta say, this is an amazing tool. I do have a question, though: I have hundreds of animations, and I want to be able to display them in UI Image objects. The problem is, I don't see any way to batch-edit the Animated Sprite Type setting for animations. Is there a function I'm missing somewhere--and if not, would it be possible to add support for that?
     
  21. nekolyst

    nekolyst

    Joined:
    Mar 12, 2018
    Posts:
    23
    Hi PowerhoofDave,
    I use this fix, the multiple drawing on preview was gone. But there has another issue: It has multiple drawing at first frame in timetime. Could you fix it? Thank you!

    My Unity version: 2022.2.0b13

    Snipaste_2022-11-22_12-47-18.png
     
    Last edited: Nov 24, 2022
  22. jeffkenz

    jeffkenz

    Joined:
    Apr 8, 2013
    Posts:
    22
    @PowerhoofDave i think u need update powersprite animator to compatible with new unity version there's some bug
     
  23. conigliocattivo

    conigliocattivo

    Joined:
    May 14, 2013
    Posts:
    10
    Hello everyone,
    did anyone try to integrate Powersprite Animator with the Corgi Engine?

    Thanks,
    Antonio
     
  24. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    It will be really nice to have option to have the custom animation preview material to be set...
     
  25. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    I really like the simplicity of this tool, but I'm wondering how people are using it with regards to attack animations, and hitboxes that might turn on during/throughout an animation.

    Are you just using animation events to tell the code to check for hits on a particular frame?

    What if you want a hitbox that moves/changes shapes every frame? It seems like I could probably extend this tool to be able to write out a little data file about hitbox shapes probably, but I'm curious if this is even the right path to go down in the first place. The node system this tool provides feels like a starting point, but it would need to be extended to provide size data in addition to the position data.

    I'm a little confused about how this tool is underpinned by mechanim for this in the first place, like maybe it's better to just home-brew my own 'animation' class that is just telling my SpriteRenderer which Sprite to display at which time, and where to position hitboxes.

    @PowerhoofDave any recommendations? I think I just need a nudge in a direction, or a little help seeing how to connect the dots here...thanks :)
     
  26. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    I've actually started to go down this road tonight, I've added a way in the editor window to give nodes a Size and a Type. The Types are Hitbox, Hurtbox, and Custom - for custom you can enter a string for what you want that box to be.

    There's still a couple loose ends I need to figure out here.
    1. Changing the size of the box in one frame seems to affect all frames right now.
    2. Also not sure how I want to save this data yet. Probably a separate scriptable object instead of embedding it as animation curve data makes the most sense to me.

    upload_2023-5-29_23-49-37.png
     
    Last edited: May 30, 2023
  27. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    triple post, I got this all working mostly. I went with the flow, saving the size and type data to the animation clip, and added functionality to SpriteAnimNodes for retrieving this information.

    Code (CSharp):
    1. public void LateUpdate()
    2. {
    3.     for (int i = 0; i < 3; i++)
    4.     {
    5.         if (SpriteAnimNodes.GetBox(i, out var box))
    6.         {
    7.             Debug.Log($"nodeId {i} is a {box.NodeType}. pos:{box.Position} size:{box.Size} customType:{box.CustomType}");
    8.         }
    9.     }
    10. }
    upload_2023-5-30_8-28-52.png
     
  28. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    @robochase Now I am interested, how did you actually save the data into the animation clip? Isn't that a unity object? How did you access the animation clip class to inject your custom data?
     
  29. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    the PowerSprite Animator is already saving properties in to the animation clip for the node positions; I simply copied what it was doing for node positions to also save node sizes, and node types.

    As for how you actually do this outside of PowerSprite, look at the AnimationUtility class, it has some methods for injecting stuff into AnimationClips
     
    BTStone likes this.
  30. Wyiski

    Wyiski

    Joined:
    Apr 27, 2014
    Posts:
    2

    If you use those files that you provided, it fixes the issues in the Editor however you will not be able to make a build since it creates build errors.

    upload_2023-7-31_22-17-42.png

    The 2022 fix is only good for when you're creating the game, but when you need to make a build, you will need to remove the asset and re-import the stock glitchy one so that it doesn't error out.

    I'm using Unity 2023.1.6f1
     
  31. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    So far in 2022.3.X I had no issues without any modification, just created a new 2D URP project, imported the PowerSpriteAnimator plugin as is and hit build. Worked. Wondering what the issue might be.
     
  32. Wyiski

    Wyiski

    Joined:
    Apr 27, 2014
    Posts:
    2
    In 2023.1.X it works fine without modification however in the animation preview, the animation will always have the first frame visible in the preview window (in the actual game, it works fine).

    Somewhere above, there was a file: PSA-Unity2022-Fix.zip , apparently it was meant to fix that issue. Which it did, but it introduced two new issues.

    The first issue is minor, where instead of the preview animation having the first frame always visible in the preview, it would now have frames overlapped in the first frame in the timeline of the animation. However once again, it's only a editor preview bug, in the game it works fine.

    The second issue, is a bit more major. When that fix file was applied, it would give error messages during the build process and will not let you make a build of your project. Something to do with Editor only code being included in the build but I'm sure it's just a misconfiguration in the asmdef file (but I'm too stupid to know what to change to fix it)
     
    nekolyst likes this.
  33. nekolyst

    nekolyst

    Joined:
    Mar 12, 2018
    Posts:
    23
    I'm using 2022.3.2. Change render pipeline from URP back to built-in can avoid preview overlay issue.
     
  34. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    @nekolyst But then you change it back to URP, right?
     
  35. nekolyst

    nekolyst

    Joined:
    Mar 12, 2018
    Posts:
    23
    I've test on Unity 2021.3.29, 2022.3.2 and 2023.1.7.
    It looks fine on all version of built-in render pipeline and 2021 with URP render pipeline.

    It has overlay issue on preview on 2022 and 2023:


    Affter use this fix zip: PSA-Unity2022-Fix.zip. The first preview in the timeline shows overlap images:


    Although change render pipeline to built-in can avoid this issue. But I need some URP function like pixel perfect camera...

    I've tried read the code but I don't know how to fix it.
     
    Last edited: Aug 5, 2023
    BTStone likes this.
  36. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Ah ok, well then going back to the Built In Pipeline is not a workaround, if you are on any other RP and you need to use that pipeline, than that's not a viable solution sadly :/
     
  37. SrBilyon

    SrBilyon

    Joined:
    Jul 13, 2010
    Posts:
    291
    Hey, this looks interesting! Would you be able to expand on your implementation here? Are you generating box colliders or doing some type of AABB check using the result of your GetBox?
     
  38. PowerhoofDave

    PowerhoofDave

    Joined:
    Jun 26, 2015
    Posts:
    75
    Sorry Everyone, I had trouble with my unity login and couldn't post here for a while ha ha!

    I've been slammed on my own project, and still using an older version of unity and not URP, so haven't been able to properly look at the issue myself. I have a fix from someone else that I'll try and apply once I have some time :)

    Eventually I'll have to update unity myself and have better support from that point. I'm honestly surprised its still working so well since its built to work from unity 5.3 :p (Also you'd think unity would have fixed things so this asset wouldn't even be needed any more!)

    @Wyiski Not sure about why the build would fail off the top of my head, but try deleting the asmdef files that are in that PowerSpriteAnimator folder. It was added for people that have disabled unity's UI package I think? But must have issues with v2023+. The asmdef system is super confusing to me too.
     
    Lechuza and robochase like this.
  39. zfh2773

    zfh2773

    Joined:
    Nov 16, 2019
    Posts:
    27
    @PowerhoofDave There's one thing I don't really like. The window is zoomed in and out based on the center of the picture. We want to change it to scale around the center of the window. What source code should I modify?
     
  40. Biscuitlid

    Biscuitlid

    Joined:
    Apr 1, 2013
    Posts:
    8
    @PowerhoofDave You're charging money for this, you need to add a warning to the store page that it doesn't work properly in later versions of Unity.

    It still shows the ghosted version of the first frame constantly. If you don't have time to fix it, you should take it off sale.