Search Unity

FlexiMotion - high performance procedural animation for flexible objects

Discussion in 'Assets and Asset Store' started by Kybernetik, Jan 8, 2023.

  1. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    title.png
    FlexiMotion
    is a high performance procedural animation system which simulates physics for flexible objects such as hair, clothing, tails, and tentacles.

    FlexiMotion.gif

    Download the Free Editor-Only Demo to see it in action.

    Features:

    Performance is significantly better than competing plugins. Test it yourself with the included Benchmark.

    Setup is a breeze with powerful editor tools, no scripting required.

    Customize the desired behaviour with simple Modifiers.

    Source code is included and well documented.

    Supports all platforms, all rendering pipelines, and all animation systems: Animancer, Animator Controllers, Legacy, or any other method of moving your objects.

    Feel free to post any questions or suggestions in this thread. The Help and FAQ page also lists various other contact methods.
     
    Last edited: Jan 9, 2023
  2. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    Hi, I added a line of tail bones to a FlexiMotion component and I don't see any changes in behaviour. It is bad that they're already animated?
     
  3. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Being animated shouldn't be a problem.

    Can you show some screenshots of the FlexiMotion Inspector and the Edit window?
     
  4. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    I'm pretty much just doing the standard stuff, nothing fancy.

    Screenshot_1.jpg
     
  5. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    That looks fine, what does your Inspector look like?
     
  6. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
  7. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    That looks fine too. Have you tried it on any other model? Or different parts of that model? Do the sample scenes work properly?
     
  8. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    Indeed, not even the sample scenes work. (It's also unfortunate that the materials are not converted by the automatic Builtin->URP converter.)

    [EDIT] Interesting - the samples works now, after restarting Unity. o_O I will test further. Sorry for my stupidity.
     

    Attached Files:

    Last edited: Feb 14, 2023
    hopeful likes this.
  9. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I wonder if the URP material converter doesn't run because everything is in the Packages folder instead of Assets. Will it convert them if you move them into the Assets folder?
     
  10. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I finally finished making a proper trailer video for FlexiMotion.
     
    DragonCoder likes this.
  11. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    Is it possible to set up a character on runtime by script?
     
  12. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I haven't tested it extensively but you should be able to just make a new FlexiMotionDefinition, fill its Springs, and assign it to the FlexiMotion.Definition property when it's ready (or whenever you modify it).
     
    ratking likes this.
  13. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    FlexiMotion v1.1 is now available. Other than a few fixes, the main change is that the core
    FlexiMotion
    component has been renamed to
    FlexiMotionComponent
    because having the same name as its namespace was causing referencing issues.
     
  14. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    It works, but only if I create the FlexiMotionDefinition like this:

    Screenshot_1.jpg

    Otherwise I get sveral NullRef errors. This way's a bit verbose and unintuitive, would be cool if this could be shorter.
     
  15. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I'll have a look at making a builder class for the next version.
     
  16. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    FlexiMotion v1.2 is now available. I've added builder classes for more efficiently setting up definitions in scripts and also fixed the issue @ratking was having where the arrays needed to be manually initialized before it would let you add anything.
     
    ratking likes this.
  17. icauroboros

    icauroboros

    Joined:
    Apr 30, 2021
    Posts:
    165
    While testing demo I found out that pressing apply on bone select ui crashing unity 2022.2.14. but no issue with sample scene.
     
  18. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Looks like a Unity bug. It crashes when attempting to invoke a method with reflection for some reason (it finds the method, but crashes before running any of the code in it). I've reported the bug to Unity and uploaded FlexiMotion v1.2.1 with a workaround.
     
    icauroboros likes this.
  19. icauroboros

    icauroboros

    Joined:
    Apr 30, 2021
    Posts:
    165
    Thanks for the fix. Not much urgent but there is another issue , system not working after first play if domain reload disabled (fast play mode option).
     
  20. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    the_unity_saga and icauroboros like this.
  21. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    268
    Hey, thanks for this amazing asset!

    is there anyway we can get a demo showcasing the setup for the hit detection reaction that you showcase for the archery training dummy?

    I'm not sure what that entails, can your asset be used with arbitrary hierarchies of transforms/physics joints (like a bunch of cubes in a chain)?

    i assume all cloth physics have to be skinned, which is fine
     
  22. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    There is no actual hit detection on the dummy, I've pre-placed each of the arrows at the destination with a script that just moves them back a certain distance on startup so they arrive in a pre-planned order. Detecting hits would be easy enough with some colliders and the hit effect is achieved with a WindModifier like in the External Forces Sample. When an arrow "hits", it just sets the
    wind.GustAcceleration = direction * force;
    then calls
    wind.StartGust();
    . The force values are quite high and the modifier's Gust Duration is 0.02 seconds so the force only lasts for one frame. The arrows also stick to the model by re-parenting their transform under the bone they hit (which is also pre-selected by me, but if you use colliders you could re-parent them to that).

    Yes, you can apply it to any hierarchy, it has no dependency on animations or skinned meshes.

    And yes, it only applies to bones so it can't do anything with an un-skinned cloth mesh.
     
    the_unity_saga likes this.
  23. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    268
    great thanks!
     
  24. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    268
    Getting a strange error on build:

    Code (CSharp):
    1. Packages\com.kybernetik.flexi-motion\Runtime\FlexiMotionComponent.cs(45,9): error CS0535: 'FlexiMotionComponent' does not implement interface member 'IOnValidate.OnValidate()'
    2.  

    Code (CSharp):
    1. #if UNITY_EDITOR
    2.  
    3. //INTERFACE MEMBER DECLARATION, looks fine
    4.  
    5. #end if
    how do i enable support for #if UNITY_EDITOR directives?
    i'm not sure why this is breaking
     
  25. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    The problem is that the #if is working correctly so at runtime the OnValidate method doesn't exist meaning that class no longer satisfies the IOnValidate interface.

    So to fix it, replace the #endif line with this:
    Code (CSharp):
    1. #else
    2.         void IOnValidate.OnValidate() { }
    3. #endif
    I'll release a new version with the fix later tonight.
     
    the_unity_saga likes this.
  26. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    the_unity_saga likes this.
  27. demimonde

    demimonde

    Joined:
    May 3, 2021
    Posts:
    27
    I bought the pro version of this after using Animancer Pro and various other assets of yours for a while. You create some absolutely stellar plugins!

    I am very excited about the performance! And I love the SimulationRootModifier, a feature I have been wanting from other similar assets for ages.

    That said, I simply cannot get this thing to produce nice looking motion. I have been using pretty much all of FlexiMotion's competitors in the past and particularly with Tail Animator and Bone Stimulator I've been able to create really great dynamic bone animations. But with FlexiMotion I can't get there. No matter what settings I use for stiffness and drag, the effect is always very glitchy, extremely exaggerated, unpredictable and unnatural looking. I'm not really sure whether I'm doing something wrong, but even after going through the entire documentation several times I cannot seem to solve this problem. I should note that I'm using this in 2d.

    Any guesses?
     
  28. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I've never tried FlexiMotion in 2D so I don't have any particular suggestions, but if you want to send a minimal reproduction project to mail@kybernetik.com.au I'd be happy to fiddle around with it and see if I can figure anything out.
     
  29. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    Hi, is it possible to use IK with this asset? Imagine a tentacle grabbing objects for example. I also need collision avoidance to be in effect during it.

    I'm doing this with Tail Animator 2 currently, but I also use Animancer and would prefer to use your plugin instead of TA.
    Also exploring alternatives since TA has some drawbacks for our use case (slow reaction while using IK etc.)
     
  30. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
  31. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Hi @Kybernetik,

    I enjoy how easy this asset is to configure, and also the Animate Physics: Update Mode is amazing!.

    Does this asset support WebGL? Any chance you could provide a WebGL Demo link before I purchase it?
     
  32. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Nothing in FlexiMotion is platform-specific and I just did a Web GL build in Unity 2022.3 which worked fine:
    upload_2023-6-14_18-59-28.png
    Having a web build available is probably a good idea, but I'd need to add a script for swapping between the example scenes and figure out how to actually upload it somewhere. That should be easy enough to do, but I'm busy with other projects at the moment so I'll have to put it on my to do list for the next version.
     
  33. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Thanks so much for the quick response, and reassurance. Sounds, good! I'm going to purchase the asset soon!! Thanks again
     
  34. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    268
    hi

    i wasn't aware of this, but your asset seemingly still works fine in 2019?
    how is this possible?
     
  35. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I've only tested and uploaded it with 2020 and 2021 so I would assume that the 2019 Package Manager wouldn't let you download it, but I don't know of any changes to the APIs it uses since 2019 so there isn't any particular reason why it wouldn't work in that version.
     
  36. Ksanone

    Ksanone

    Joined:
    Feb 7, 2015
    Posts:
    41
    Can't seem to find the window menu option. Unity 2022.3.2f1 LTS.
     
  37. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I'm not sure what menu item you're referring to. The main editor window is accessed by adding a FlexiMotionComponent to an object and clicking its Edit button.
     
    Ksanone likes this.
  38. mothjail

    mothjail

    Joined:
    May 10, 2022
    Posts:
    1
    will this override keyed bones or will the keys need to be cleared from the animation?
     
  39. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Animations can move simulated bones the same as any other kind of movement so you'd get a combination of the animation and simulation.