Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

[Released] Sprite deformer tool

Discussion in 'Works In Progress' started by medvedya2012, Dec 21, 2014.

  1. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    This tool will enable you to deform, paint, and animate your sprites, both manually from the editor and through API classes from your program. For example, using this utility, you will be able to turn one rock into a mountain ridge or create a luxuriant forest using a single tree sprite, and so on.

    There are some information
    Asset Store

    Demo version
    The demo version was not included all source code, there is DLLs. A build was created with the demo version would work only five minutes.
     
    Last edited: Jan 12, 2015
    Samuel411 and theANMATOR2b like this.
  2. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    559
    Looks great :D Won't need for my 2D game (graphics are pixel art) but I'm sure it will be really useful for others :)
    Keep up the good work!
     
  3. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    I've sent to approve :) .
     
  4. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,781
    Cool tool! May want to consider as an update a loop selection for edges and ring selection for verts to speed up the process.
    Are there additional draw calls for edited/deformed sprites?
     
  5. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    I have some plans about automatic selection, that will be done in some of next versions.

    As on count of draw calls:
    For one combination of texture with reference material there will be created one material in runtime.
    If you use one atlas for sprites and one reference material, you get one draw call, because Unity batchs these sprites.
     
    Last edited: Dec 31, 2014
  6. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    Last edited: Jan 9, 2015
    theANMATOR2b likes this.
  7. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    476
    I would like to congratulate you for this pretty native tool, all others pretty much don't work hand in hand with Unity's sprite system; I have a question: can sprtite deformer tool manipulate 2d colliders in runtime? even if not, it's still a pretty a pretty powerful package and extremely easy and fast to use.
     
  8. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    Hi. Yes It can manipulate 2d colliders in runtime but It can't set impulses to rigid bodies so it works not very well. I wanted exclude this possibility( manipulate colliders in runtime) but decided to leave it.
    You have to know it use edges for generate collides, not pixels from sprite.

    Tomorrow I'll create the demo version of this tool and you will be able to test :)
     
    Last edited: Jan 11, 2015
  9. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    I created the demo version of this tool.The demo version was not included all source code, there is DLLs. A build was created with the demo version would work only five minutes.
    Download unitypackage
     
    Last edited: Jan 12, 2015
  10. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    476
    Wow! Thank you very much; so if I buy the source code can I implement my own rigidbody impulses so it behaves more like Uni2D or not? thank you for the demo again:)
     
  11. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    if I understand you right, yes you can.
    There is the method for generate collider from source.
    Code (CSharp):
    1. public void GenerateCollider()
    2.         {
    3.             polygonCollider.pathCount = borderPaths.Count;
    4.             for (int i = 0; i < borderPaths.Count; i++)
    5.             {
    6.                 PolygonBorderPath colliderPath = borderPaths[i];
    7.                 Vector2[] cPoints = new Vector2[colliderPath.points.Length];
    8.                 for (int j = 0; j < colliderPath.points.Length; j++)
    9.                 {
    10.                     SpritePoint currentPoint = points[colliderPath.points[j]];
    11.                     cPoints[j] = SpritePositionToLocal(currentPoint.spritePosition + (Vector2)currentPoint.offset + currentPoint.colliderOffset);
    12.                 }
    13.                 polygonCollider.SetPath(i, cPoints);
    14.             }
    15.         }
    Code (CSharp):
    1.  /// <summary>
    2.         /// Polygon of border points
    3.         /// </summary>
    4.         [System.Serializable]
    5.         public class PolygonBorderPath
    6.         {
    7.             /// <summary>                
    8.             /// Indexes of points from SpriteDeformer.points
    9.             /// </summary>
    10.             public int[] points;
    11.         }
    12.         /// <summary>
    13.         /// All border paths
    14.         /// </summary>
    15.         public List<PolygonBorderPath> borderPaths = new List<PolygonBorderPath>();
     
  12. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    In future I will make possibility to automate generate topology by using pixels from sprite.
     
    Last edited: Jan 12, 2015
  13. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    476
    Awesome thnx..
     
  14. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    745
    look very interessing ! !
     
  15. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    7,014
    Will this work with Puppet 2D system and/or Smoothmoves ?

    Looks very cool, if they can work together would be great.
     
  16. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    I don't know.
    It uses meshrenderer and meshFilter as base. Structure values for animation.
    You can try the demo version with Puppet 2D system and/or Smoothmoves for test.
     
    nasos_333 likes this.
  17. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    7,014
    Thanks, i will check it out.
     
  18. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    There had several bugs, but nobody from purchasers have not say to me.

    I updated this tool, fixed some bugs and added component for blend shape animation.

    Requires Unity 5.0.0 or higher.

    Does anyone use unity 4.6, yet?
    If you use 4.6 and use this plugin please tell me.
    If you have any problems with this plugin please tell me.
    My email is modernup@mail.ru
     
    Last edited: Mar 12, 2015
  19. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Bought the plugin, it's handy to deform a sprite. However I find it's limited to deform a sprite freely because working with mesh topology and animating the mesh point is really not design-friendly. If you could refer to the Puppet Warp tool in Photoshop and make it part of your plugin, I think it'll be awesome.

    Feature request:
    1. Multi select and edit topology points
    2. clear topology all by a button click
    3. automatically generate mesh topology for alpha-sprite, like Puppet Warp tool for Photoshop,

    4. add pin point to deform mesh, again like Puppet Warp tool for Photoshop,
     

    Attached Files:

    theANMATOR2b likes this.
  20. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    Hi,
    Thank you for your request.
    I'm really glad to have got feedback :).
    I will make items 1 and 2 in next version. But Puppet Warp is really hard for realisation. I can't find the way to get pixels from texture in editor(without read/write enabled in texture property) to create topology.
     
  21. Aentropy

    Aentropy

    Joined:
    Dec 26, 2014
    Posts:
    6
    Thank you for the tool, it works very well.

    I was wondering, is there a way to animate a sprite using Sprite Deformer Animation and then have that sprite work with either Unity's Particle system or Particle Playground? Both use either Sprites/Materials or Meshes for particles, but as far as I can tell, there is no way to pass the dynamic mesh that is created by the Sprite Deformer tool to the Particle System. Any ideas? This would be a nice and useful feature to have if it can be figured.
     
  22. TanteDante

    TanteDante

    Joined:
    Oct 28, 2014
    Posts:
    6
  23. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    Hi.
    You can use custom material with custom shader. But you should to know that you will need to create materials for each texture(atlas or single sprite) in your case.
    Normals of vertexes is set Vector3.forward by default. You may only replace this value in source code.
    Full source code is included. Code not very good but not very bad :).
    Main class http://pastebin.com/jXSjNvU8 as an example.
     
  24. Ylor

    Ylor

    Joined:
    Dec 15, 2014
    Posts:
    15
    Hi!

    I've tried out your tool for a bit now and I think it will work well with my game! I have one question, however:

    With your tool it's possible to paint single points in different colors. Can I do this also through script?

    I tried the following:
    Code (CSharp):
    1. foreach (SpritePoint point in spriteDeformer.points)
    2.     {
    3.     point.color = Color.red;
    4.     }
    5.  
    6. spriteDeformer.dirty_color = true;
    But it didn't work. I managed to make the whole sprite change color using your example script "EXAMPLE_modify_material", but is it also possible to change every vertex individually?

    Best regards,
    Rasmus
     
    Last edited: Sep 7, 2015
  25. Fufla

    Fufla

    Joined:
    Mar 19, 2014
    Posts:
    1
    in
    letter C is typo - possibly russian S - breaks compiling on iOS
     
  26. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    Hi
    Your code must works. Please show me the full script.
    You can see EXAMPLE_createSpriteDeformer. There one point is painting.
    http://pastebin.com/sjKSpG8h
     
  27. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    Thanks. It will be fixed.
    At the moment you may rename this letter by Refactor in VS or MonoDev.
     
  28. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
  29. erran-liu

    erran-liu

    Joined:
    May 13, 2013
    Posts:
    10
    hi medvedya,

    When I use the spriteDeformer in my game, it takes a lots of extra drawcall. There's almost one extra drawcall for every spriteDeformer.

    I use almost because sometime spriteDeformer's drawcall can be optimized, its depends on the sort layers.
    QQ截图20151009123652.png

    I use lot's of Sprite2D and 16 spriteDeformers, it takes 29 drawcalls, when I disable all spriteDeformers, it only takes 4 drawcalls, seem like spriteDeformers can't be batched well.
     
  30. medvedya2012

    medvedya2012

    Joined:
    May 27, 2014
    Posts:
    41
    Hi
    It uses Unity patching system. If you use one atlas for two or more sprites they shoud be patched, without dependence of sort layers.
    Do you see there?
    Pics.PNG
     
    Last edited: Oct 11, 2015
  31. mihakinova

    mihakinova

    Joined:
    Jan 6, 2015
    Posts:
    85
    I'm having some problems with the asset:

    While editing the topology in throws out random out of bounds exceptions half of the time.
    When you add more points than it can handle (apparently), it will totally mess up the mesh.
    The bottom left point is practically impossible to reach when creating a fresh topology, very annoying.
     
  32. krys65

    krys65

    Joined:
    Jun 28, 2013
    Posts:
    10
    I have buy your plug but i have a standard shader on my sprite. I put the modified script (Vector3.forward) but my sprite is dark. Can you make a tutorial for have the good result ? thx
     
  33. noanoa

    noanoa

    Joined:
    Apr 17, 2014
    Posts:
    212
    I've been using Free trial version and so far it's great. One thing I've noticed is that each SpriteDeformerAnimation.Update() generates small GC per frame. Could it be fixed?
     
  34. Milo_del_mal

    Milo_del_mal

    Joined:
    Jan 27, 2013
    Posts:
    38
    Is this compatible with 2D Toolkit.
     
  35. vicenterusso

    vicenterusso

    Joined:
    Jan 8, 2013
    Posts:
    129
    This asset is not compatible with native Sprite Packer, can you do something about it, @medvedya2012 ?
     
  36. leandro_trick

    leandro_trick

    Joined:
    Oct 29, 2014
    Posts:
    6
    Hi Medveya,I'm interested in buying the sprite deforming tool to use with unity 5.5.I integrated the demo version and works great, but I keep getting this exception:

    KeyNotFoundException: The given key was not present in the dictionary.
    System.Collections.Generic.Dictionary`2[UnityEngine.Texture,Medvedya.SpriteDeformerTools.BaseOfMaterials+TextureBaseElement].get_Item (UnityEngine.Texture key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
    Medvedya.SpriteDeformerTools.BaseOfMaterials.IDestory (UnityEngine.Material refMaterial, UnityEngine.Texture texture) (at Assets/SpriteDeformerTool/code/BaseOfMaterials.cs:56)
    Medvedya.SpriteDeformerTools.SpriteDeformerWithBaseOfMaterial.OnDestroy () (at Assets/SpriteDeformerTool/code/SpriteDeformerWithBaseOfMaterial.cs:123)
    Medvedya.SpriteDeformerTools.SpriteDeformerStatic.OnDestroy () (at Assets/SpriteDeformerTool/code/SpriteDeformerStatic.cs:16)
    And I can't debug it since it's in the dll. I wanted to make sure that if I buy the full version this won't happen. Also, how's support for Windows Phone? Thanks!
     
  37. diegzumillo

    diegzumillo

    Joined:
    Jul 26, 2010
    Posts:
    367
    Hey, just wondering if this supports frame animation, with a sprite sheet.
     
  38. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    159
    Do you hear crickets? I hear crickets.
     
    alexanderameye likes this.
  39. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    159
    Is this thing still being supported?
     
  40. smetzzz

    smetzzz

    Joined:
    Mar 24, 2014
    Posts:
    131
    Would love to buy this but want to make sure it would be supported for Unity3D 2017 coming out soon.
     
  41. ayushsingla991

    ayushsingla991

    Joined:
    Oct 1, 2016
    Posts:
    11
    Hi
    I created my whole animation using demo version and forgot to use the pro version. Can I upgrade to pro version without loosing any data?
     
  42. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    199
    Hi there.. getting a heap of warnings from your plugin. The APi methods for drawing handles are all out of date. I'm not sure if I've got the added event argument set correctly, but took a stab it's Repaint. I've hacked my copy to fix this, but a fix would be greatly appreciated. There's a dozen warnings or more. It's mostly just changes from:
    Code (CSharp):
    1. Handles.DotCap(0, item, owner.rotation, HandleUtility.GetHandleSize(item) * 0.05f);
    to:
    Code (CSharp):
    1. Handles.DotHandleCap(0, item, owner.rotation, HandleUtility.GetHandleSize(item) * 0.05f, EventType.Repaint);
     
    Tapitone74 likes this.
  43. Tapitone74

    Tapitone74

    Joined:
    Sep 20, 2014
    Posts:
    3
    Congratulations for this fantastic asset!
    It's ok with "normal" type of sprites.
    but... there is a way to deform sliced and tiled sprites in new Draw modes?
     
  44. Tapitone74

    Tapitone74

    Joined:
    Sep 20, 2014
    Posts:
    3
    Hi!
    It's possible to deform also tiled and sliced sprites?
     
  45. Anflo

    Anflo

    Joined:
    Dec 3, 2014
    Posts:
    17
    HI,
    Can I use this asset for uGui and have animations as part of the UI inside a Canvas? Or is it only for Sprites outside the canvas.

    Kind reagards