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. Dismiss Notice

Importing Animation breaks Batching?

Discussion in 'iOS and tvOS' started by Randy-Edmonds, Aug 9, 2010.

  1. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
    I have an FBX model (created in Maya) that is a very basic object (basically 5 cubes).

    When I import it into Unity iPhone without animation the object will do dynamic batching... when I import it with animation it will not batch! Any idea why? This is killing me!

    I have attached the model. Any help will be greatly appreciated!

    Thanks.
     

    Attached Files:

  2. EskemaGames

    EskemaGames

    Joined:
    Jun 23, 2010
    Posts:
    318
    The batch only works with simple models and less than 300 polys. So it's only useful for static models or scenery objects without animations
     
  3. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
    Dynamic batching works on moving objects less than 300 verts... does having an Animation effect this?
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    no, animation does not affect this, it should still work.

    Question is if your model out of unitys view has 300 vertices ... its easy to forget that what the modeller tells you is bulls*** (they omit a lot of technical facts which especially hits the vertex count correctness pretty heavily)

    to find that out -> empty scene, drop the model in front of the cam, see stats (game window)
     
  5. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
    The model reports ~140 Verts in Unity.
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Unity iPhone Version?
     
  7. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
    3.0 B5

    I think it is something to do with the FBX from Maya. I just don't know what.
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    ah well U3 is a bit different, until Preview 5 there was no batching and I'm unsure if animated objects batch already again. Its after all a preview, not the released thing (the preview 5 mail refreshed that too)

    so you would likely file a bug with above package on the matter to be sure its listed
     
  9. Randy-Edmonds

    Randy-Edmonds

    Joined:
    Oct 10, 2005
    Posts:
    1,122
    Animation Batching does work in 3.0 b5, I've tested it. However, the model I am using (attached to be first post) doesn't batch when I import the animation. I haven't tested in 1.7 but I don't think this is a beta issue.
     
  10. vegashacker

    vegashacker

    Joined:
    Sep 4, 2010
    Posts:
    18
    I'm able to reproduce your issue (with your attached FBX file) in the newest release version (3.0.0f5). Did you ever figure out the solution? Or a workaround?
     
  11. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Rather old thread.

    It since then got verified that it is not an issue but by design.
    Unity 3 does not batch skinned renderers anymore. Only static ones
     
  12. MikaMobile

    MikaMobile

    Joined:
    Jan 29, 2009
    Posts:
    845
    Didn't check out your file, but my guess would be that the objects you're expecting to batch have different local scale values. Either that, or its a skinned mesh (which don't batch, period).
     
  13. vegashacker

    vegashacker

    Joined:
    Sep 4, 2010
    Posts:
    18
    That's disappointing. Is there anyway to have animated characters without skinned mesh? We're trying to write a game that has a bunch of enemies (all the same model). If we get batching, performance is acceptable. Without it, it's not. We'd like those enemies to be animated, however, as they approach the hero.

    This is an iPhone project, btw.

    Thanks for any advice,
    Rob
     
  14. MikaMobile

    MikaMobile

    Joined:
    Jan 29, 2009
    Posts:
    845
    Animation doesn't interfere with batching, only skinning, scale, and vert count do. So you can safely have a bunch of animated elements that will batch, as long as they follow the rest of the rules (share a material, same local scale, not skinned, <300 verts)
     
  15. BDCJR

    BDCJR

    Joined:
    Apr 25, 2013
    Posts:
    19
    If the object has the component <Skinned Mesh Renderer> the dynamic batching dosen't work. Maybe if your animation is simple enough you can make animation in unity. If you want to have dynamic batching you should use just <Mesh Renderer> . Sorry for my english.