Clothes dont follow rigg

Sorry for my bad english, i m french.
i have a problem with clothes . ( i m on Unity 2018.3.6f1)

I have buy an avatar.
I created clothes for this avatar.
everything is set in humanoid rig.
If I import the avatar change with the clothes, it works well.
If i import the clothes alone, it’s dont follow the bones avatar and remains in Tpose.

I had this problem with the avatar of Daz / Genesis. a script allowed to correct this but this script does not work on this new avatar. could someone please help me?

Sure, i can pay for help to fix that .
thank you.

The Daz Script
Code (CSharp):

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using System.Linq;

    public class Copy_Bones : MonoBehaviour {

        public GameObject SourceObject;

        // Use this for initialization

        void Start () {
            Copy();
        }


        void Copy()
        {
            if (SourceObject == null) return;

            var sourceRenderer = SourceObject.GetComponent<SkinnedMeshRenderer>();
            var targetRenderer = GetComponent<SkinnedMeshRenderer> ();

            if (sourceRenderer == null) return;
            if (targetRenderer == null) return;

            targetRenderer.bones =
                sourceRenderer.bones.Where(b => targetRenderer.bones.Any (t => t.name == b.name)).ToArray ();
        }
    }

Hard to tell without looking at the models(not that I want to), but sounds like a mismatch with the bones between models. If you extracted the clothes without the bones, then that is a problem aswell since you most likely need all relevant bones and bone names to match between models in order for your script to work.

Make sure these are true first and see if it works:

  • The base model and clothes must have the same bone names and hierarchical structure
  • Whatever bones your clothes were skinned to from the original model need to be extracted with it aswell.

Thank you for your answer.
Bones have the same name.
I have been using this script for a long time for the avatars of Daz / Genesis.
There is this problem on it too. but this script works very well on it.
I do not know why it does not work on my new mesh, and I need another solution.
A similar script or something that could help me fix that.

Do targetRenderer.bones and sourceRenderer.bones contains any bones at all? You may add Debug.Log to check this.

Yes :confused:
The debug Log have no error …
if i apply on root the mesh stay in T pose .
if i apply on TopBody part n the mesh disappears.
I dont understaind :confused:

1 Like