Search Unity

Automatically skin and rig clothes, using an existing rigged humanoid

Discussion in 'Animation' started by rapidrunner, Feb 16, 2019.

  1. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    I am looking at quick solutions to transfer meshes (clothes in OBJ or FBX format), on a standard humanoid rigged figure (for sake of simplicity, say Unitychan).

    I have done the modeling part on these clothes; most of them are either shirts, skirts, pants and shoes. Although I did not have time to actually skin and rig them.

    Is there a quick way to transfer the skinning and rigging data from a character to un-skinned/un-rigged meshes? I was not able to find anything in Unity; so if I have to do it outside Unity, what would you suggest to use? I have a lot of meshes so doing the manual skinning would take me a considerable amount of time, and I would like to invest that time writing code, instead of doing something mechanical and repetitive, that would fit more a computer task :)
     
  2. Volcanicus

    Volcanicus

    Joined:
    Jan 6, 2018
    Posts:
    169
    You could make them children or IK anchor the clothes if they are dynamic and then just make them scaled to 0 and upon trigger, scale them back to 1. I use this trick to make quick changes during animations (someone getting stuck by arrows for instance). To do this, you literally just need a simple IEnumerator script with the proper boolean triggers and then set animations for all clothings (copy the animator) that makes them scale from 0 to 1 and from 1 to 0 (don't loop it).
     
  3. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    I am not sure I understand here.

    If I make my mesh a child of my figure, the figure moves but the mesh will stay static, because it is neither skinned nor rigged.

    This works for your arrow example because the arrow stay straight once you hit the target, so it can be a child of the character, and move with it. But for a shirt, jacket, pair of pants or shoes, that would not work. Because the clothing would not move with the body, since there are no bones and they are not weighted.

    Or did I misunderstood your statement?
     
    ksam2 and Ziplock9000 like this.
  4. Volcanicus

    Volcanicus

    Joined:
    Jan 6, 2018
    Posts:
    169
    Not gonna lie, I think I misunderstood what you wanted.

    If I find a solution, I'll return. My apologies for the unhelpful reply.
     
  5. Ziplock9000

    Ziplock9000

    Joined:
    Jan 26, 2016
    Posts:
    360
    I'd like to know about this so I can use a traditional boned mechanim character. Otherwise I'll have to go with UMA2 which is quite a lot different.
     
  6. polyflow3d

    polyflow3d

    Joined:
    Oct 6, 2014
    Posts:
    297
    Here is a editor plugin that transfers skinning data from one mesh to another. Rigging will remain unchanged. For example, if you create your own clothes for Unitychan, then it will use the bones from the Unitychan rig.
    You can send me example meshes and I will show the result.
     
    rapidrunner and Ziplock9000 like this.
  7. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    Looks like it has great reviews. I wish there was a video tutorial to show how it works; I am mostly planning to get a mesh rigged in mecanim (like unity chan for example), put a non-rigged shirt on her, scale it down and align it to the T pose and then transfer the weight on it, so it becomes usable.

    If that app can do that, and allow me to use that shirt on any other mecanim rigged characters; it is exactly what I need.
     
  8. vivianindatub

    vivianindatub

    Joined:
    Apr 23, 2021
    Posts:
    71
    Hi, did you figure out how to do this? Would love to know how you end up tackling this.
     
    ina likes this.