Search Unity

Importing rigs with more than 4 joints influence per vertex

Discussion in 'Animation' started by FeastSC2, Aug 16, 2018.

  1. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    I read that Unity has limited the maximum amount of joints per vertex to 4.

    I have a bunch of rigs that have more than 4 joint influences per vertex, what does that mean when I import them into Unity (because I get no error message), how is the vertex influence redistributed?
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    I've had rigs completely explode on me before when vertex influences weren't 4 or below. It happened when animation was played. Have you successfully played animations on the rig after import, in play mode and in builds?
    Several platforms (webgl and a lot of mobiles) only support 2 influences - so if building for those there will eventually be issues.

    Maybe they've (Unity) improved the import process to restrict and equalize the vertex influences if there are more than 4 vertices influencing a bone, however - I think this would be a very uncontrolled auto-process that would result in undesired outcomes.

    If you are successful - you have some luck on your side, however as a animator/rigger - an auto re-equalize of skin weights is not at all appealing. Might consider reworking the skin weights for total control in your 3D app - if you find the weights are not as expected. In 3D Max it's a one click change in the skin modifier setting. I have a script that sets the influence to 4 when modifier is applied, as the default vertex influence is set to 20 normally.
     
  3. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    theANMATOR2b I tried in the editor in play mode and it was fine, I'm using Maya and I'm not sure how to transform the # of influences per vertex to 4 since I don't want to actually reskin. Luckily I'm not planning to release on mobile.

    Just made a build to test if it works on PC and it looks fine.
    I guess then what I want is to equalize to the 4 joints within Maya and using an automatic process would be best here since I have more than 1 character that doesn't have 4 max.

    I'll try to figure this out, thanks :)
     
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    If you feel adventurous, you can try to pack and decode extra weight as vertex attribute and write a shader to apply them runtime.