Search Unity

Skin weights problem regardless of what I choose

Discussion in 'Formats & External Tools' started by Zaine7673, May 23, 2020.

  1. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238
    Hi all,

    So I've have an animation for the character I am using in-game and everything is fine with it except that there are very slight variations in the way the animations look on Blender and the way it looks on Unity after importing the FBX.

    I've done some research and it seems like Unity does not like vertices to have weight from multiple bones? Changing the skin weight from 4 to 2 made the animation more like how its supposed to be but still not exact and i can see this causing issues in the long run.

    I'm assuming that the fix here is to go back onto Blender and re-weight the model so that a single vertices is not assigned to more than 2 bones max.

    Before i attempt this tedious task, I'm curious as to if anyone can advise me on a much simpler and less time-consuming fix for this??

    Would truly appreciate any suggestions :)
     
  2. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    Number of weights per bone should not affect the way how the animation is playing, only the way the mesh is deforming. Check your animation import settings. What exactly you do not like about the animations in Unity anyway? It is hard to tell what went wrong from "there is some variations". Can you record a video of a comparsion?
     
  3. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238
    @DimitriX89 thanks for replying buddy. you're right it would be easier if I shared some visuals.

    So on Blender, things are just how I want them and this is what it looks like -


    However, when exporting to FBX and importing to Unity it looks like some verts are being pulled or weighted incorrectly -


    I don't understand why this happens. Never happened to me before and I've imported a few animations to unity.

    I've tried changing FBX settings and also tried messing around with the Unity import settings but nothing has any sort of effect on it. The only thing that changes it slightly is switching skin weight from 4 bones to 2 bones but even then it doesn't fix it.

    This is it with 4bones on skinned mesh renderer

    4bones.PNG

    and this is it with 2 bones

    2bones.PNG

    I've circled where the strange deformations occur.

    Any idea as to what could be causing this?
     
  4. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238
    Oh and don't mind the bright colours lol, its just a material ID and will be textured properly later ;-)
     
  5. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    Okay, so it is strictly a weight problem. I was confused by your first post. First, did you use automatic weighting for this mesh? That might end up creating unnessessary number of weight influences per vertex
     
  6. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238
    @DimitriX89 initially, yes. However, I then went ahead and adjusted the weights to achieve the desired result. So is this indeed a result of a single vertex being influenced by too many bones?
     
  7. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    Yes, automatic weights' count reduction must've caused that. Try to erase all the unwanted influences from the problem places. Also, run Weights - Clean and Weights - Normalize All on your mesh in Blender
     
  8. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238
    @DimitriX89 thanks buddy, normalising the weight on every deforming bone worked - i didnt realise that i had auto-normalize unchecked.
     
  9. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    Enabling Auto Normalize only affects brushes in Paint mode, I believe. Not auto weight generation