Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Mesh Animator - Highly efficient animated crowds, fully animated GPU instancing, and more!

Discussion in 'Assets and Asset Store' started by jschieck, Dec 7, 2014.

  1. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    I intend to publicly release it before July 13th. If you would like to join an early test beta program, email or PM me directly.
     
    JBR-games likes this.
  2. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    96
    Dear,
    I found that enabled "Pre Generate Frames" for animation will eat much more memory.
    Does "Pre Generate Frames" provide more FPS?
     
  3. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    96
    How to recycle memory?
    It looks like even I destroyed the gameobject, the memory won't be release yet.
     
  4. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    This setting generates all frames for the animation. With it turned off, frames are generated as they are needed. It will preallocate memory for the frames, but not provide much FPS boost

    Are you using crossfade? I have a fix for this available in the new 2.0 version(July 13th release), but can send you an updated script if you cannot wait for the release.
     
  5. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    96
    Thanks for your quickly reply.
    No crossfade there.
    Glad you fixed the issue^^.
     
  6. Jon_Brant

    Jon_Brant

    Joined:
    Mar 22, 2018
    Posts:
    55
    I was looking to buy this asset, but no forum activity in 4 years. Does anyone know if this still works?
     
  7. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    Yup still works! The forum post was created 4 years ago... But there's 12 pages of activity since then??
     
    Jon_Brant likes this.
  8. Jon_Brant

    Jon_Brant

    Joined:
    Mar 22, 2018
    Posts:
    55
    Hum. Maybe I wasn't on the last page like I thought I was. Last post is different. Thanks

    Happen to know if it's working in 2019.4?
     
  9. Jon_Brant

    Jon_Brant

    Joined:
    Mar 22, 2018
    Posts:
    55
    So I picked it up. I was able to bake a mesh for testing. I made a test scene that spawns the prefab over a grid. I have two problems. 1) The character is black, mostly. I can see some color flicker in occasionally but that doesn't look right either 2) All of the prefabs appear in the same position.

    The docs don't mention either of these. Any ideas? I'm using Synty's low poly characters, not sure if that makes a difference. Tripled my FPS, now if only I could get them looking right.

    These are the settings I used: upload_2020-7-5_22-56-49.png

    And the result:
    upload_2020-7-5_22-57-11.png
     
    Last edited: Jul 6, 2020
  10. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    I'm not familiar with those assets, but if it's all black it sounds like a material didn't get assigned correctly. Or more likely, does that mesh/asset use vertex colors to color the mesh? It may not have copied them correctly
     
  11. Jon_Brant

    Jon_Brant

    Joined:
    Mar 22, 2018
    Posts:
    55
    I have no idea about the vertex colors thing. Not sure how to check that. I'll start digging though
    Thanks
     
  12. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    96
    looks like the MA2.0 will comes after two days. Please add the HDRP lit shader for HDRP project.
    can't waiting...
     
  13. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    Very excited to announce Mesh Animator 2.0 has been submitted to the asset store!

    This includes new documentation, and a new walk through video showing some of the new features and example scenes.

     
    hopeful likes this.
  14. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    96
    o_O I thought I could download it today.
    So, how long does the asset store review would take?
     
  15. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    It is now live! You should see 2.0 in the asset store
     
  16. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    96
    Hi, I've got the 2.0 and run it for my project.
    I have 2 issues here.
    1、 when I enabled Fast Normal Calculation the charactor shows as this:
    upload_2020-7-14_13-24-0.png the origin : upload_2020-7-14_13-25-39.png


    2、 the expose transforms looks like not work.
    upload_2020-7-14_13-28-59.png

    Could you please help?
     
  17. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    96
    If I disabled the Fast Normal Calculation , I got this:
    upload_2020-7-14_13-32-43.png
     
  18. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    I will release fixes today for these issues
     
  19. Jon_Brant

    Jon_Brant

    Joined:
    Mar 22, 2018
    Posts:
    55
    Nice. 2.0 fixed the issue I was having earlier. Now to figure out how to animate these. 10k on screen at 25 FPS is nuts

    Edit: Done. I am VERY impressed
     
    Last edited: Jul 14, 2020
  20. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    42
    Hi, the new version looks good, but it breaks my MA stuff. Even rebaking doesn't make shader technique to work.. What would be the best transition method?
     
  21. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    It's very likely upgrading meshes from an older version won't work. What exactly is happening when you re-bake in shader mode? Have you also changed your materials to use the shaders included? Or converted one of your own shaders?
     
  22. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    42
    Whoops, forgot about changing materials. Will try again and I hope it won't be too difficult to transition from the previous version.
     
  23. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    42
    Managed to make tree move but for some reason, editor becomes extremely laggy and getting errors:

    IndexOutOfRangeException: Index was outside the bounds of the array.
    FSG.MeshAnimator.ShaderAnimated.ShaderMeshAnimator.SetupTextureData () (at Assets/MeshAnimator/Scripts/ShaderAnimated/ShaderMeshAnimator.cs:239)
    FSG.MeshAnimator.ShaderAnimated.ShaderMeshAnimator.Start () (at Assets/MeshAnimator/Scripts/ShaderAnimated/ShaderMeshAnimator.cs:63)

    IndexOutOfRangeException: Index was outside the bounds of the array.
    FSG.MeshAnimator.ShaderAnimated.ShaderMeshAnimator.SetupTextureData () (at Assets/MeshAnimator/Scripts/ShaderAnimated/ShaderMeshAnimator.cs:239)
    FSG.MeshAnimator.ShaderAnimated.ShaderMeshAnimator.OnEnable () (at Assets/MeshAnimator/Scripts/ShaderAnimated/ShaderMeshAnimator.cs:58)

    Really excited to use the new version as my project contains a lot of MA flora
     
  24. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    The only way that would happen is if there aren't any animation textures in your baked animations. If you look at the MeshAnimation asset, does it have a drop-down next to it to view it's child textures?
     
  25. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    42
    Don't remember seeing any. It might be because I want everything to stay as it were. If I drag freshly baked asset everything might be as it should but I want to save lots of hours by not placing everything again in my scene.

    Can I simply add what's missing to my existing MA prefabs?

    By the way, the component on MA objects changed to the new one smoothly, nice :)
     
    Last edited: Jul 14, 2020
  26. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    42
    I've changed shader to MA standard, the object looks good and animates but those errors appear and editor becomes unusably laggy. Can't find textures. I tried deleting old baked AnimatedMesh together with animation and baking again and can't find textures dropdown anywhere either.

    One more:

    NullReferenceException: Object reference not set to an instance of an object
    FSG.MeshAnimator.MeshAnimatorBase.OnEnable () (at Assets/MeshAnimator/Scripts/Common/Core/MeshAnimatorBase.cs:163)
    FSG.MeshAnimator.ShaderAnimated.ShaderMeshAnimator.OnEnable () (at Assets/MeshAnimator/Scripts/ShaderAnimated/ShaderMeshAnimator.cs:57)
     
  27. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    Can you PM or email one of the assets you're trying to bake? I can investigate further
     
  28. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    42
    Sure, thanks.
     
  29. niflying

    niflying

    Joined:
    Jul 11, 2012
    Posts:
    96
    When can we get the shader animator for HDRP?
     
  30. noahx

    noahx

    Joined:
    Nov 22, 2010
    Posts:
    56
    Hi. I upgraded my project to use the new version (2.0) but I'm getting a lot of errors and I have no idea where to start with. I deleted the whole folder of the old version (MeshAnimator folder) to start fresh. I re-baked all the animations for all the units/prefabs. But once I start playing the animations, it starts tho throw a lot of warnings, and once the warnings are thrown to the console, the animations are no longer playing and they freeze in whatever frame they were at.

    It is fair to say, that my project didn't throw any warnings/errors before switching to MeshAnimator 2.0
    I'm using Unity 2018.4.22f1

    Here's what it throws to the console:

    (Filename: C:\buildslave\unity\build\Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 537)

    To Debug, enable the define: TLA_DEBUG_STACK_LEAK in ThreadsafeLinearAllocator.cpp. This will output the callstacks of the leaked allocations
    (Filename: C:\buildslave\unity\build\Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 539)

    Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 5)
    (Filename: C:\buildslave\unity\build\Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 311)

    Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 5)
    Unity.Jobs.JobHandle:ScheduleBatchedJobsAndComplete(JobHandle&)
    Unity.Jobs.JobHandle:Complete() (at C:\buildslave\unity\build\Runtime\Jobs\ScriptBindings\JobHandle.bindings.cs:20)
    FSG.MeshAnimator.Snapshot.CrossfadeJobData:ReturnFrame() (at Assets\MeshAnimator\Scripts\Snapshot\SnapshotMeshAnimator.cs:187)
    FSG.MeshAnimator.Snapshot.CrossfadeJobData:Reset() (at Assets\MeshAnimator\Scripts\Snapshot\SnapshotMeshAnimator.cs:109)
    FSG.MeshAnimator.Snapshot.SnapshotMeshAnimator:Crossfade(Int32, Single) (at Assets\MeshAnimator\Scripts\Snapshot\SnapshotMeshAnimator.cs:487)

    coreanim:Attack() (at Assets\scriptology\coreanim.cs:34)


    [C:\buildslave\unity\build\Runtime/Allocator/ThreadsafeLinearAllocator.cpp line 311]
    (Filename: Assets/MeshAnimator/Scripts/Snapshot/SnapshotMeshAnimator.cs Line: 187)

    Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 5)
    (Filename: C:\buildslave\unity\build\Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 311)

    Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
    (Filename: C:\buildslave\unity\build\Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 537)

    To Debug, enable the define: TLA_DEBUG_STACK_LEAK in ThreadsafeLinearAllocator.cpp. This will output the callstacks of the leaked allocations
    (Filename: C:\buildslave\unity\build\Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 539)

    Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 7)
    (Filename: C:\buildslave\unity\build\Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 311)

    Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
    (Filename: C:\buildslave\unity\build\Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 537)

    To Debug, enable the define: TLA_DEBUG_STACK_LEAK in ThreadsafeLinearAllocator.cpp. This will output the callstacks of the leaked allocations
    (Filename: C:\buildslave\unity\build\Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 539)

    Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 14)
    (Filename: C:\buildslave\unity\build\Runtime/Allocator/ThreadsafeLinearAllocator.cpp Line: 311)

    Internal: deleting an allocation that is older than its permitted lifetime of 4 frames (age = 14)
    Unity.Jobs.JobHandle:ScheduleBatchedJobsAndComplete(JobHandle&)
    Unity.Jobs.JobHandle:Complete() (at C:\buildslave\unity\build\Runtime\Jobs\ScriptBindings\JobHandle.bindings.cs:20)
    FSG.MeshAnimator.Snapshot.CrossfadeJobData:ReturnFrame() (at Assets\MeshAnimator\Scripts\Snapshot\SnapshotMeshAnimator.cs:187)
    FSG.MeshAnimator.Snapshot.CrossfadeJobData:Reset() (at Assets\MeshAnimator\Scripts\Snapshot\SnapshotMeshAnimator.cs:109)
    FSG.MeshAnimator.Snapshot.SnapshotMeshAnimator:Crossfade(Int32, Single) (at Assets\MeshAnimator\Scripts\Snapshot\SnapshotMeshAnimator.cs:487)

    coreanim:Attack() (at Assets\scriptology\coreanim.cs:34)

    In some lines of the log, you can read a call to the method "Attack" in coreanim.cs, here's the simply method:

    public void Attack()
    {
    meshAnimator.Crossfade(1, 0.1f);

    }

    Need some help with this, please.

    Thanks
     
  31. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    Interesting... I will PM you a fix today
     
  32. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    407
    2 quick questions, transform expose, on somethings it works. And on somethings the value is 0,0,0. ??

    using the shader, the transforms to the texture size is way off, like the transforms are .1 of scale. And just rescaling doesnt work
     
  33. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    Can you PM/email me the model you are working with? I will help figure out what's going on.
     
    Last edited: Jul 19, 2020
    JBR-games likes this.
  34. abdalla-ramadan

    abdalla-ramadan

    Joined:
    Jul 1, 2020
    Posts:
    10
    @jschieck

    Hi,

    I requested my company to buy this for the project and they did.

    I have two main issues:

    1. The project has a crowd of enemies and improvement using snapshot was not significant so I want to use shader mode but I am stuck with URP. Are there shaders for URP for shader mode?

    2. The model has three meshes and the animation does show/hide those in some keyframes. Baking convert those to only one model. Is there a way to get vertices for certain submodel to hide them when they should be hidden?

    Edit:
    3. Also does shader mode support mobile?

    Thanks for advance.
     
  35. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    1. URP/LWRP/HDRP is not yet officially supported. I'm working on converting those shaders, but it's taking time.
    2. You cannot do this out of the box. You would have to implement your own shaders (use vertex coloring or textures) to make sections of the mesh transparent. Another option is to bake each part of the model separately, then sync the animations under a parent prefab.
    3. It will support modern mobile hardware. It requires 2d texture array support (#pragma target 3.5) which most devices in the last few years will be support. https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html
     
    abdalla-ramadan likes this.
  36. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    407
    i must of been super tired last night, I tried this morning, and it seems to be working fine on everything. haha damn 18hour days!
     
  37. GameFDev

    GameFDev

    Joined:
    Jul 13, 2020
    Posts:
    6
    Hello,

    Just bought Mesh Animator couple of hours ago. I'm trying to get the GPU animations to work. Everything is working great in the editor, but when I try to build for my test device(Samsung Note 10), mesh animator characters are not visible in the scene. I'm using mobile diffuse shader that comes with your package. I also tried adding the following to the shader but it didn't work.

    #pragma target 3.5
    #pragma require 2darray
     
  38. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    Another user is also having issues on some newer android devices like this (works fine on older ones). What version of Unity are you using, and are you familiar enough with Android to get me the app bootup logs from the device using Android Studio or something like logcat or the monitor tool?
     
  39. GameFDev

    GameFDev

    Joined:
    Jul 13, 2020
    Posts:
    6
    I'm using 2019.4.4.f1 . I sent the logs via PM.
     
  40. abdalla-ramadan

    abdalla-ramadan

    Joined:
    Jul 1, 2020
    Posts:
    10
    Hi,

    I switched to standard pipeline, baked to use shader animation then built and ran on my Huwawei Nova Lite 2.

    It works on the device but the models are flickering too much.

    In the editor it works very well.

    Could that be because of the device GPU or the animation frames are too much?
    I am running mainly 40 and 30 frames animations.

    Thanks for advance.
     
  41. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    Try adding

    #pragma target 3.5

    Into the mesh animator shader you are using. I have a fix submitted to the asset store but awaiting approval.
     
  42. abdalla-ramadan

    abdalla-ramadan

    Joined:
    Jul 1, 2020
    Posts:
    10
    I am using 'Mesh Animator/Mobile/Diffuse'.
    I added #pragma target 3.5 under the '#pragma surface surf Lambert noforwardadd addshadow' line.
    But still I got the same flickering problem.

    But I tried reducing the frames to almost the half then it worked without flickering.
    But the animation's quality is now so bad.

    Is there a better solution?
    Am I adding the #pragma line to a wrong place?
     
  43. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    No that is correct. Reducing the frame count causing it work is interesting, perhaps it's a math calculation happening different on the devices. I'll keep digging. Can you possibly PM or email the model?
     
  44. abdalla-ramadan

    abdalla-ramadan

    Joined:
    Jul 1, 2020
    Posts:
    10
    Thank you very much for your reply.
    It's difficult to send the model since I am under NDA.
    Hopefully you can understand the problem without the model.
    If I discover something I will post here.
     
  45. Dazza007

    Dazza007

    Joined:
    Feb 11, 2014
    Posts:
    8
    Just for your info (in case it helps), I am having the same issue as above, in that I see no mesh animator models on an Android build.
    using Unity 2018.3.12f1
    Phone is a Huawei P30Pro,

    This is just building your crowd example in a blank project,and I have tried adding the
    #pragma target 3.5
    #pragma require 2darray
    without any luck
     
  46. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    42
    Objects are invisible for me too. But Only some. Couldn't think of the reason, as they are identical except for material. Both materials have MA shader.

    Rebaking doesn't help. Some also look transparent and dark.

    All these things happen only in play mode.

    Figured out that only one material is shown correctly. How do I use 2 different materials on 2 different prefabs with the same mesh and the same baked MA files?

    I also get MA standard shader failed to compile.

    EDIT: Duplicating mesh and changing the new mesh for every object that I want different material on solved the issue.

    Windows, Unity 2019.4.4
     
    Last edited: Jul 24, 2020
  47. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    I've finally been able to reproduce the problem. Trying to find the fix.
     
    JBR-games likes this.
  48. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    I've been able to figure out the issue and have submitted a fixed version to the asset store.

    Version 2.0.4
    • Fixed rendering issues on devices where Graphics.CopyTexture isn't supported (certain Android devices).
    • Fixed different materials using the same base mesh not being properly setup in shader mode.
    • Added the ability to use original mesh normals in Shader mode instead of baking them.
    If you need it before it's approved (usually within a day) PM me and I'll get you the updated version.
     
    JBR-games and Ignacii like this.
  49. abdalla-ramadan

    abdalla-ramadan

    Joined:
    Jul 1, 2020
    Posts:
    10
    I tried updating to 2.0.4 but I got the same problem. I have got permission from the company to send you the model which is under NDA.
    I will be really grateful if you take a look at it.
     
  50. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    428
    Version 2.0.5 has been submitted to the asset store with more fixes & goodies! Shout-out to @abdalla-ramadan for helping find the fixes to some of these bugs!
    • Fixed flickering animation in shader mode on some mobile devices.
    • Fixed "Add Selected Clips" button not adding individually selected clip assets.
    • Fixed "Baked" normal mode not working correctly in snapshot mode. This now produces the best looking results, but larger asset sizes. Using baked mode for shader mode does not affect asset size.
    • Added support for animations that toggle on and off mesh renderers/skinned meshes during playback. Those meshes will now be hidden (all rendered at a single point) for the frames the renderer is disabled.
    • Better support for combining and baking assets with multiple meshes. Scaled transforms should now bake at the proper size.
     
    shyamarama and abdalla-ramadan like this.
unityunity