Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

LeanTween Editor - Released!

Discussion in 'Assets and Asset Store' started by dentedpixel, Jul 16, 2013.

  1. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    LeanTween now supports animation along Bezier curves, and this editor gives you a visual system in which to create them!

    Create one Bezier curve or a complex set of Bezier curves. Get started quickly using the easy path creator, which allows you to create many different types of paths with customizable values such as: rounded squares, snakes, circles, and random paths.

    Animating along bezier curves comes in handy in many situations, such as creating a simple waypoint system, animating bullets or other projectiles, vehicle simulation paths.

    Complete C# and Javascript examples included!

    Asset Store Link

    $ScreenShot1.jpg

    $ScreenShot2.jpg

    $ScreenShot3.jpg

    Hopefully this will be just the start of helpful editor components I can provide for LeanTween. At the moment this seems like the most important piece to add, but I am open to suggestions for additional Visual helpers to add to this set.
     
  2. spartan

    spartan

    Joined:
    Mar 10, 2010
    Posts:
    174
  3. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    An update has been made to the LeanTween Editor. The editor has been made simpler to work with the node points of the curves, you can now rotate scale and move the created curve much like you can any other Unity game object in the editor.

    Please note if you are already using the editor there are some changes you will have to make with your code to use this new update. These changes are relatively minimal and are outlined here: http://forum.unity3d.com/threads/199634-LeanTween-Editor-Update-Notes
     
  4. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    A new version of LeanTween Editor is being released that supports the new LeanTween 2.0. This system will be only based on the C# plugin, so users who don't want to re-make their curves on a current project, it is best to continue using LeanTween 1.1 (also included in a zipped up version, from the asset store).
     
  5. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    A new version is available that updates the code to work with the new LeanTween 2.0 style.

    New features planned soon! Get the editor now, before the price goes up...
     
  6. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Hi, any information what features are planned?
     
  7. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi Sloopidoopi,
    The new features are out! It includes a new Visual Editor, for making tweens:
    $f84b59c3-b9f3-4e6c-98ab-89a2388c6d05_scaled.jpg

    You can see a video of it in action here:



    I want to thank Tony at Trinnovations for getting this wonderful visual edtior started!

    Next for future updates I am planning on adding support for Catmull Splines, and adding more to the Visual Editor...
     
    Last edited: Jan 29, 2014
  8. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Looks great!
    Is it possible to mix the visual setup with code? I mean starting and stopping tweens via code but do the setup with the editor?
     
  9. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Thanks! Yes you can have it start the group of tweens on enable. So just activate enable with code, and the grouping of tweens will start.

    I have also thought of maybe adding a way to copy and paste the resulting code... so you can go use it as a starter, and than you would have more control of the specifics by using the generated code. But I have not done that yet, let me know if that sounds appealing though...
     
  10. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    This would be a great feature!! With such a solution you have the best from both worlds.
     
  11. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,457
    Great project,

    I would like to have an in-game animation editor. Is this possible ?

    Cheers.
     
  12. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
  13. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,457
    Sorry I wasn't very clear.

    What I meant to ask is an in-game tweening editor. Something like your LeanTween Editor for run time. What could also work is exposing the core functionality of the LeanTween Editor so that developers can use the API during game play.
     
    Last edited: Jan 31, 2014
  14. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Ahh, now I gotcha. Yeah that should totally be possible. You could build the tweens in much the same way as the Visual Editor does, just doing in it during runtime.
     
  15. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,457
    Cool, does LeanTween Editor have a run time API ?
     
  16. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    It would be the same as the normal API. Here is a snippet from the LeanTween Editor, which basically shows how it is constructing a new LeanTween action based on inputs:

    PHP:

    LTDescr tween
    ;
                        
    float delay item.delay group.delay overallDelay;
                        if(
    item.action == TweenAction.ALPHA)
                        {
                            
    tween LeanTween.alpha(gameObjectitem.to.xitem.duration);
                        }
                        else if(
    item.action == TweenAction.ALPHA_VERTEX)
                        {
                            
    tween LeanTween.alphaVertex(gameObjectitem.to.xitem.duration);
                        }
                        else if(
    item.action == TweenAction.MOVE)
                        {
                            
    tween LeanTween.move(gameObjectitem.toitem.duration);
                        }

    ... 
    some actions taken out for brevity

                        
    else if(item.action == TweenAction.ROTATE_Z)
                        {
                            
    tween LeanTween.rotateZ(gameObjectitem.to.xitem.duration);
                        }
                        else if(
    item.action == TweenAction.SCALE)
                        {
                            
    tween LeanTween.scale(gameObjectitem.toitem.duration);
                        }
                        else if(
    item.action == TweenAction.SCALE_X)
                        {
                            
    tween LeanTween.scaleX(gameObjectitem.to.xitem.duration);
                        }
                        else if(
    item.action == TweenAction.SCALE_Y)
                        {
                            
    tween LeanTween.scaleY(gameObjectitem.to.xitem.duration);
                        }
                        else if(
    item.action == TweenAction.SCALE_Z)
                        {
                            
    tween LeanTween.scaleZ(gameObjectitem.to.xitem.duration);
                        }
                        else
                        {
                            
    tween null;
                            
    Debug.Log("The tween '" item.action.ToString() + " has not been implemented.");
                            break;
                        }

                        
    tween tween.setDelay(delay);
                        
    tween item.animationCurve!=null tween.setEase(item.animationCurve) : tween.setEase(item.ease);
                        if(
    item.between == LeanTweenBetween.FromTo)
                        {
                            
    tween.setFrom(item.from);
                        }

     
  17. Yuri-Kimo

    Yuri-Kimo

    Joined:
    Apr 3, 2013
    Posts:
    6
    Hi guys.

    I just bought Lean Tween Editor but I'm having a small issue. I'm get NullReferenceException when I click Reverse Path Direction.

    Here is the error log.

    NullReferenceException: Object reference not set to an instance of an object
    LeanTweenPathEditor.OnInspectorGUI () (at Assets/LeanTweenEditor/Editor/LeanTweenPathEditor.js:260)
    UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty)
    UnityEditor.DockArea:OnGUI()

    Am I doing something wrong?
     
  18. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Thanks for pointing this out Yuri Kimo, you are correct this is a bug. I have put a fix in for this, that I am submitting to the Asset Store now (I'll send you the fix directly as well).
     
  19. calebfoster

    calebfoster

    Joined:
    May 24, 2013
    Posts:
    5
    Hello,

    Is there a built-in way in Lean Tween Editor to begin tweening along a path but have it start a certain time (or ratio) offset from the beginning of the path? I haven't been able to find an easy way. Basically, do you always have to travel the length of the whole bezier path?

    Thanks
     
  20. calebfoster

    calebfoster

    Joined:
    May 24, 2013
    Posts:
    5
    Sorry, I ended up searching the source code and found it and it works perfectly!

    LTDescr.passed = time;

    Assign that property and the tween will begin there. The best tweening library, I've tried them all now!
     
    Ziplock9000 likes this.
  21. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Awesome, you beat me to the answer :)

    Thanks! I am glad you like LeanTween.
     
  22. calebfoster

    calebfoster

    Joined:
    May 24, 2013
    Posts:
    5
    Could I have the answer too?
     
  23. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Oh, like you said you should be able to just assign it like:

    PHP:
    LTDescr.passed time;
    That works right?
     
  24. calebfoster

    calebfoster

    Joined:
    May 24, 2013
    Posts:
    5
    Sorry, I must not have replied to the correct message. I was referring to the fix for Reverse Path script error.
     
  25. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hehe, now your message makes a lot more sense. I will share the updated code with you. I wish it was in the Asset Store already, but sometimes Unity can take weeks to approve updates :-/
     
  26. _mgonzalez

    _mgonzalez

    Joined:
    Jan 9, 2014
    Posts:
    5
    It would be great, if it was possible to use the editor to create the bezier tween, and then have it spit out the points required to create the animation at runtime in code.

    For example, I have a generic - 'GREAT JOB!' 3d model that I want to animate, and I would prefer to do it visually so I can craft an intricate animation involving each letter. However I would like to be able to save the output (a series of points, code snippet, whatever) - so that I can take that and place into my class and re-use at will.
     
  27. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hey MGonzalez,
    That's a good idea for an added feature, I am adding it to the next update to the Asset Store version, which I am submitting today. It may take a couple of days to get approved, but let me know if you need it sooner than that.

    Cheers,
    Russ
     
  28. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    181
    Hi,
    I would like to know if it would be possible for me to design curves with the editor that are going to be screen size independent and then apply these curves relative to the original screen position of an object?
    Thanks!
     
  29. fmarkus

    fmarkus

    Joined:
    May 22, 2010
    Posts:
    181
    I have just bought the editor and I was wondering if it would be possible to have the option of having values in z replaced by values in y in order to use this for 2D games?
    Thanks!
     
  30. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi Fmarkus,
    You can rotate the parent LeanTweenPath object to be on whatever axis you please. Rotation of x:90, y:0, z:0 should be what you need to have it along the x,y axis.

    You can also scale the parent object to accommodate different screen-sizes. You can use LeanTween.moveLocal if you want to put the curve in a containing object and then it will move relative to it's parents position...

    I hope that helps!
    Russ
     
  31. cullab

    cullab

    Joined:
    Mar 25, 2014
    Posts:
    9
    I just bought the editor and I can't seem to get the easing property to work correctly. I have a basic tween of moving a game object from one location to another. No matter what Ease type I select, the tween doesn't seem to "ease" at all. It's like it is only doing linear easing. If I select the animation curve ease type, I can define my own curve. And that does work. But then after I have created an animation curve, if I try to select a different ease type, it appears that the tween continues to use the animation curve and not the new ease type I selected.

    I've tried creating the tween using just code and I can see the ease working correctly. Is there a bug in the visual editor where the ease property isn't getting set?
     
  32. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi Cullub,
    There is indeed a bug with the visual editor where it ignores the easing. Sorry about that, there is a fix available but Unity has not approved it yet (it can sometimes take a couple of days).
     
  33. cullab

    cullab

    Joined:
    Mar 25, 2014
    Posts:
    9
    Thanks for the response. I'll be anxiously awaiting the update in the asset store.
     
  34. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    New version of the LeanTween Editor is up in the store!

    Updates Include:
    - Catmull Splines! Added an easier way to create paths with catmull splines
    - fixed a bug that ignored easing values
    - added a cinematic example
     
  35. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,741
    Hi
    Would it be possible to create a train path with this? The main issue with trains is that you have wagons, and when I move them through a tween path, they don't follow each other at the same speed. I'm looking for a system to do this, so that the train can go around curves and don't look all messed up.
     
  36. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hi Creat327,

    Yes I had this same problem with other bezier path packages, where it would speed up around certain areas of the path. This is partly why I created my own solution, the objects should all move at a constant speed along the path (unless you choose for it not to using your own methods or a easing curve).

    So I think this would make a good train system... I have it working for a car path system for one of my own projects (also included in the package)
     
  37. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,741
    I just tried but it didn't look good. I just "chained" together 3 cars, as if they were a train, then try to make them follow a path but they sling out or turn in weird ways.
    Which method do you call for them to move evently?
     
  38. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    You can just call the LeanTween.move method or update it iteratively like the included example shows. Hmm you are saying it sling out in weird ways? It sounds like your control handles for your bezier curves are not being placed right... You can also try the "Spline" path type if you don't want to deal with the tricky bezier handles (although if you are familiar with bezier curves it might be preferred).
     
  39. snarge7781

    snarge7781

    Joined:
    May 13, 2013
    Posts:
    4
    Hey dentedpixel, just bought the visual editor for leantween and I'm liking it a lot. I have a question though:

    Is there a way to do MoveCurve in reverse? What I want to do is have a character move to the end of it's path, and then have another tween using the same path and move him back to the start (and loop like that ).
     
  40. mcunha98

    mcunha98

    Joined:
    Jun 13, 2010
    Posts:
    261
    Someone can help me and explain how use the LeanTween.Move with a list of vectors?

    Code (CSharp):
    1. LeanTween.move(gameObject, new Vector3{Vector3(0f,0f,0f),Vector3(1f,0f,0f),Vector3(1f,0f,0f),Vector3(1f,0f,1f)}, 1.5f, optional);
    I try a lot of ways, but the parameter expect is a vector and not a list of vectors !?!

    I saw the documentation at http://dentedpixel.com/archived/LeanTween1Documentation/classes/LeanTween.html but the examples don't work when I need to use a list of vectors.
     
  41. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hey Snarge,

    I think the best way for you to do this would be to set the loop to Ping Pong so it would have this behavior built in. That would be done something like this:

    Code (CSharp):
    1. LeanTween.moveSpline( gameObject, spline, 1.0f).setLoopPingPong().setRepeat(2);
    You could also reverse the array of a spline to do it manually, but I thin the ping pong idea will be much cleaner and easier.

    I am glad you are liking it! :)
     
  42. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hey Mcunha,

    Somehow you got a link to the old Documentation (that I have kept up in-case people are still using the now mostly deprecated style of passing parameters through hashtables). Here is the new documentation: http://dentedpixel.com/LeanTweenDocumentation/classes/LeanTween.html#method_LeanTween.moveSpline . You can see you can just pass a list of vectors as you would expect...

    Can I ask how you came upon the older documentation? I should make it more explicit, where-ever that link is provided...
     
  43. mcunha98

    mcunha98

    Joined:
    Jun 13, 2010
    Posts:
    261
    I got from the link your in website directly
     
  44. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    mcunha98 likes this.
  45. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    The LeanTween Editor keeps improving. With the latest installment, I have added the ability for the visual editor to output actual c# code. So you now have the ability to use the animation “out of the box” as an attached sequence, or you can cut and paste the code to wherever you wish!

    Auto-Generated C# code:




    Other NEW Features:

    Tween Color:




    Delay/Repeat Groups of Tweens:


    Other basic cleanup stuff was also included which should make the LeanTween Editor easier to support and upgrade in the future.

    Features on the Near Horizon:
    – 2d path support
    – More path shapes in the Easy Path Creator
    – Preset tween groups (like shake, or blink)
    – and more…

    Grab the latest version from the Asset Store.
     
  46. dCoding

    dCoding

    Joined:
    Sep 9, 2014
    Posts:
    26
    I'm still using Unity 3.5.7 (as I have a Pro licence for it, and can't afford the upgrade at the moment), and just purchased LeanTween Editor today (which needs 4.3.4+), on the hope that I could somehow still use the new Auto-Generated C# option.

    The good news is that, with a bit of messing about, I got the Easy Path Creator (including path editing and C# code generation) working! The Visual Editor doesn't work, but I assume that is because I am using the old version of Unity.

    I'm very much looking forward to the above mentioned update, especially as I am using LeanTween with a 2D project.

    I know it's a big ask, but would there be any way the Editor could work "out of the box" with version 3.5.7, the same as LeanTween itself?
     
  47. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    I originally wanted to support 3.5+ out of the box, but there were some features that I could only get in 4.3 and above. I actually can't recall what they were. I will dig around to see if I can job my memory. Maybe there is someway I can do an #ifdef check and just leave out the 4.3 features...

    LeanTween itself should still work in 3.5. That's actually where I do most of my testing.

    Unfortunately the 2d features will really be targeted towards 4.3 and above, but it might still apply to your game :-/
     
  48. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Hi,
    is there a way to move the control points from a bezier path like in other bezier tools where you have a smooth curve when you move one handle (so that the other handle from a control point is moved in the opposite direction)? Right now it seems that I only have handles like corner points in Adobe Illustrator.

    Another option in the Lean Tween Visual Editor would be useful: Some sort of auto-adjust mode for the delay of the tweens in a group. When I create a complex tween group and I change the duration of one tween, I have to adjust all later tweens by hand . (Option like 'play after previous tween' that auto adjusts the delay?).
     
  49. dentedpixel

    dentedpixel

    Joined:
    Jul 15, 2012
    Posts:
    683
    Hey Sloopi,
    I am not sure I understand the bezier functionality you are looking for. I am most familiar with Adobe's bezier, that's why I tried to make if function like those (grabbing the corner point will also move the control points). Is there a product that you can point to that does it this way? That might help me wrap my head around the request.

    I can definitely see what you mean about it getting annoying adjusting all the previous tweens. I was investigating something like Flash's timeline view, so you could grab and slide multiple tweens at a time. That might be kind of time-consuming to build out, but very neat. I'll try to think if I can come up with a more immediate solution like you mentioned in the interim.
     
  50. dCoding

    dCoding

    Joined:
    Sep 9, 2014
    Posts:
    26
    Thanks for the fast reply.

    If there could be a version of the Editor that works on 3.5+, without causing you too much grief, that would be much appreciated. In the meantime I'm very glad that LeanTween itself works so well.

    If the 2D features are for 4.3+ then that's fair enough, but hopefully I can still take advantage of the extra path shapes in Easy Path Creator. In case anyone is interested, I only had to change one line of code (line 175) in LeanTweenPath.cs to get it to compile in 3.5.7:

    pts.gameObject.SetActive(false);

    to

    pts.gameObject.active = false;