Search Unity

[UPDATED] Jiggle 1.1 - Automatic animation for hair, tails and everything else

Discussion in 'Assets and Asset Store' started by DuckType, Feb 17, 2018.

  1. DuckType

    DuckType

    Joined:
    Mar 21, 2015
    Posts:
    18
    Hi everyone,

    I've just released my first asset on the store. Jiggle can add secondary animation to just about anything, with as many features as I could come up with:

    - Inertia based on center-of-mass and/or rotation
    - Procedural wind & noise
    - Blend with original animation (including keyframed animation of course)
    - Control over spring strength & dampening
    - Limit animation to single axis (hinge), limit rotation by degrees, including optional configurable soft limits.



    You can find more information and the documentation here: https://ducktypesoftware.wordpress.com/

    It's my first asset on the store so if you have any questions or suggestions, please let me know!

    Thanks
    DuckType
     
    theANMATOR2b and hippocoder like this.
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    This looks like a real cool package! Nice work.
    A link directly to the pack might be a good choice for the next asset. :)

    Do you have an example of this working on a humanoid/generic rigged, player controlled character? Unity Chan or Ethan are good choices for generic examples. Robot kyle fits good for a humanoid example.

    If you are looking for suggestions on updates, if the secondary controlled joints/mesh could be affected by colliders - that would be pretty excellent. I'd pay 4x the current price, or at least the end joints. ;)
     
  3. DuckType

    DuckType

    Joined:
    Mar 21, 2015
    Posts:
    18
    Thanks so much for the feedback! And thanks for posting the link, I completely forgot :)

    I'll work on getting an example with a player-controlled character, that's a really good idea. I guess that's what most people would use Jiggle for so it'd be great if they can see it in action.

    I've been working on getting Jiggle to interact nicely with Unity's physics system, but it's pretty tricky. Rigidbodies don't really like being told how to move, and chains of objects cause all kinds of weird and wonderful problems. It's mostly collision being pushed through other collision which makes the RBDs jitter like crazy. I built Jiggle custom so I could add lots of different features and focus on making it produce pretty, artist-friendly results, but yea getting it to collide is still on my to-do list. It's a tough problem to solve unfortunately.
     
    theANMATOR2b likes this.
  4. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Glad you are looking at this. I went ahead and picked it up anyway - I can see several instances where it could save me many hours in animation time. Worth the price! :)

    I understand the issues with interacting/colliding. Would limiting the collision only to the 'end' chain/joint simplify the problems encountered with attempting to get a chain of joints to collide believably? Either way - nice pack! I'm working on a 2D game at the moment - so it'll be a couple more months until I get back into 3D to push jiggle through it's paces.
     
  5. DuckType

    DuckType

    Joined:
    Mar 21, 2015
    Posts:
    18
    Thanks, I'm glad you ilke it :)

    Let me know how you go when you try it out, I'd love to get some feedback. In the meantime I'll keep trying with the physics support.

    Limiting it to the end chain would address a lot of issues, not all though. I guess if the rest of the chain passed through collision then the end bit would just get stopped on the collision surface. That would probably look weird in some cases.
     
  6. DuckType

    DuckType

    Joined:
    Mar 21, 2015
    Posts:
    18
    Hi everyone,

    it's been brought to my attention that there's a bug in Jiggle when you're trying to build the game for an external platform (File -> Build & Run). If you've been getting compile errors involving UnityEditor this is why.

    I'll submit a new version to the store with a fix, but it usually takes a few weeks to go through. In the meantime there's a quick and easy workaround for the problem. There's 2 steps:

    1)
    In the Jiggle.cs file, at the top of the file, remove the line "using UnityEditor;". it's not actually needed.

    2)
    Take the JiggleEditor.cs file and move it to Assets\Editor\. If that folder doesn't exist you can just make it. This removes Jiggle's custom UI from the files that Unity tries to include in the game, because it's not needed there.

    I've also made a little guide to sum up the 2 steps:
    jiggle_bug001.jpg
    Sorry for the trouble, and thanks for reporting this bug! :)
     
  7. DuckType

    DuckType

    Joined:
    Mar 21, 2015
    Posts:
    18
    Hi everyone,

    I just wanted to give you a heads up that I've uploaded an Update to Jiggle 1.1! Changes include:

    - A better way of dealing with the editor scripts issue (see previous post)

    - A QuickStart guide that will hopefully make it easier for you to set up your first Jiggle

    - By popular demand: An experimental option that lets Jiggle run during Unity's physics update, instead of the frame render step. While unfortunately that doesn't mean that Jiggle can now collide with physics objects, it does mean that any Jiggle objects that are attached to physics objects will behave much nicer. This should sort out any leftover jittery problems.


    And lastly, many many thanks to everyone who got in contact with me to report problems and make suggestions. I try very hard to respond as quickly as possible and I really appreciate the time everyone's put into making Jiggle a better script. So if you've got any questions, ideas, or your Jiggle just won't behave the way you want it to, please get in touch! :)

    Thank you!
    DuckType
     
  8. DuckType

    DuckType

    Joined:
    Mar 21, 2015
    Posts:
    18
    Hi everyone,

    I've updated Jiggle with a few very minor fixes, they're live now on the asset store:

    - You no longer have to move the JiggleEditor.cs script to the editor folder manually. It'll be there right away when you install the package. Thanks GG for the tip, I completely missed how to do this in the docs!

    - You will no longer get those annoying compiler warnings about the JiggleEditor. Hooray!
     
  9. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    374
    Is the source code included with this? Can you go into more detail about the physics sim you're performing and how expensive it is? IE is it verlet integration?
     
  10. DuckType

    DuckType

    Joined:
    Mar 21, 2015
    Posts:
    18
    Oh wow, I had to look up Verlet Integration! So I guess the answer is no, it's not Verlet Integration :p

    Jiggle performs a very cheap pseudo-physics sim that works outside Unity's own physics system. You won't get collisions but you should get several hundred Jiggles running smoothly. In performing its sim step it very much works on the artist principle of "if it looks really really pretty then it must be good".

    Jiggle works by affecting the rotation of the transform it's attached to. To do that it generates torque from several inputs:

    - relative world-space motion of the transform to the center-of-mass defined in Jiggle (think of it like a pendulum that swings when you move it sideways)

    - world-space rotation of the transform itself (including rotation of its parent or existing animation)

    - gravity (by dragging the end of the pendulum down)

    - noise (by randomly pulling the pendulum)

    There's also optional soft and hard limits to how far it's allowed to rotate, and you can blend everything with existing animation. So you can for example have a character with animated hair and Jiggle will add some extra motion on top without destroying your animators' hard work.


    And yes, the source code is included. No fancy-pants assemblies here, just straight-up C# code that you can edit to suit your project.

    I hope that gives you a good overview, let me know if you've got any more questions :)
     
  11. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    374
    Great info thanks. Another Q: Is the sim time independant? IE can I disable the sim calculations whilst the object is culled and re-enable later and have it be at the correct position instead of the last position calculated?
     
  12. DuckType

    DuckType

    Joined:
    Mar 21, 2015
    Posts:
    18
    Yes it's time-dependent in that way. It only affects rotation though so that would be easy to reset when you re-enable. Jiggle's internal torque would still exist and would carry over to when Jiggle get re-enabled, but I could just expose a function to reset or set it.

    When you re-enable Jiggle you could then:
    - reset the rotation to something that makes sense depending on what you're jiggling (e.g. a character's animation pose)
    - reset Jiggle's torque