コード例 #1
0
	/// <summary>
	/// Adjusts a skeleton to reflect the DNA values from UMA character data.
	/// </summary>
	/// <remarks>
	/// This will set the postion, rotation, and scale of the various adjustment
	/// bones used by the UMA human rigs to generate a unique character shape.
	/// Also calculates a somewhat realistic mass for the character and the
	/// height and radius of their default collider.
	/// </remarks>
	/// <param name="umaData">UMA data.</param>
	/// <param name="skeleton">Skeleton.</param>
	public static void UpdateUMAGirlyMyRaceDNABones(UMAData umaData, UMASkeleton skeleton)
	{
		var umaDna = umaData.GetDna<UMADnaHumanoid>();
		
		
		skeleton.SetScale(neckAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 0.80f, 0.5f, 1.6f),
			Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 1.2f, 0.5f, 1.6f)));
		
		skeleton.SetScale(spineAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(0.9f + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.45f, 0.75f, 1.350f),
			Mathf.Clamp(0.8f + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.75f, 1.350f)));
		

		//umaData.boneList["NeckAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 0.80f, 0.5f, 1.6f),
		//Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 1.2f, 0.5f, 1.6f));
		
		
	}
コード例 #2
0
	/// <summary>
	/// Apply the DNA information about eye spacing to a skeleton.
	/// </summary>
	/// <param name="umaData">The character data.</param>
	/// <param name="skeleton">Skeleton.</param>
	public static void UpdateTutorialBones(UMAData umaData, UMASkeleton skeleton)
    {
		var umaDna = umaData.GetDna<UMADnaTutorial>();

		float spacing = (umaDna.eyeSpacing - 0.5f) * 0.01f;
		
		skeleton.SetPositionRelative(UMAUtils.StringToHash("LeftEye"), new Vector3(0f, -spacing, 0f));
		skeleton.SetPositionRelative(UMAUtils.StringToHash("RightEye"), new Vector3(0f, spacing, 0f));
	}
コード例 #3
0
        /// <summary>
        /// Apply the boneposes according to the given dna (determined by the dnaTypeHash)
        /// </summary>
        /// <param name="umaData"></param>
        /// <param name="skeleton"></param>
        /// <param name="dnaTypeHash"></param>
        public override void ApplyDNA(UMAData umaData, UMASkeleton skeleton, int dnaTypeHash)
        {
            var umaDna           = umaData.GetDna(dnaTypeHash);
            var masterWeightCalc = masterWeight.GetWeight(umaDna);

            for (int i = 0; i < _poseDNAConverters.Count; i++)
            {
                _poseDNAConverters[i].ApplyDNA(umaData, skeleton, dnaTypeHash, masterWeightCalc);
            }
        }
コード例 #4
0
 public void AdjustScale(UMASkeleton skeleton)
 {
     if (_adjustScale)
     {
         if (skeleton.HasBone(scaleBoneHash))
         {
             var   liveScaleResult   = _liveScale != -1f ? _liveScale : _scale;
             float finalOverallScale = skeleton.GetScale(_scaleBoneHash).x *liveScaleResult;                     //hmm why does this work- its supposed to be +
             skeleton.SetScale(_scaleBoneHash, new Vector3(finalOverallScale, finalOverallScale, finalOverallScale));
         }
     }
 }
コード例 #5
0
        public void UpdateBoneData()
        {
            if (tempBoneData == null)
            {
                return;
            }

            for (int i = 0; i < tempBoneData.Length; i++)
            {
                boneHashList.Add(UMASkeleton.StringToHash(tempBoneData[i].boneTransform.gameObject.name), tempBoneData[i]);
            }
        }
コード例 #6
0
        private void ApplyMorph(float dnaValue, UMAData data, UMASkeleton skeleton, MorphSetDnaAsset.DNAMorphSet morph)
        {
            if (dnaValue >= 0.5001f)
            {
                float morphWeight = (dnaValue - 0.5f) * 2f;
                if (morph.poseOne != null)
                {
                    morph.poseOne.ApplyPose(skeleton, morphWeight);
                }
                if (!String.IsNullOrEmpty(morph.blendShapeOne))
                {
                    data.SetBlendShape(morph.blendShapeOne, morphWeight);
                }

                if (!String.IsNullOrEmpty(morph.blendShapeZero))
                {
                    data.SetBlendShape(morph.blendShapeZero, 0f);
                }

                return;
            }

            if (dnaValue <= 0.4999f)
            {
                float morphWeight = (0.5f - dnaValue) * 2f;
                if (morph.poseZero != null)
                {
                    morph.poseZero.ApplyPose(skeleton, morphWeight);
                }
                if (!String.IsNullOrEmpty(morph.blendShapeZero))
                {
                    data.SetBlendShape(morph.blendShapeZero, morphWeight);
                }

                if (!String.IsNullOrEmpty(morph.blendShapeOne))
                {
                    data.SetBlendShape(morph.blendShapeOne, 0f);
                }

                return;
            }

            //if dnaValue == 0.5f
            if (!String.IsNullOrEmpty(morph.blendShapeOne))
            {
                data.SetBlendShape(morph.blendShapeOne, 0f);
            }

            if (!String.IsNullOrEmpty(morph.blendShapeZero))
            {
                data.SetBlendShape(morph.blendShapeZero, 0f);
            }
        }
    public static void UpdateRACFemaleDNABones(UMAData umaData, UMASkeleton skeleton)
    {
        if (RACHumanFemaleDNAConverterBehaviour.customisation == null)
            RACHumanFemaleDNAConverterBehaviour.customisation = GameObject.FindObjectOfType(typeof(RACCustomization)) as RACCustomization;

        HumanFemaleDNAConverterBehaviour.UpdateUMAFemaleDNABones (umaData, skeleton);

        List<RACModifiableControl> controls = RACHumanFemaleDNAConverterBehaviour.customisation.ControlList;

        for (int iSliderIndex = 0; iSliderIndex < controls.Count; ++iSliderIndex)
        {
            RACModifiableControl curControl = controls[iSliderIndex];

            for (int iBodyPartIndex = 0; iBodyPartIndex < curControl.modifiedBodyParts.Length; ++iBodyPartIndex)
            {
                int skeletonStringToHash = UMASkeleton.StringToHash(curControl.modifiedBodyParts[iBodyPartIndex]);

                //Get the starting information
                Vector3 startingInformation = Vector3.zero;
                if (curControl.sliderStyle == RACModifiableControl.SliderStyle.POSITION)
                {
                    startingInformation = skeleton.GetPosition(skeletonStringToHash);

                    Vector3 scale = skeleton.GetScale(skeletonStringToHash);

                    //Modify it
                    if (curControl.effectsX)
                        startingInformation.x += curControl.sliderControl.actualValue*(1/scale.x);
                    if (curControl.effectsY)
                        startingInformation.y += curControl.sliderControl.actualValue*(1/scale.y);
                    if (curControl.effectsZ)
                        startingInformation.z += curControl.sliderControl.actualValue*(1/scale.z);

                    skeleton.SetPosition(skeletonStringToHash, startingInformation);
                }
                else if (curControl.sliderStyle == RACModifiableControl.SliderStyle.SCALE)
                {
                    startingInformation = skeleton.GetScale(skeletonStringToHash);

                    //Modify it
                    if (curControl.effectsX)
                        startingInformation.x = curControl.sliderControl.actualValue;
                    if (curControl.effectsY)
                        startingInformation.y = curControl.sliderControl.actualValue;
                    if (curControl.effectsZ)
                        startingInformation.z = curControl.sliderControl.actualValue;

                    skeleton.SetScale(skeletonStringToHash, startingInformation);
                }
            }
        }
    }
コード例 #8
0
 public void UpdateCharacterHeightMassRadius(UMAData umaData, UMASkeleton skeleton)
 {
     if (_adjustHeight || _adjustMass || _adjustRadius || _adjustBounds)
     {
         var baseRenderer = GetBaseRenderer(umaData);
         if (baseRenderer == null)
         {
             return;
         }
         var newBounds = DoBoundsModifications(baseRenderer, umaData);
         UpdateCharacterHeightMassRadius(umaData, skeleton, newBounds);
     }
 }
コード例 #9
0
        /// <summary>
        /// Applies the data to a Unity mesh.
        /// </summary>
        /// <param name="renderer">Target renderer.</param>
        /// <param name="skeleton">Skeleton.</param>
        public void ApplyDataToUnityMesh(SkinnedMeshRenderer renderer, UMASkeleton skeleton)
        {
            CreateTransforms(skeleton);

            Mesh mesh = renderer.sharedMesh;

#if UNITY_EDITOR
            if (UnityEditor.PrefabUtility.IsComponentAddedToPrefabInstance(renderer))
            {
                Debug.LogError("Cannot apply changes to prefab!");
            }
            if (UnityEditor.AssetDatabase.IsSubAsset(mesh))
            {
                Debug.LogError("Cannot apply changes to asset mesh!");
            }
#endif
            mesh.subMeshCount = 1;
            mesh.triangles    = new int[0];

            if (OwnSharedBuffers())
            {
                ApplySharedBuffers(mesh);
            }
            else
            {
                mesh.vertices    = vertices;
                mesh.boneWeights = unityBoneWeights != null ? unityBoneWeights : UMABoneWeight.Convert(boneWeights);
                mesh.normals     = normals;
                mesh.tangents    = tangents;
                mesh.uv          = uv;
                mesh.uv2         = uv2;
#if !UNITY_4_6
                mesh.uv3 = uv3;
                mesh.uv4 = uv4;
#endif
                mesh.colors32 = colors32;
            }
            mesh.bindposes = bindPoses;

            var subMeshCount = submeshes.Length;
            mesh.subMeshCount = subMeshCount;
            for (int i = 0; i < subMeshCount; i++)
            {
                mesh.SetTriangles(submeshes[i].triangles, i);
            }

            mesh.RecalculateBounds();
            renderer.bones      = bones != null ? bones : skeleton.HashesToTransforms(boneNameHashes);
            renderer.sharedMesh = mesh;
            renderer.rootBone   = rootBone;
        }
コード例 #10
0
        public void UpdateBoneData()
        {
#pragma warning disable 618
            if (tempBoneData == null)
            {
                return;
            }

            for (int i = 0; i < tempBoneData.Length; i++)
            {
                boneHashList.Add(UMASkeleton.StringToHash(tempBoneData[i].boneTransform.gameObject.name), tempBoneData[i]);
            }
#pragma warning restore 618
        }
コード例 #11
0
        public void EnsureBoneData(Transform[] umaBones, Transform[] animBones, Dictionary <Transform, Transform> boneMap)
        {
#pragma warning disable 618
            foreach (Transform bone in umaBones)
            {
                int nameHash = UMASkeleton.StringToHash(bone.name);
                if (!boneHashList.ContainsKey(nameHash))
                {
                    Transform umaBone;
                    if (!boneMap.TryGetValue(bone, out umaBone))
                    {
                        continue;
                    }

                    BoneData newBoneData = new BoneData();
                    newBoneData.originalBonePosition = umaBone.localPosition;
                    newBoneData.originalBoneScale    = umaBone.localScale;
                    newBoneData.originalBoneRotation = umaBone.localRotation;
                    newBoneData.boneTransform        = umaBone;
                    newBoneData.actualBonePosition   = umaBone.localPosition;
                    newBoneData.actualBoneScale      = umaBone.localScale;
                    boneHashList.Add(UMASkeleton.StringToHash(umaBone.name), newBoneData);
                }
            }

            if (animBones != null)
            {
                List <Transform> newBones = new List <Transform>();
                foreach (Transform bone in animBones)
                {
                    Transform umaBone = boneMap[bone];
                    if ((umaBone != null) && (System.Array.IndexOf(animatedBones, umaBone) < 0))
                    {
                        newBones.Add(umaBone);
                    }
                }

                if (newBones.Count > 0)
                {
                    int oldSize = animatedBones.Length;
                    System.Array.Resize <Transform>(ref animatedBones, oldSize + newBones.Count);
                    for (int i = 0; i < newBones.Count; i++)
                    {
                        animatedBones[oldSize + i] = newBones[i];
                    }
                }
            }
#pragma warning restore 618
        }
コード例 #12
0
            public void ApplyDNA(UMAData umaData, UMASkeleton skeleton, int dnaTypeHash, float masterWeight = 1f)
            {
                _liveShapeWeight = _startingShapeWeight;

                //dna weight superceeds startingWeight if it exists
                if (_modifyingDNA.UsedDNANames.Count > 0)
                {
                    _activeDNA       = (DynamicUMADnaBase)umaData.GetDna(dnaTypeHash);
                    _liveShapeWeight = _modifyingDNA.Evaluate(_activeDNA);
                }
                _liveShapeWeight = _liveShapeWeight * masterWeight;
                _liveShapeWeight = Mathf.Clamp(_liveShapeWeight, 0f, 1f);

                umaData.SetBlendShape(_blendshapeToApply, _liveShapeWeight);
            }
コード例 #13
0
ファイル: UMASkeletonDefault.cs プロジェクト: Kinyajuu/UMA
        private void AddBonesRecursive(Transform transform)
        {
            var hash = UMASkeleton.StringToHash(transform.name);

            boneHashData[hash] = new UMAData.BoneData()
            {
                boneTransform        = transform,
                originalBonePosition = transform.localPosition,
                originalBoneScale    = transform.localScale,
                originalBoneRotation = transform.localRotation
            };
            for (int i = 0; i < transform.childCount; i++)
            {
                var child = transform.GetChild(i);
                AddBonesRecursive(child);
            }
        }
コード例 #14
0
            //TODO methods for screwing with the reducer dnas? Better if we can use fancy properties with indexers

            public void ApplyDNA(UMAData umaData, UMASkeleton skeleton, UMADnaBase activeDNA, float masterWeight = 1f)
            {
                _liveShapeWeight = _startingShapeWeight;

                //dna weight superceeds startingWeight if it exists
                if (_modifyingDNA.UsedDNANames.Count > 0)
                {
                    _liveShapeWeight = _modifyingDNA.Evaluate(activeDNA);
                }
                _liveShapeWeight = _liveShapeWeight * masterWeight;

                //In Unity 2018.3+ blendshapes can have negative values too, so in that case allow the value to go to -1
#if !UNITY_2018_3_OR_NEWER
                _liveShapeWeight = Mathf.Clamp(_liveShapeWeight, 0f, 1f);
#endif
                umaData.SetBlendShape(_blendshapeToApply, _liveShapeWeight);
            }
コード例 #15
0
ファイル: UMAGeneratorBase.cs プロジェクト: Kinyajuu/UMA
        private static void SkeletonModifier(UMAData umaData, ref SkeletonBone[] bones)
        {
            Dictionary <Transform, Transform> animatedBones = new Dictionary <Transform, Transform>();

            for (var i = 0; i < umaData.animatedBones.Length; i++)
            {
                animatedBones.Add(umaData.animatedBones[i], umaData.animatedBones[i]);
            }

            for (var i = 0; i < bones.Length; i++)
            {
                var skeletonbone = bones[i];
                UMAData.BoneData entry;
                if (umaData.boneHashList.TryGetValue(UMASkeleton.StringToHash(skeletonbone.name), out entry))
                {
                    //var entry = umaData.boneList[skeletonbone.name];
                    skeletonbone.position = entry.boneTransform.localPosition;
                    //skeletonbone.rotation = entry.boneTransform.localRotation;
                    skeletonbone.scale = entry.boneTransform.localScale;
                    bones[i]           = skeletonbone;
                    animatedBones.Remove(entry.boneTransform);
                }
            }
            if (animatedBones.Count > 0)
            {
                var newBones = new List <SkeletonBone>(bones);
                // iterate original list rather than dictionary to ensure that relative order is preserved
                for (var i = 0; i < umaData.animatedBones.Length; i++)
                {
                    var animatedBone = umaData.animatedBones[i];
                    if (animatedBones.ContainsKey(animatedBone))
                    {
                        var newBone = new SkeletonBone();
                        newBone.name     = animatedBone.name;
                        newBone.position = animatedBone.localPosition;
                        newBone.rotation = animatedBone.localRotation;
                        newBone.scale    = animatedBone.localScale;
                        newBones.Add(newBone);
                    }
                }
                bones = newBones.ToArray();
            }
        }
コード例 #16
0
 public void GotoTPose()
 {
     if (umaRecipe.raceData.TPose != null)
     {
         var tpose = umaRecipe.raceData.TPose;
         tpose.DeSerialize();
         for (int i = 0; i < tpose.boneInfo.Length; i++)
         {
             var bone = tpose.boneInfo[i];
             var hash = UMASkeleton.StringToHash(bone.name);
             var go   = skeleton.GetBoneGameObject(hash);
             if (go == null)
             {
                 continue;
             }
             skeleton.SetPosition(hash, bone.position);
             skeleton.SetRotation(hash, bone.rotation);
             skeleton.SetScale(hash, bone.scale);
         }
     }
 }
コード例 #17
0
            public void ApplyDNA(UMAData umaData, UMASkeleton skeleton, UMADnaBase activeDNA, float masterWeight = 1f)
            {
                if (_poseToApply == null)
                {
                    if (Debug.isDebugBuild)
                    {
                        Debug.LogWarning(umaData.gameObject.name + " had an invalid or empty pose set in its BonePoseDNAConverters in its DNAConverterController");
                    }
                    return;
                }
                _livePoseWeight = _startingPoseWeight;

                //dna weight superceeds startingWeight if it exists
                if (_modifyingDNA.UsedDNANames.Count > 0)
                {
                    _livePoseWeight = _modifyingDNA.Evaluate(activeDNA);
                }
                _livePoseWeight = _livePoseWeight * masterWeight;
                _livePoseWeight = Mathf.Clamp(_livePoseWeight, 0f, 1f);

                _poseToApply.ApplyPose(skeleton, _livePoseWeight);
            }
コード例 #18
0
        /// <summary>
        /// Calls ApplyDNA on all this convertersControllers plugins (aka converters) that apply dna during the pre-pass
        /// </summary>
        /// <param name="umaData">The umaData on the avatar</param>
        /// <param name="skeleton">The avatars skeleton</param>
        /// <param name="dnaTypeHash">The dnaTypeHash that this converters behaviour is using</param>
        public void ApplyDNAPrepass(UMAData umaData, UMASkeleton skeleton)
        {
            if (!_prepared)
            {
                Prepare();
            }

            UMADnaBase umaDna = umaData.GetDna(DNATypeHash);

            //Make the DNAAssets match if they dont already, can happen when some parts are in bundles and others arent
            if (((DynamicUMADnaBase)umaDna).dnaAsset != DNAAsset && DNAAsset != null)
            {
                ((DynamicUMADnaBase)umaDna).dnaAsset = DNAAsset;
            }

            if (_applyDNAPrepassPlugins.Count > 0)
            {
                for (int i = 0; i < _applyDNAPrepassPlugins.Count; i++)
                {
                    _applyDNAPrepassPlugins[i].ApplyDNA(umaData, skeleton, DNATypeHash);
                }
            }
        }
コード例 #19
0
 /// <summary>
 /// Called by the converter this plugin is assigned to. Applys the plugins list of converters to the character
 /// </summary>
 public abstract void ApplyDNA(UMAData umaData, UMASkeleton skeleton, int dnaTypeHash);
コード例 #20
0
ファイル: DnaConverterBehaviour.cs プロジェクト: jlu3389/UMA
 public void ApplyDna(UMAData data, UMASkeleton skeleton)
 {
     ApplyDnaAction(data, skeleton);
 }
コード例 #21
0
        public void ApplyDNA(UMAData data, UMASkeleton skeleton)
        {
            UMADnaBase activeDNA = data.GetDna(this.dnaTypeHash);

            if (activeDNA == null)
            {
                Debug.LogError("Could not get DNA values for: " + this.name);
                return;
            }

            if (startingPose != null)
            {
                startingPose.ApplyPose(skeleton, 1f);
            }

            if (activeDNA.Count == dnaPoses.Length)
            {
                float[] dnaValues = activeDNA.Values;
                for (int i = 0; i < dnaValues.Length; i++)
                {
                    float dnaValue = dnaValues[i];
                    if ((dnaValue > 0.5f) && (dnaPoses[i].poseOne != null))
                    {
                        float poseWeight = (dnaValue - 0.5f) * 2f;
                        dnaPoses[i].poseOne.ApplyPose(skeleton, poseWeight);
                    }
                    else if ((dnaValue < 0.5f) && (dnaPoses[i].poseZero != null))
                    {
                        float poseWeight = (0.5f - dnaValue) * 2f;
                        dnaPoses[i].poseOne.ApplyPose(skeleton, poseWeight);
                    }
                }
            }
            else
            {
                Debug.LogWarning("DNA length mismatch, trying names. This is SLOW!");
                string[] dnaNames = activeDNA.Names;
                for (int i = 0; i < dnaPoses.Length; i++)
                {
                    if ((dnaPoses[i].dnaEntryName == null) || (dnaPoses[i].dnaEntryName.Length == 0))
                    {
                        continue;
                    }

                    int dnaIndex = System.Array.IndexOf(dnaNames, dnaPoses[i].dnaEntryName);
                    if (dnaIndex < 0)
                    {
                        continue;
                    }

                    float dnaValue = activeDNA.GetValue(dnaIndex);
                    if ((dnaValue > 0.5f) && (dnaPoses[i].poseOne != null))
                    {
                        float poseWeight = (dnaValue - 0.5f) * 2f;
                        dnaPoses[i].poseOne.ApplyPose(skeleton, poseWeight);
                    }
                    else if ((dnaValue < 0.5f) && (dnaPoses[i].poseZero != null))
                    {
                        float poseWeight = (0.5f - dnaValue) * 2f;
                        dnaPoses[i].poseOne.ApplyPose(skeleton, poseWeight);
                    }
                }
            }
        }
コード例 #22
0
	/// <summary>
	/// Adjusts a skeleton to reflect the DNA values from UMA character data.
	/// </summary>
	/// <remarks>
	/// This will set the postion, rotation, and scale of the various adjustment
	/// bones used by the UMA human rigs to generate a unique character shape.
	/// Also calculates a somewhat realistic mass for the character and the
	/// height and radius of their default collider.
	/// </remarks>
	/// <param name="umaData">UMA data.</param>
	/// <param name="skeleton">Skeleton.</param>
	public static void UpdateUMAFemaleDNABones(UMAData umaData, UMASkeleton skeleton)
	{
		var umaDna = umaData.GetDna<UMADnaHumanoid>();
		skeleton.SetScale(headAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 1, 1),
			Mathf.Clamp(1 + (umaDna.headWidth - 0.5f) * 0.30f, 0.5f, 1.6f),
			Mathf.Clamp(1 , 1, 1)));
		
		//umaData.boneList["HeadAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 1, 1),
		//Mathf.Clamp(1 + (umaDna.headWidth - 0.5f) * 0.30f, 0.5f, 1.6f),
		//Mathf.Clamp(1 , 1, 1));
		
		skeleton.SetScale(neckAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 0.80f, 0.5f, 1.6f),
			Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 1.2f, 0.5f, 1.6f)));
		
		//umaData.boneList["NeckAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 0.80f, 0.5f, 1.6f),
		//Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 1.2f, 0.5f, 1.6f));
		
		skeleton.SetScale(leftOuterBreastHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
			Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
			Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f)));
		skeleton.SetScale(rightOuterBreastHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
			Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
			Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f)));
		
		//umaData.boneList["LeftOuterBreast"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f));
		//umaData.boneList["RightOuterBreast"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f));
		
		skeleton.SetScale(leftEyeHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
			Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
			Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f)));
		skeleton.SetScale(rightEyeHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
			Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
			Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f)));
		
		//umaData.boneList["LeftEye"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f));
		//umaData.boneList["RightEye"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f));     

		skeleton.SetRotation(leftEyeAdjustHash,
		                     Quaternion.Euler(new Vector3((umaDna.eyeRotation - 0.5f) * 20, 0, 0)));
		skeleton.SetRotation(rightEyeAdjustHash,
		                     Quaternion.Euler(new Vector3(-(umaDna.eyeRotation - 0.5f) * 20, 0, 0)));
		
		//umaData.boneList["LeftEye"].boneTransform.localEulerAngles = new Vector3((umaDna.eyeRotation - 0.5f) * 20, -90, -180);
		//umaData.boneList["RightEye"].boneTransform.localEulerAngles = new Vector3(-(umaDna.eyeRotation - 0.5f) * 20, -90, -180);
		
		skeleton.SetScale(spine1AdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.10f + (umaDna.upperMuscle - 0.5f) * 0.15f, 0.75f, 1.10f),
			Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.10f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.85f, 1.00f)));
		
		//umaData.boneList["Spine1Adjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.10f + (umaDna.upperMuscle - 0.5f) * 0.15f, 0.75f, 1.10f),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.10f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.85f, 1.00f));
		
		skeleton.SetScale(spineAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.85f, 1.350f),
			Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.85f, 1.450f)));
		
		//umaData.boneList["SpineAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.85f, 1.350f),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.85f, 1.450f));
		
		skeleton.SetScale(lowerBackBellyHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 1.75f, 0.35f, 1.75f),
			Mathf.Clamp(1 + (umaDna.waist - 0.5f) * 1.75f, 0.35f, 1.75f),
			Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 3.00f, 0.35f, 3.0f)));
		
		//umaData.boneList["LowerBackBelly"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 1.75f, 0.35f, 1.75f),
		//Mathf.Clamp(1 + (umaDna.waist - 0.5f) * 1.75f, 0.35f, 1.75f),
		//Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 3.00f, 0.35f, 3.0f));
		
		skeleton.SetScale(lowerBackAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f),
			Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f),
			Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f)));
		
		//umaData.boneList["LowerBackAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f));
		
		skeleton.SetScale(leftTrapeziusHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
			Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
			Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f)));
		skeleton.SetScale(rightTrapeziusHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
			Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
			Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f)));
		
		//umaData.boneList["LeftTrapezius"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f));
		//umaData.boneList["RightTrapezius"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f));
		
		skeleton.SetScale(leftArmAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f),
			Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f)));
		skeleton.SetScale(rightArmAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f),
			Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f)));
		
		//umaData.boneList["LeftArmAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f),
		//Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f));
		//umaData.boneList["RightArmAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f),
		//Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f));
		
		skeleton.SetScale(leftForeArmAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f),
			Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f)));
		skeleton.SetScale(rightForeArmAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f),
			Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f)));
		
		//umaData.boneList["LeftForeArmAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f));
		//umaData.boneList["RightForeArmAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f));
		
		skeleton.SetScale(leftForeArmTwistAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f),
			Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f)));
		skeleton.SetScale(rightForeArmTwistAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f),
			Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f)));
		
		//umaData.boneList["LeftForeArmTwistAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f));
		//umaData.boneList["RightForeArmTwistAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f));
		
		skeleton.SetScale(leftShoulderAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f),
			Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f)));
		skeleton.SetScale(rightShoulderAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f),
			Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f)));
		
		//umaData.boneList["LeftShoulderAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f));
		//umaData.boneList["RightShoulderAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f));
		
		skeleton.SetScale(leftUpLegAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f),
			Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f)));
		skeleton.SetScale(rightUpLegAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f),
			Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f)));
		
		//umaData.boneList["LeftUpLegAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f));
		//umaData.boneList["RightUpLegAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f));
		
		skeleton.SetScale(leftLegAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.95f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f),
			Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.75f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f)));
		skeleton.SetScale(rightLegAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1, 0.6f, 2),
			Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.95f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f),
			Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.75f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f)));
		
		//umaData.boneList["LeftLegAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.95f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.75f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f));
		//umaData.boneList["RightLegAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.95f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.75f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f));
		
		skeleton.SetScale(leftGluteusHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
			Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
			Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f)));
		skeleton.SetScale(rightGluteusHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
			Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
			Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f)));
		
		//umaData.boneList["LeftGluteus"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f));
		//umaData.boneList["RightGluteus"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f));
		
		skeleton.SetScale(leftEarAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
			Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
			Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f)));
		skeleton.SetScale(rightEarAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
			Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
			Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f)));
		
		//umaData.boneList["LeftEarAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f));
		//umaData.boneList["RightEarAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f));
		
		skeleton.SetPositionRelative(leftEarAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.01f, -0.01f, 0.01f),
			Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.03f, -0.03f, 0.03f),
			Mathf.Clamp(0 + (umaDna.earsPosition - 0.5f) * 0.02f, -0.02f, 0.02f)));
		skeleton.SetPositionRelative(rightEarAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.01f, -0.01f, 0.01f),
			Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * 0.03f, -0.03f, 0.03f),
			Mathf.Clamp(0 + (umaDna.earsPosition - 0.5f) * 0.02f, -0.02f, 0.02f)));
		
		skeleton.SetRotation(leftEarAdjustHash,
		                     Quaternion.Euler(new Vector3(
			Mathf.Clamp(0, -30, 80),
			Mathf.Clamp(0, -30, 80),
			Mathf.Clamp((umaDna.earsRotation - 0.5f) * 40, -15, 40))));
		skeleton.SetRotation(rightEarAdjustHash,
		                     Quaternion.Euler(new Vector3(
			Mathf.Clamp(0, -30, 80),
			Mathf.Clamp(0, -30, 80),
			Mathf.Clamp((umaDna.earsRotation - 0.5f) * -40, -40, 15))));
		
		skeleton.SetScale(noseBaseAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 1.5f, 0.4f, 3.0f),
			Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 0.15f + (umaDna.noseWidth - 0.5f) * 1.0f, 0.25f, 3.0f),
			Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 0.15f + (umaDna.noseFlatten - 0.5f) * 0.75f, 0.25f, 3.0f)));
		skeleton.SetScale(noseMiddleAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 1.9f + (umaDna.noseSize - 0.5f) * 1.0f, 0.5f, 3.0f),
			Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 0.15f + (umaDna.noseSize - 0.5f) * 0.25f + (umaDna.noseWidth - 0.5f) * 0.5f, 0.5f, 3.0f),
			Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 0.15f + (umaDna.noseSize - 0.5f) * 0.10f, 0.5f, 3.0f)));
		skeleton.SetRotation(noseBaseAdjustHash,
		                     Quaternion.Euler(new Vector3(
			Mathf.Clamp(0, -30, 80),
			Mathf.Clamp((umaDna.noseInclination - 0.5f) * 60, -60, 30),
			Mathf.Clamp(0, -30, 80))));
		skeleton.SetPositionRelative(noseBaseAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.0125f, -0.025f, 0.025f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.0125f, -0.025f, 0.025f)));
		skeleton.SetPositionRelative(noseMiddleAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.006f, -0.012f, 0.012f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.007f, -0.015f, 0.015f)));

		skeleton.SetPositionRelative(leftNoseAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.0125f, -0.025f, 0.025f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.0125f, -0.025f, 0.025f)));
		skeleton.SetPositionRelative(rightNoseAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.0125f, -0.025f, 0.025f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.0125f, -0.025f, 0.025f)));

		skeleton.SetPositionRelative(upperLipsAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.0045f, -0.0045f, 0.0045f)));
		
		skeleton.SetScale(mandibleAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.chinPronounced - 0.5f) * 0.18f, 0.55f, 1.75f),
			Mathf.Clamp(1 + (umaDna.chinSize - 0.5f) * 1.3f, 0.75f, 1.3f),
			Mathf.Clamp(1, 0.4f, 1.5f)));
		skeleton.SetPositionRelative(mandibleAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.0125f, 0.0125f),
			Mathf.Clamp(0, -0.0125f, 0.0125f),
			Mathf.Clamp(0 + (umaDna.chinPosition - 0.5f) * 0.0075f, -0.0075f, 0.0075f)));

		skeleton.SetPositionRelative(leftLowMaxilarAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.jawsSize - 0.5f) * 0.025f, -0.025f, 0.025f),
			Mathf.Clamp(0 + (umaDna.jawsPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));
		skeleton.SetPositionRelative(rightLowMaxilarAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.jawsSize - 0.5f) * -0.025f, -0.025f, 0.025f),
			Mathf.Clamp(0 + (umaDna.jawsPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));
		
		skeleton.SetScale(leftCheekAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
			Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
			Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f)));
		skeleton.SetScale(rightCheekAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
			Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
			Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f)));
		skeleton.SetPositionRelative(leftCheekAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.cheekPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));
		skeleton.SetPositionRelative(rightCheekAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.cheekPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));

		skeleton.SetPositionRelative(leftLowCheekAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.lowCheekPronounced - 0.5f) * -0.035f, -0.07f, 0.035f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.lowCheekPosition - 0.5f) * 0.06f, -0.06f, 0.06f)));
		skeleton.SetPositionRelative(rightLowCheekAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.lowCheekPronounced - 0.5f) * -0.035f, -0.07f, 0.035f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.lowCheekPosition - 0.5f) * 0.06f, -0.06f, 0.06f)));

		skeleton.SetPositionRelative(noseTopAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.025f + (umaDna.foreheadSize - 0.5f) * -0.0015f, -0.015f, 0.0025f)));

		skeleton.SetPositionRelative(leftEyebrowLowAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.02f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.015f, 0.005f)));
		skeleton.SetPositionRelative(leftEyebrowMiddleAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.04f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.025f, 0.005f)));
		skeleton.SetPositionRelative(leftEyebrowUpAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.007f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.010f, 0.005f)));

		skeleton.SetPositionRelative(rightEyebrowLowAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.02f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.015f, 0.005f)));
		skeleton.SetPositionRelative(rightEyebrowMiddleAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.04f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.025f, 0.005f)));
		skeleton.SetPositionRelative(rightEyebrowUpAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.007f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.010f, 0.005f)));
		
		skeleton.SetScale(lipsSuperiorAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
		skeleton.SetScale(lipsInferiorAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 1.0f, 0.65f, 1.5f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 1.0f, 0.65f, 1.5f)));
		
		skeleton.SetScale(leftLipsSuperiorMiddleAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
		skeleton.SetScale(rightLipsSuperiorMiddleAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
		skeleton.SetScale(leftLipsInferiorAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
		skeleton.SetScale(rightLipsInferiorAdjustHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
			Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));

		skeleton.SetPositionRelative(lipsInferiorAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f)));

		skeleton.SetPositionRelative(leftLipsAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.03f, -0.02f, 0.005f),
			Mathf.Clamp(0, -0.05f, 0.05f)));
		skeleton.SetPositionRelative(rightLipsAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.03f, -0.005f, 0.02f),
			Mathf.Clamp(0, -0.05f, 0.05f)));

		skeleton.SetPositionRelative(leftLipsSuperiorMiddleAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.007f, -0.02f, 0.005f),
			Mathf.Clamp(0, -0.05f, 0.05f)));
		skeleton.SetPositionRelative(rightLipsSuperiorMiddleAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.007f, -0.005f, 0.02f),
			Mathf.Clamp(0, -0.05f, 0.05f)));
		skeleton.SetPositionRelative(leftLipsInferiorAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.007f, -0.02f, 0.005f),
			Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f)));
		skeleton.SetPositionRelative(rightLipsInferiorAdjustHash,
		                     new Vector3(
			Mathf.Clamp(0, -0.05f, 0.05f),
			Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.007f, -0.005f, 0.02f),
			Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f)));
		
		
		////Bone structure change
		float overallScale = 0.81f + (umaDna.height - 0.5f) * 1.0f + (umaDna.legsSize - 0.5f) * 1.0f;
		overallScale = Mathf.Clamp(overallScale, 0.4f, 1.8f);
		skeleton.SetScale(positionHash, new Vector3(overallScale, overallScale, overallScale));

		skeleton.SetPositionRelative(positionHash,
		                     new Vector3(
			Mathf.Clamp((umaDna.feetSize - 0.5f) * -0.27f, -0.15f, 0.0675f),
			Mathf.Clamp(0, -10, 10),
			Mathf.Clamp(0, -10, 10)));
		
		float lowerBackScale = Mathf.Clamp(1 - (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f);
		skeleton.SetScale(lowerBackHash, new Vector3(lowerBackScale, lowerBackScale, lowerBackScale));

		skeleton.SetScale(headHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2),
			Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2),
			Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2)));
		
		skeleton.SetScale(leftArmHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f)));
		skeleton.SetScale(rightArmHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f)));
		
		skeleton.SetScale(leftForeArmHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f)));
		skeleton.SetScale(rightForeArmHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f)));
		
		skeleton.SetScale(leftHandHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f)));
		skeleton.SetScale(rightHandHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f)));
		
		skeleton.SetScale(leftFootHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f)));
		skeleton.SetScale(rightFootHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f)));

		skeleton.SetPositionRelative(leftUpLegHash,
		                     new Vector3(
			Mathf.Clamp(0, -10, 10),
			Mathf.Clamp((umaDna.legSeparation - 0.5f) * -0.15f + (umaDna.lowerWeight - 0.5f) * -0.035f + (umaDna.legsSize - 0.5f) * 0.1f, -0.055f, 0.055f),
			Mathf.Clamp(0, -10, 10)));
		skeleton.SetPositionRelative(rightUpLegHash,
		                     new Vector3(
			Mathf.Clamp(0, -10, 10),
			Mathf.Clamp((umaDna.legSeparation - 0.5f) * 0.15f + (umaDna.lowerWeight - 0.5f) * 0.035f + (umaDna.legsSize - 0.5f) * -0.1f, -0.025f, 0.025f),
			Mathf.Clamp(0, -10, 10)));

		skeleton.SetPositionRelative(leftShoulderHash,
		                     new Vector3(
			Mathf.Clamp(0, -10, 10),
			Mathf.Clamp((umaDna.upperMuscle - 0.5f) * -0.0235f, -0.025f, 0.015f),
			Mathf.Clamp(0, -10, 10)));
		skeleton.SetPositionRelative(rightShoulderHash,
		                     new Vector3(
			Mathf.Clamp(0, -10, 10),
			Mathf.Clamp((umaDna.upperMuscle - 0.5f) * 0.0235f, -0.015f, 0.025f),
			Mathf.Clamp(0, -10, 10)));
		
		skeleton.SetScale(mandibleHash, 
		                  new Vector3(
			Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f),
			Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f),
			Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f)));

		umaData.characterHeight = overallScale * (0.85f + 1.2f * lowerBackScale);
		umaData.characterRadius = 0.26f * overallScale;
		umaData.characterMass = 42f * overallScale + 28f * umaDna.upperWeight + 22f * umaDna.lowerWeight;
	}
コード例 #23
0
        public void ApplyDNA(UMAData data, UMASkeleton skeleton)
        {
            if (morphSet == null)
            {
                if (Debug.isDebugBuild)
                {
                    Debug.LogError("Missing morph set asset for: " + this.name);
                }

                return;
            }

            UMADnaBase activeDNA = data.GetDna(this.dnaTypeHash);

            if (activeDNA == null)
            {
                if (Debug.isDebugBuild)
                {
                    Debug.LogError("Could not get DNA values for: " + this.name);
                }

                return;
            }

            if (morphSet.startingPose != null)
            {
                morphSet.startingPose.ApplyPose(skeleton, 1f);
            }
            if (!String.IsNullOrEmpty(morphSet.startingBlendShape))
            {
                data.SetBlendShape(morphSet.startingBlendShape, 1f);
            }

            if (activeDNA.Count == morphSet.dnaMorphs.Length)
            {
                float[] dnaValues = activeDNA.Values;
                for (int i = 0; i < dnaValues.Length; i++)
                {
                    float dnaValue = dnaValues[i];
                    MorphSetDnaAsset.DNAMorphSet morph = morphSet.dnaMorphs[i];
                    ApplyMorph(dnaValue, data, skeleton, morph);
                }
            }
            else
            {
                if (Debug.isDebugBuild)
                {
                    Debug.LogWarning("DNA length mismatch, trying names. This is SLOW!");
                }
                string[] dnaNames = activeDNA.Names;
                for (int i = 0; i < morphSet.dnaMorphs.Length; i++)
                {
                    if (String.IsNullOrEmpty(morphSet.dnaMorphs[i].dnaEntryName))
                    {
                        continue;
                    }

                    int dnaIndex = System.Array.IndexOf(dnaNames, morphSet.dnaMorphs[i].dnaEntryName);
                    if (dnaIndex < 0)
                    {
                        continue;
                    }

                    float dnaValue = activeDNA.GetValue(dnaIndex);
                    MorphSetDnaAsset.DNAMorphSet morph = morphSet.dnaMorphs[i];

                    ApplyMorph(dnaValue, data, skeleton, morph);
                }
            }
        }
コード例 #24
0
        protected void CreateBonePoseCallback(UMAData umaData)
        {
            UMA.PoseTools.UMABonePose bonePose = null;
            if (selectedConverter.startingPose == null)
            {
                bonePose = CreatePoseAsset("", bonePoseSaveName);
            }
            else
            {
                bonePose       = selectedConverter.startingPose;
                bonePose.poses = new UMABonePose.PoseBone[1];
            }

            UMASkeleton skeletonPreDNA  = tempAvatarPreDNA.GetComponent <UMADynamicAvatar>().umaData.skeleton;
            UMASkeleton skeletonPostDNA = tempAvatarPostDNA.GetComponent <UMADynamicAvatar>().umaData.skeleton;

            Transform transformPreDNA;
            Transform transformPostDNA;
            bool      transformDirty;
            int       parentHash;

            foreach (int boneHash in skeletonPreDNA.BoneHashes)
            {
                skeletonPreDNA.TryGetBoneTransform(boneHash, out transformPreDNA, out transformDirty, out parentHash);
                skeletonPostDNA.TryGetBoneTransform(boneHash, out transformPostDNA, out transformDirty, out parentHash);

                if ((transformPreDNA == null) || (transformPostDNA == null))
                {
                    Debug.LogWarning("Bad bone hash in skeleton: " + boneHash);
                    continue;
                }

                if (!LocalTransformsMatch(transformPreDNA, transformPostDNA))
                {
                    bonePose.AddBone(transformPreDNA, transformPostDNA.localPosition, transformPostDNA.localRotation, transformPostDNA.localScale);
                }
            }

            Destroy(tempAvatarPreDNA);
            Destroy(tempAvatarPostDNA);

            // This can be very helpful for testing

            /*
             * bonePose.ApplyPose(skeletonPreDNA, 1.0f);
             */

            EditorUtility.SetDirty(bonePose);
            AssetDatabase.SaveAssets();
            // Set this asset as the converters pose asset
            selectedConverter.startingPose = bonePose;
            //make sure its fully applied
            selectedConverter.startingPoseWeight = 1f;

            // Reset all the DNA values for target Avatar to default
            UMADnaBase[] targetDNA = activeUMA.umaData.GetAllDna();
            foreach (UMADnaBase dnaEntry in targetDNA)
            {
                for (int i = 0; i < dnaEntry.Values.Length; i++)
                {
                    dnaEntry.SetValue(i, 0.5f);
                }
            }

            // Optionally clear the DNA from the base recipe,
            // since it's now included in the new starting pose
            UMARecipeBase baseRaceRecipe = activeUMA.umaData.umaRecipe.GetRace().baseRaceRecipe;

            if (baseRaceRecipe != null)
            {
                if (EditorUtility.DisplayDialog("Base Recipe Cleanup", "Starting Pose created. Remove DNA from base recipe of active race?", "Remove DNA", "Keep DNA"))
                {
                    UMAData.UMARecipe baseRecipeData = new UMAData.UMARecipe();
                    baseRaceRecipe.Load(baseRecipeData, activeUMA.context);
                    baseRecipeData.ClearDna();
                    baseRaceRecipe.Save(baseRecipeData, activeUMA.context);
                }
            }
        }
コード例 #25
0
 public void ApplyDynamicDnaAction(UMAData umaData, UMASkeleton skeleton)
 {
     UpdateDynamicUMADnaBones(umaData, skeleton, false);
     ApplyDnaCallbackDelegates(umaData);
 }
コード例 #26
0
ファイル: UMAMeshData.cs プロジェクト: grendelbiter/UMA
        /// <summary>
        /// Applies the data to a Unity mesh.
        /// </summary>
        /// <param name="renderer">Target renderer.</param>
        /// <param name="skeleton">Skeleton.</param>
        public void ApplyDataToUnityMesh(SkinnedMeshRenderer renderer, UMASkeleton skeleton)
        {
            CreateTransforms(skeleton);

            Mesh mesh = renderer.sharedMesh;

#if UNITY_EDITOR
            if (UnityEditor.PrefabUtility.IsComponentAddedToPrefabInstance(renderer))
            {
                Debug.LogError("Cannot apply changes to prefab!");
            }
            if (UnityEditor.AssetDatabase.IsSubAsset(mesh))
            {
                Debug.LogError("Cannot apply changes to asset mesh!");
            }
#endif
            mesh.subMeshCount = 1;
            mesh.triangles    = new int[0];

            if (OwnSharedBuffers())
            {
                ApplySharedBuffers(mesh);
            }
            else
            {
                mesh.vertices    = vertices;
                mesh.boneWeights = unityBoneWeights != null ? unityBoneWeights : UMABoneWeight.Convert(boneWeights);
                mesh.normals     = normals;
                mesh.tangents    = tangents;
                mesh.uv          = uv;
                mesh.uv2         = uv2;
                mesh.uv3         = uv3;
                mesh.uv4         = uv4;
                mesh.colors32    = colors32;
            }
            mesh.bindposes = bindPoses;

            var subMeshCount = submeshes.Length;
            mesh.subMeshCount = subMeshCount;
            for (int i = 0; i < subMeshCount; i++)
            {
                mesh.SetTriangles(submeshes[i].triangles, i);
            }

            //Apply the blendshape data from the slot asset back to the combined UMA unity mesh.
            #region Blendshape
            mesh.ClearBlendShapes();
            if (blendShapes != null && blendShapes.Length > 0)
            {
                for (int shapeIndex = 0; shapeIndex < blendShapes.Length; shapeIndex++)
                {
                    if (blendShapes [shapeIndex] == null)
                    {
                        Debug.LogError("blendShapes [shapeIndex] == null!");
                        break;
                    }

                    for (int frameIndex = 0; frameIndex < blendShapes[shapeIndex].frames.Length; frameIndex++)
                    {
                        //There might be an extreme edge case where someone has the same named blendshapes on different meshes that end up on different renderers.
                        string name = blendShapes [shapeIndex].shapeName;
                        mesh.AddBlendShapeFrame(name,
                                                blendShapes [shapeIndex].frames [frameIndex].frameWeight,
                                                blendShapes [shapeIndex].frames [frameIndex].deltaVertices,
                                                blendShapes [shapeIndex].frames [frameIndex].deltaNormals,
                                                blendShapes [shapeIndex].frames [frameIndex].deltaTangents);
                    }
                }
            }
            #endregion

            mesh.RecalculateBounds();
            renderer.bones      = bones != null ? bones : skeleton.HashesToTransforms(boneNameHashes);
            renderer.sharedMesh = mesh;
            renderer.rootBone   = rootBone;
        }
コード例 #27
0
ファイル: UMAData.cs プロジェクト: Marwan0/KinectUMAPrototype
 public void ClearBoneData()
 {
     skeleton = null;
 }
コード例 #28
0
        public override void ApplyDNA(UMAData umaData, UMASkeleton skeleton, int dnaTypeHash)
        {
            //Add the reset listeners if we havent already
            //we need this because if 'fastGeneration' is false we may still get another loop
            //and we should not do this again if _dnaAppliedTo contains umaData.gameObject
            if (!_listenersAddedTo.Contains(umaData.gameObject))
            {
                umaData.CharacterUpdated.AddListener(ResetOnCharaterUpdated);
                _listenersAddedTo.Add(umaData.gameObject);
            }

            if (_dnaAppliedTo.Contains(umaData.gameObject))
            {
                return;
            }

            UMADnaBase activeDNA = umaData.GetDna(dnaTypeHash);

            if (activeDNA == null)
            {
                Debug.LogError("Could not get DNA values for: " + this.name);
                return;
            }
            var masterWeightCalc = masterWeight.GetWeight(activeDNA);

            if (masterWeightCalc == 0f)
            {
                return;
            }

            bool needsUpdate = false;

            for (int i = 0; i < _colorSets.Length; i++)
            {
                if (_colorSets[i].modifyingDNA.UsedDNANames.Count == 0 || string.IsNullOrEmpty(_colorSets[i].targetName))
                {
                    continue;
                }
                var targetOverlays = new List <OverlayData>();
                for (int si = 0; si < umaData.umaRecipe.slotDataList.Length; si++)
                {
                    var overlays = umaData.umaRecipe.slotDataList[si].GetOverlayList();
                    for (int oi = 0; oi < overlays.Count; oi++)
                    {
                        if (overlays[oi] != null)
                        {
                            //we can target specific Overlays or SharedColors now
                            if ((overlays[oi].colorData.IsASharedColor && overlays[oi].colorData.name == _colorSets[i].targetName) || overlays[oi].overlayName == _colorSets[i].targetName)
                            {
                                if (!targetOverlays.Contains(overlays[oi]))
                                {
                                    targetOverlays.Add(overlays[oi]);
                                }
                            }
                        }
                    }
                }
                if (targetOverlays.Count == 0)
                {
                    continue;
                }
                if (_colorSets[i].EvaluateAndApplyAdjustments(activeDNA, masterWeightCalc, targetOverlays))
                {
                    needsUpdate = true;
                }
            }

            if (needsUpdate)
            {
                umaData.isTextureDirty = true;
                umaData.isAtlasDirty   = true;
            }
            _dnaAppliedTo.Add(umaData.gameObject);
        }
コード例 #29
0
 public GameObject GetBoneGameObject(string boneName)
 {
     return(GetBoneGameObject(UMASkeleton.StringToHash(boneName)));
 }
コード例 #30
0
 public void UpdateCharacter(UMAData umaData, UMASkeleton skeleton, bool asReset)
 {
     AdjustScale(skeleton);
     UpdateCharacterHeightMassRadius(umaData, skeleton);
 }
コード例 #31
0
        /// <summary>
        /// Updates the characterHeightMassRadius after all other changes have been made by the converters
        /// </summary>
        private void UpdateCharacterHeightMassRadius(UMAData umaData, UMASkeleton skeleton, Bounds newBounds)
        {
            float charHeight = newBounds.size.y;
            float charWidth  = newBounds.size.x;

            if (umaData.umaRecipe.raceData.umaTarget == RaceData.UMATarget.Humanoid)
            {
                //adjusting is only about tweaking the result
                if (_adjustHeight || _adjustRadius)
                {
                    float chinHeight = 0f;
                    float headHeight = 0f;
                    float headWidth  = 0f;

                    UpdateMechanimBoneDict(umaData, skeleton);

                    //character needs to be moved into the root again with no rotation applied
                    var  umaTransform        = umaData.transform;
                    var  originalParent      = umaData.transform.parent;
                    var  originalRot         = umaData.transform.localRotation;
                    var  originalPos         = umaData.transform.localPosition;
                    var  umaCollider         = umaData.gameObject.GetComponent <Collider>();
                    bool prevColliderEnabled = umaCollider != null ? umaCollider.enabled : false;

                    //if there is a collider, disable it before we move anything
                    if (umaCollider)
                    {
                        umaCollider.enabled = false;
                    }

                    umaTransform.SetParent(null, false);
                    umaTransform.localRotation = Quaternion.identity;
                    umaTransform.localPosition = Vector3.zero;

                    if (_adjustHeight)
                    {
                        //Classically a human is apprx 7.5 heads tall, but we only know the height to the base of the head bone
                        //usually head bone is actually usually in line with the lips, making the base of the chin, 1/3rd down the neck
                        //so if we have the optional neck bone use that to estimate the base of the chin
                        chinHeight = skeleton.GetRelativePosition(_mechanimBoneDict["Head"]).y;
                        if (skeleton.BoneExists(_mechanimBoneDict["Neck"]))
                        {
                            chinHeight = skeleton.GetRelativePosition(_mechanimBoneDict["Neck"]).y + (((skeleton.GetRelativePosition(_mechanimBoneDict["Head"]).y - skeleton.GetRelativePosition(_mechanimBoneDict["Neck"]).y) / 3f) * 2f);
                        }
                        //apply the headRatio (by default this is 7.5)
                        chinHeight = (chinHeight / 6.5f) * (_headRatio - 1);
                        //so classically chinbase is 6.5 headHeights from the floor so headHeight is..
                        headHeight = (chinHeight / (_headRatio - 1));
                        //but bobble headed charcaters (toons), children or dwarves etc have bigger heads proportionally
                        //so their overall height will greater than (chinHeight / 6.5) * 7.5
                        //If we have the eyes we can use those to calculate the size of the head better because classically the distance from the chin to the eyes will be half the head height
                        if (skeleton.BoneExists(_mechanimBoneDict["LeftEye"]) || skeleton.BoneExists(_mechanimBoneDict["RightEye"]))
                        {
                            var eyeHeight = 0f;
                            //if we have both eyes get the average
                            if (skeleton.BoneExists(_mechanimBoneDict["LeftEye"]) && skeleton.BoneExists(_mechanimBoneDict["RightEye"]))
                            {
                                eyeHeight = (skeleton.GetRelativePosition(_mechanimBoneDict["LeftEye"]).y + skeleton.GetRelativePosition(_mechanimBoneDict["RightEye"]).y) / 2f;
                            }
                            else if (skeleton.BoneExists(_mechanimBoneDict["LeftEye"]))
                            {
                                eyeHeight = skeleton.GetRelativePosition(_mechanimBoneDict["LeftEye"]).y;
                            }
                            else if (skeleton.BoneExists(_mechanimBoneDict["RightEye"]))
                            {
                                eyeHeight = skeleton.GetRelativePosition(_mechanimBoneDict["RightEye"]).y;
                            }

                            headHeight = ((eyeHeight - chinHeight) * 2f);
                            //because we do this the actual headRatio doesnt *feel* right
                            //i.e. with toon the head ratio is more like 3, but the correct value for calcs is 6.5
                            //I'd prefer it if these calcs made 3 deliver the correct result
                        }

                        //So finally
                        //Debug.Log("chinHeight was " + chinHeight+" headHeight was "+headHeight);
                        //Debug.Log("Classical Height from Head = " + (headHeight * 7.5f));
                        //Debug.Log("Classical Height from Chin = " + ((chinHeight / 6.5f) * 7.5f));
                        charHeight = chinHeight + headHeight;
                    }

                    if (_adjustRadius)
                    {
                        float shouldersWidth = Mathf.Abs(skeleton.GetRelativePosition(_mechanimBoneDict["LeftUpperArm"]).x - skeleton.GetRelativePosition(_mechanimBoneDict["RightUpperArm"]).x);
                        //Also female charcaters tend to have hips wider than their shoulders, so check that
                        float hipsWidth = Mathf.Abs(skeleton.GetRelativePosition(_mechanimBoneDict["LeftUpperLeg"]).x - skeleton.GetRelativePosition(_mechanimBoneDict["RightUpperLeg"]).x);
                        //the outerWidth of the hips is larger than this because the thigh muscles are so big so make this 1/3rd bigger
                        hipsWidth = (hipsWidth / 2) * 3;

                        //classically the width of the body is 3* headwidth for a strong character so headwidth will be
                        headWidth = shouldersWidth / 2.75f;
                        //but bobble headed charcaters (toons), children or dwarves etc have bigger heads proportionally and the head can be wider than the shoulders
                        //so if we have eye bones use them to calculate head with
                        if (skeleton.BoneExists(_mechanimBoneDict["LeftEye"]) && skeleton.BoneExists(_mechanimBoneDict["RightEye"]))
                        {
                            //clasically a face is 5* the width of the eyes where the distance between the pupils is 2 * eye width
                            var eyeWidth = Mathf.Abs(skeleton.GetRelativePosition(_mechanimBoneDict["LeftEye"]).x - skeleton.GetRelativePosition(_mechanimBoneDict["RightEye"]).x) / 2;
                            headWidth = eyeWidth * 5f;
                        }
                        charWidth = (shouldersWidth > headWidth || hipsWidth > headWidth) ? (shouldersWidth > hipsWidth ? shouldersWidth : hipsWidth) : headWidth;
                        //we might also want to take into account the z depth between the hips and the head,
                        //because if the character has been made into a horse or something it might be on all fours (and still be mechanim.Humanoid [if that even works!])
                        //capsule colliders break down in this scenario though (switch race to SkyCar to see what I mean), so would we want to change the orientation of the collider or the type?
                        //does the collider orientation have any impact on physics?
                    }
                    //Set the UMA back
                    umaTransform.SetParent(originalParent, false);
                    umaTransform.localRotation = originalRot;
                    umaTransform.localPosition = originalPos;

                    //set any collider to its original setting
                    if (umaCollider)
                    {
                        umaCollider.enabled = prevColliderEnabled;
                    }
                }
            }
            else             //if its a car or a castle or whatever use the bounds
            {
                charHeight = newBounds.size.y;
                charWidth  = newBounds.size.x;
            }

            //get the scale of the overall scale bone if set
            float overallScale = 1f;

            if (skeleton.GetBoneTransform(_scaleBoneHash) != null)
            {
                overallScale = (skeleton.GetScale(_scaleBoneHash)).x;
            }

            if (_adjustHeight)
            {
                //characterHeight is what we calculated plus any radius y the user has added
                umaData.characterHeight = charHeight * (1 + (_radiusAdjustY * 2));
            }
            else
            {
                umaData.characterHeight = charHeight;
            }

            if (_adjustRadius)
            {
                //characterRadius is the average of the width we calculated plus the z-depth from the bounds / 2
                //we need to include the new _radiusAdjust.y (which is now an adjust for the z axis as radiusAdjustY is now its own field (used for heightAdjust)
                umaData.characterRadius = (charWidth + newBounds.size.z * (_radiusAdjust.x * 2)) / 2;
                //Debug.Log("BCM umaData.characterRadius[" + umaData.characterRadius + "] = (charWidth[" + charWidth + "] + newBounds.size.z[" + newBounds.size.z + "] * (radiusAdjust.x[" + _radiusAdjust.x + "] * 2)) / 2;");
            }
            else
            {
                umaData.characterRadius = (charWidth + newBounds.size.z) / 2;
            }

            if (_adjustMass)
            {
                //characterMass is... what? still dont understand this quite
                var massZModified = (umaData.characterRadius * 2) * overallScale;
                var massYModified = ((1 + _radiusAdjustY) * 0.5f) * overallScale;
                umaData.characterMass = (_massAdjust.x * overallScale) + _massAdjust.y * massYModified + _massAdjust.z * massZModified;
            }
            else
            {
                //HUMANMALE umaData.characterMass[66.68236] = raceMass[50] * overallScale[0.907451] + 28f * umaDna.upperWeight[0.5019608] + 22f * umaDna.lowerWeight[0.3176471]
                umaData.characterMass = 66.68236f;                //? Thats the result
            }
            //in the fixed UMA converters HumanMales mass is actually less than HumanFemales, with this thats solved
            //but the characters are lighter than stock by a about 5 when at they standard size and heaver than stock by about 7 when at max height
            //I dont know how much this matters? It can easily be fixed by tweaking the calcs, I just dont know what the numbers mean again...

            //Debug.Log(umaData.transform.gameObject.name + " umaData.characterMass was "+ umaData.characterMass+" characterHeight was " + umaData.characterHeight + " characterRadius was " + umaData.characterRadius);

#if UNITY_EDITOR
            /*if (_heightDebugToolsEnabled)
             *      AddDebugBoxes(umaData, chinHeight, headHeight, headWidth);
             * else
             *      RemoveDebugBoxes(umaData);*/
#endif
        }
コード例 #32
0
        /// <summary>
        /// Apply the modifiers using the given dna (determined by the typehash)
        /// </summary>
        /// <param name="umaData"></param>
        /// <param name="skeleton"></param>
        /// <param name="dnaTypeHash"></param>
        public override void ApplyDNA(UMAData umaData, UMASkeleton skeleton, int dnaTypeHash)
        {
            var umaDna           = umaData.GetDna(dnaTypeHash);
            var masterWeightCalc = masterWeight.GetWeight(umaDna);

            if (masterWeightCalc == 0f)
            {
                return;
            }
            for (int i = 0; i < _skeletonModifiers.Count; i++)
            {
                _skeletonModifiers[i].umaDNA = umaDna;

                var thisHash = (_skeletonModifiers[i].hash != 0) ? _skeletonModifiers[i].hash : UMAUtils.StringToHash(_skeletonModifiers[i].hashName);

                //check skeleton has the bone we want to change
                if (!skeleton.HasBone(thisHash))
                {
                    //Debug.LogWarning("You were trying to apply skeleton modifications to a bone that didn't exist (" + _skeletonModifiers[i].hashName + ") on " + umaData.gameObject.name);
                    continue;
                }

                //With these ValueX.x is the calculated value and ValueX.y is min and ValueX.z is max
                var thisValueX = _skeletonModifiers[i].CalculateValueX(umaDna);
                var thisValueY = _skeletonModifiers[i].CalculateValueY(umaDna);
                var thisValueZ = _skeletonModifiers[i].CalculateValueZ(umaDna);

                if (_skeletonModifiers[i].property == SkeletonModifier.SkeletonPropType.Position)
                {
                    skeleton.SetPositionRelative(thisHash,
                                                 new Vector3(
                                                     Mathf.Clamp(thisValueX.x, thisValueX.y, thisValueX.z),
                                                     Mathf.Clamp(thisValueY.x, thisValueY.y, thisValueY.z),
                                                     Mathf.Clamp(thisValueZ.x, thisValueZ.y, thisValueZ.z)), masterWeightCalc);
                }
                else if (_skeletonModifiers[i].property == SkeletonModifier.SkeletonPropType.Rotation)
                {
                    skeleton.SetRotationRelative(thisHash,
                                                 Quaternion.Euler(new Vector3(
                                                                      Mathf.Clamp(thisValueX.x, thisValueX.y, thisValueX.z),
                                                                      Mathf.Clamp(thisValueY.x, thisValueY.y, thisValueY.z),
                                                                      Mathf.Clamp(thisValueZ.x, thisValueZ.y, thisValueZ.z))), masterWeightCalc);
                }
                else if (_skeletonModifiers[i].property == SkeletonModifier.SkeletonPropType.Scale)
                {
                    //If there are two sets of skeletonModifiers and both are at 50% it needs to apply them both but the result should be cumulative
                    //so we need to work out the difference this one is making, weight that and add it to the current scale of the bone
                    var scale = new Vector3(
                        Mathf.Clamp(thisValueX.x, thisValueX.y, thisValueX.z),
                        Mathf.Clamp(thisValueY.x, thisValueY.y, thisValueY.z),
                        Mathf.Clamp(thisValueZ.x, thisValueZ.y, thisValueZ.z));
                    //we cant use val.value here because the initial values always need to be applied
                    var defaultVal = SkeletonModifier.skelAddDefaults[SkeletonModifier.SkeletonPropType.Scale].x;
                    var scaleDiff  = new Vector3(scale.x - defaultVal,
                                                 scale.y - defaultVal,
                                                 scale.z - defaultVal);
                    var weightedScaleDiff = scaleDiff * masterWeightCalc;
                    var fullScale         = skeleton.GetScale(_skeletonModifiers[i].hash) + weightedScaleDiff;
                    skeleton.SetScale(thisHash, fullScale);
                }
            }
        }
コード例 #33
0
    public static void UpdateUMAMaleDNABones(UMAData umaData, UMASkeleton skeleton)
    {
        var umaDna = umaData.GetDna<UMADnaHumanoid>();

		skeleton.SetScale(UMASkeleton.StringToHash("HeadAdjust"), 
			new Vector3(
				Mathf.Clamp(1, 1, 1),
				Mathf.Clamp(1 + (umaDna.headWidth - 0.5f) * 0.30f, 0.5f, 1.6f),
				Mathf.Clamp(1 , 1, 1)));

		//umaData.boneList["HeadAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 1, 1),
		//Mathf.Clamp(1 + (umaDna.headWidth - 0.5f) * 0.30f, 0.5f, 1.6f),
		//Mathf.Clamp(1 , 1, 1));
		
		
		skeleton.SetScale(UMASkeleton.StringToHash("NeckAdjust"), 
			new Vector3(
				Mathf.Clamp(1, 0.6f, 2),
				Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 0.80f, 0.5f, 1.6f),
				Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 1.2f, 0.5f, 1.6f)));
		
		//umaData.boneList["NeckAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 0.80f, 0.5f, 1.6f),
		//Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 1.2f, 0.5f, 1.6f));

		
		skeleton.SetScale(UMASkeleton.StringToHash("LeftOuterBreast"), 
			new Vector3(
				Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
				Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
				Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightOuterBreast"), 
		    new Vector3(
				Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
				Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
				Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f)));

		//umaData.boneList["LeftOuterBreast"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f));
		//umaData.boneList["RightOuterBreast"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f));
		
		skeleton.SetScale(UMASkeleton.StringToHash("LeftEye"), 
		    new Vector3(
				Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
				Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
				Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightEye"), 
		    new Vector3(
				Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
				Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
				Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f)));

		//umaData.boneList["LeftEye"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f));
		//umaData.boneList["RightEye"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f),
		//Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f , 0.7f, 1.4f));     

		skeleton.SetRotation(UMASkeleton.StringToHash("LeftEye"),
			Quaternion.Euler(new Vector3((umaDna.eyeRotation - 0.5f) * 20, -90, -180)));
		skeleton.SetRotation(UMASkeleton.StringToHash("RightEye"),
			Quaternion.Euler(new Vector3(-(umaDna.eyeRotation - 0.5f) * 20, -90, -180)));

		//umaData.boneList["LeftEye"].boneTransform.localEulerAngles = new Vector3((umaDna.eyeRotation - 0.5f) * 20, -90, -180);
		//umaData.boneList["RightEye"].boneTransform.localEulerAngles = new Vector3(-(umaDna.eyeRotation - 0.5f) * 20, -90, -180);
	
		skeleton.SetScale(UMASkeleton.StringToHash("Spine1Adjust"), 
		    new Vector3(
				Mathf.Clamp(1, 0.6f, 2),
				Mathf.Clamp(0.9f + (umaDna.upperWeight - 0.5f) * 0.10f + (umaDna.upperMuscle - 0.5f) * 0.5f, 0.45f, 1.50f),
				Mathf.Clamp(0.7f + (umaDna.upperWeight - 0.5f) * 0.45f + (umaDna.upperMuscle - 0.5f) * 0.45f, 0.55f, 1.15f)));

		//umaData.boneList["Spine1Adjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(0.9f + (umaDna.upperWeight - 0.5f) * 0.10f + (umaDna.upperMuscle - 0.5f) * 0.5f, 0.45f, 1.50f),
		//Mathf.Clamp(0.7f + (umaDna.upperWeight - 0.5f) * 0.45f + (umaDna.upperMuscle - 0.5f) * 0.45f, 0.55f, 1.15f));

		skeleton.SetScale(UMASkeleton.StringToHash("SpineAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(0.9f + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.45f, 0.75f, 1.350f),
			  Mathf.Clamp(0.8f + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.75f, 1.350f)));

		//umaData.boneList["SpineAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(0.9f + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.45f, 0.75f, 1.350f),
		//Mathf.Clamp(0.8f + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.75f, 1.350f));

		skeleton.SetScale(UMASkeleton.StringToHash("LowerBackBelly"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 1.0f, 0.35f, 1.75f),
			  Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 0.35f, 0.35f, 1.75f),
			  Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 1.25f, 0.35f, 1.75f)));

		//umaData.boneList["LowerBackBelly"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 1.0f, 0.35f, 1.75f),
		//Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 0.35f, 0.35f, 1.75f),
		//Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 1.25f, 0.35f, 1.75f));

		skeleton.SetScale(UMASkeleton.StringToHash("LowerBackAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f),
			  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.waist - 0.5f) * 0.45f, 0.65f, 1.75f),
			  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f)));

		//umaData.boneList["LowerBackAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.waist - 0.5f) * 0.45f, 0.65f, 1.75f),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftTrapezius"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
			  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
			  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightTrapezius"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
			  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
			  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f)));

		//umaData.boneList["LeftTrapezius"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f));
		//umaData.boneList["RightTrapezius"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftArmAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f),
			  Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightArmAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f),
			  Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f)));

		//umaData.boneList["LeftArmAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f),
		//Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f));
		//umaData.boneList["RightArmAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f),
		//Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftForeArmAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f),
			  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightForeArmAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f),
			  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f)));

		//umaData.boneList["LeftForeArmAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f));
		//umaData.boneList["RightForeArmAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftForeArmTwistAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f),
			  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightForeArmTwistAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f),
			  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f)));

		//umaData.boneList["LeftForeArmTwistAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f));
		//umaData.boneList["RightForeArmTwistAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftShoulderAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f),
			  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightShoulderAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f),
			  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f)));

		//umaData.boneList["LeftShoulderAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f));
		//umaData.boneList["RightShoulderAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f),
		//Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftUpLegAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.45f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.15f),
			  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.45f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.15f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightUpLegAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.45f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.15f),
			  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.45f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.15f)));

		//umaData.boneList["LeftUpLegAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.45f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.15f),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.45f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.15f));
		//umaData.boneList["RightUpLegAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.45f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.15f),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.45f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.15f));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftLegAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.95f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f),
			  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.75f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightLegAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1, 0.6f, 2),
			  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.95f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f),
			  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.75f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f)));

		//umaData.boneList["LeftLegAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.95f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.75f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f));
		//umaData.boneList["RightLegAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1, 0.6f, 2),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.95f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f),
		//Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.75f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftGluteus"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
			  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
			  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightGluteus"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
			  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
			  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f)));
		
		//umaData.boneList["LeftGluteus"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f));
		//umaData.boneList["RightGluteus"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f),
		//Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f , 0.25f, 2.35f));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftEarAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
			  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
			  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightEarAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
			  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
			  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f)));		

		//umaData.boneList["LeftEarAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f));
		//umaData.boneList["RightEarAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f));

		skeleton.SetPosition(UMASkeleton.StringToHash("LeftEarAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftEarAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.01f, -0.01f, 0.01f),
				Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.03f, -0.03f, 0.03f),
				Mathf.Clamp(0 + (umaDna.earsPosition - 0.5f) * 0.02f, -0.02f, 0.02f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightEarAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightEarAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.01f, -0.01f, 0.01f),
				Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * 0.03f, -0.03f, 0.03f),
				Mathf.Clamp(0 + (umaDna.earsPosition - 0.5f) * 0.02f, -0.02f, 0.02f)));

		//umaData.boneList["LeftEarAdjust"].boneTransform.localPosition = umaData.boneList["LeftEarAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.01f, -0.01f, 0.01f),
		//Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.03f, -0.03f, 0.03f),
		//Mathf.Clamp(0 + (umaDna.earsPosition - 0.5f) * 0.02f, -0.02f, 0.02f));
		//umaData.boneList["RightEarAdjust"].boneTransform.localPosition = umaData.boneList["LeftEarAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.01f, -0.01f, 0.01f),
		//Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * 0.03f, -0.03f, 0.03f),
		//Mathf.Clamp(0 + (umaDna.earsPosition - 0.5f) * 0.02f, -0.02f, 0.02f));

		skeleton.SetRotation(UMASkeleton.StringToHash("LeftEarAdjust"),
			Quaternion.Euler(new Vector3(
			  Mathf.Clamp(0, -30, 80),
			  Mathf.Clamp(0, -30, 80),
			  Mathf.Clamp((umaDna.earsRotation - 0.5f) * 40, -15, 40))));
		skeleton.SetRotation(UMASkeleton.StringToHash("RightEarAdjust"),
			Quaternion.Euler(new Vector3(
			  Mathf.Clamp(0, -30, 80),
			  Mathf.Clamp(0, -30, 80),
			  Mathf.Clamp((umaDna.earsRotation - 0.5f) * -40, -40, 15))));

		//umaData.boneList["LeftEarAdjust"].boneTransform.localEulerAngles = new Vector3(
		//Mathf.Clamp(0, -30, 80),
		//Mathf.Clamp(0, -30, 80),
		//Mathf.Clamp((umaDna.earsRotation - 0.5f) * 40, -15, 40));
		//umaData.boneList["RightEarAdjust"].boneTransform.localEulerAngles = new Vector3(
		//Mathf.Clamp(0, -30, 80),
		//Mathf.Clamp(0, -30, 80),
		//Mathf.Clamp((umaDna.earsRotation - 0.5f) * -40, -40, 15));

		skeleton.SetScale(UMASkeleton.StringToHash("NoseBaseAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 1.5f, 0.25f, 3.0f),
			  Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 0.15f + (umaDna.noseWidth - 0.5f) * 1.0f, 0.25f, 3.0f),
			  Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 0.15f + (umaDna.noseFlatten - 0.5f) * 0.75f, 0.25f, 3.0f)));
		skeleton.SetScale(UMASkeleton.StringToHash("NoseMiddleAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 1.5f + (umaDna.noseSize - 0.5f) * 1.0f, 0.5f, 3.0f),
			  Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 0.15f + (umaDna.noseSize - 0.5f) * 0.25f + (umaDna.noseWidth - 0.5f) * 0.5f, 0.5f, 3.0f),
			  Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 0.15f + (umaDna.noseSize - 0.5f) * 0.10f, 0.5f, 3.0f)));
		skeleton.SetRotation(UMASkeleton.StringToHash("NoseBaseAdjust"),
			Quaternion.Euler(new Vector3(
			  Mathf.Clamp(0, -30, 80),
			  Mathf.Clamp((umaDna.noseInclination - 0.5f) * 60, -60, 30),
			  Mathf.Clamp(0, -30, 80))));
		skeleton.SetPosition(UMASkeleton.StringToHash("NoseBaseAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("NoseBaseAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.025f, -0.025f, 0.025f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.025f, -0.025f, 0.025f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("NoseMiddleAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("NoseBaseAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.012f, -0.012f, 0.012f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.015f, -0.015f, 0.015f)));

		//umaData.boneList["NoseBaseAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 1.5f, 0.25f, 3.0f),
		//Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 0.15f + (umaDna.noseWidth - 0.5f) * 1.0f, 0.25f, 3.0f),
		//Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 0.15f + (umaDna.noseFlatten - 0.5f) * 0.75f, 0.25f, 3.0f));
		//umaData.boneList["NoseMiddleAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 1.5f + (umaDna.noseSize - 0.5f) * 1.0f, 0.5f, 3.0f),
		//Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 0.15f + (umaDna.noseSize - 0.5f) * 0.25f + (umaDna.noseWidth - 0.5f) * 0.5f, 0.5f, 3.0f),
		//Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 0.15f + (umaDna.noseSize - 0.5f) * 0.10f, 0.5f, 3.0f));
		//umaData.boneList["NoseBaseAdjust"].boneTransform.localEulerAngles = new Vector3(
		//Mathf.Clamp(0, -30, 80),
		//Mathf.Clamp((umaDna.noseInclination - 0.5f) * 60, -60, 30),
		//Mathf.Clamp(0, -30, 80));
		//umaData.boneList["NoseBaseAdjust"].boneTransform.localPosition = umaData.boneList["NoseBaseAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.025f, -0.025f, 0.025f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.025f, -0.025f, 0.025f));
		//umaData.boneList["NoseMiddleAdjust"].boneTransform.localPosition = umaData.boneList["NoseBaseAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.012f, -0.012f, 0.012f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.015f, -0.015f, 0.015f));

		skeleton.SetPosition(UMASkeleton.StringToHash("LeftNoseAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftNoseAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.025f, -0.025f, 0.025f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.025f, -0.025f, 0.025f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightNoseAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightNoseAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.025f, -0.025f, 0.025f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.025f, -0.025f, 0.025f)));

		//umaData.boneList["LeftNoseAdjust"].boneTransform.localPosition = umaData.boneList["LeftNoseAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.025f, -0.025f, 0.025f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.025f, -0.025f, 0.025f));
		//umaData.boneList["RightNoseAdjust"].boneTransform.localPosition = umaData.boneList["RightNoseAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.025f, -0.025f, 0.025f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.025f, -0.025f, 0.025f));

		skeleton.SetPosition(UMASkeleton.StringToHash("UpperLipsAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("UpperLipsAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.0045f, -0.0045f, 0.0045f)));

		//umaData.boneList["UpperLipsAdjust"].boneTransform.localPosition = umaData.boneList["UpperLipsAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.0045f, -0.0045f, 0.0045f));

		skeleton.SetScale(UMASkeleton.StringToHash("MandibleAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.chinPronounced - 0.5f) * 0.18f, 0.55f, 1.75f),
			  Mathf.Clamp(1 + (umaDna.chinSize - 0.5f) * 1.3f, 0.75f, 1.3f),
			  Mathf.Clamp(1, 0.4f, 1.5f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("MandibleAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("MandibleAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.0125f, 0.0125f),
				Mathf.Clamp(0, -0.0125f, 0.0125f),
				Mathf.Clamp(0 + (umaDna.chinPosition - 0.5f) * 0.0075f, -0.0075f, 0.0075f)));
				
		//umaData.boneList["MandibleAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.chinPronounced - 0.5f) * 0.18f, 0.55f, 1.75f),
		//Mathf.Clamp(1 + (umaDna.chinSize - 0.5f) * 1.3f, 0.75f, 1.3f),
		//Mathf.Clamp(1, 0.4f, 1.5f));
		//umaData.boneList["MandibleAdjust"].boneTransform.localPosition = umaData.boneList["MandibleAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.0125f, 0.0125f),
		//Mathf.Clamp(0, -0.0125f, 0.0125f),
		//Mathf.Clamp(0 + (umaDna.chinPosition - 0.5f) * 0.0075f, -0.0075f, 0.0075f));

		skeleton.SetPosition(UMASkeleton.StringToHash("LeftLowMaxilarAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftLowMaxilarAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.jawsSize - 0.5f) * 0.025f, -0.025f, 0.025f),
				Mathf.Clamp(0 + (umaDna.jawsPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightLowMaxilarAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightLowMaxilarAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.jawsSize - 0.5f) * -0.025f, -0.025f, 0.025f),
				Mathf.Clamp(0 + (umaDna.jawsPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));

		//umaData.boneList["LeftLowMaxilarAdjust"].boneTransform.localPosition = umaData.boneList["LeftLowMaxilarAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.jawsSize - 0.5f) * 0.025f, -0.025f, 0.025f),
		//Mathf.Clamp(0 + (umaDna.jawsPosition - 0.5f) * 0.03f, -0.03f, 0.03f));
		//umaData.boneList["RightLowMaxilarAdjust"].boneTransform.localPosition = umaData.boneList["RightLowMaxilarAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.jawsSize - 0.5f) * -0.025f, -0.025f, 0.025f),
		//Mathf.Clamp(0 + (umaDna.jawsPosition - 0.5f) * 0.03f, -0.03f, 0.03f));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftCheekAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
			  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
			  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightCheekAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
			  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
			  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("LeftCheekAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftCheekAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.cheekPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightCheekAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightCheekAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.cheekPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));

		//umaData.boneList["LeftCheekAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
		//Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
		//Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f));
		//umaData.boneList["RightCheekAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
		//Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
		//Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f));
		//umaData.boneList["LeftCheekAdjust"].boneTransform.localPosition = umaData.boneList["LeftCheekAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.cheekPosition - 0.5f) * 0.03f, -0.03f, 0.03f));
		//umaData.boneList["RightCheekAdjust"].boneTransform.localPosition = umaData.boneList["RightCheekAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.cheekPosition - 0.5f) * 0.03f, -0.03f, 0.03f));

		skeleton.SetPosition(UMASkeleton.StringToHash("LeftLowCheekAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftLowCheekAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.lowCheekPronounced - 0.5f) * -0.07f, -0.07f, 0.07f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.lowCheekPosition - 0.5f) * 0.06f, -0.06f, 0.06f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightLowCheekAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightLowCheekAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.lowCheekPronounced - 0.5f) * -0.07f, -0.07f, 0.07f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.lowCheekPosition - 0.5f) * 0.06f, -0.06f, 0.06f)));

		//umaData.boneList["LeftLowCheekAdjust"].boneTransform.localPosition = umaData.boneList["LeftLowCheekAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.lowCheekPronounced - 0.5f) * -0.07f, -0.07f, 0.07f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.lowCheekPosition - 0.5f) * 0.06f, -0.06f, 0.06f));
		//umaData.boneList["RightLowCheekAdjust"].boneTransform.localPosition = umaData.boneList["RightLowCheekAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.lowCheekPronounced - 0.5f) * -0.07f, -0.07f, 0.07f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.lowCheekPosition - 0.5f) * 0.06f, -0.06f, 0.06f));

		skeleton.SetPosition(UMASkeleton.StringToHash("NoseTopAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("NoseTopAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.025f + (umaDna.foreheadSize - 0.5f) * -0.0015f, -0.015f, 0.0025f)));

		//umaData.boneList["NoseTopAdjust"].boneTransform.localPosition = umaData.boneList["NoseTopAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.025f + (umaDna.foreheadSize - 0.5f) * -0.0015f, -0.015f, 0.0025f));

		skeleton.SetPosition(UMASkeleton.StringToHash("LeftEyebrowLowAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftEyebrowLowAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.02f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.015f, 0.005f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("LeftEyebrowMiddleAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftEyebrowMiddleAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.05f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.025f, 0.005f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("LeftEyebrowUpAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftEyebrowUpAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.007f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.010f, 0.005f)));

		//umaData.boneList["LeftEyebrowLowAdjust"].boneTransform.localPosition = umaData.boneList["LeftEyebrowLowAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.02f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.015f, 0.005f));
		//umaData.boneList["LeftEyebrowMiddleAdjust"].boneTransform.localPosition = umaData.boneList["LeftEyebrowMiddleAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.05f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.025f, 0.005f));
		//umaData.boneList["LeftEyebrowUpAdjust"].boneTransform.localPosition = umaData.boneList["LeftEyebrowUpAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.007f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.010f, 0.005f));

		skeleton.SetPosition(UMASkeleton.StringToHash("RightEyebrowLowAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightEyebrowLowAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.02f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.015f, 0.005f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightEyebrowMiddleAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightEyebrowMiddleAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.05f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.025f, 0.005f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightEyebrowUpAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightEyebrowUpAdjust")) +
		  new Vector3(
				Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.007f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.010f, 0.005f)));

		//umaData.boneList["RightEyebrowLowAdjust"].boneTransform.localPosition = umaData.boneList["RightEyebrowLowAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.02f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.015f, 0.005f));
		//umaData.boneList["RightEyebrowMiddleAdjust"].boneTransform.localPosition = umaData.boneList["RightEyebrowMiddleAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.05f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.025f, 0.005f));
		//umaData.boneList["RightEyebrowUpAdjust"].boneTransform.localPosition = umaData.boneList["RightEyebrowUpAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.007f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.010f, 0.005f));
		
		skeleton.SetScale(UMASkeleton.StringToHash("LipsSuperiorAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
		skeleton.SetScale(UMASkeleton.StringToHash("LipsInferiorAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 1.0f, 0.65f, 1.5f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 1.0f, 0.65f, 1.5f)));

		//umaData.boneList["LipsSuperiorAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f));
		//umaData.boneList["LipsInferiorAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 1.0f, 0.65f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 1.0f, 0.65f, 1.5f));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftLipsSuperiorMiddleAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightLipsSuperiorMiddleAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
		skeleton.SetScale(UMASkeleton.StringToHash("LeftLipsInferiorAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightLipsInferiorAdjust"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
			  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));

		//umaData.boneList["LeftLipsSuperiorMiddleAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f));
		//umaData.boneList["RightLipsSuperiorMiddleAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f));
		//umaData.boneList["LeftLipsInferiorAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f));
		//umaData.boneList["RightLipsInferiorAdjust"].boneTransform.localScale = new Vector3(
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
		//Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f));

		skeleton.SetPosition(UMASkeleton.StringToHash("LipsInferiorAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LipsInferiorAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f)));

		//umaData.boneList["LipsInferiorAdjust"].boneTransform.localPosition = umaData.boneList["LipsInferiorAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f));

		skeleton.SetPosition(UMASkeleton.StringToHash("LeftLipsAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftLipsAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.03f, -0.02f, 0.005f),
				Mathf.Clamp(0, -0.05f, 0.05f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightLipsAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightLipsAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.03f, -0.005f, 0.02f),
				Mathf.Clamp(0, -0.05f, 0.05f)));

		//umaData.boneList["LeftLipsAdjust"].boneTransform.localPosition = umaData.boneList["LeftLipsAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.03f, -0.02f, 0.005f),
		//Mathf.Clamp(0, -0.05f, 0.05f));
		//umaData.boneList["RightLipsAdjust"].boneTransform.localPosition = umaData.boneList["RightLipsAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.03f, -0.005f, 0.02f),
		//Mathf.Clamp(0, -0.05f, 0.05f));

		skeleton.SetPosition(UMASkeleton.StringToHash("LeftLipsSuperiorMiddleAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftLipsSuperiorMiddleAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.007f, -0.02f, 0.005f),
				Mathf.Clamp(0, -0.05f, 0.05f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightLipsSuperiorMiddleAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightLipsSuperiorMiddleAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.007f, -0.005f, 0.02f),
				Mathf.Clamp(0, -0.05f, 0.05f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("LeftLipsInferiorAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftLipsInferiorAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.007f, -0.02f, 0.005f),
				Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightLipsInferiorAdjust"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightLipsInferiorAdjust")) +
		  new Vector3(
				Mathf.Clamp(0, -0.05f, 0.05f),
				Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.007f, -0.005f, 0.02f),
				Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f)));

		//umaData.boneList["LeftLipsSuperiorMiddleAdjust"].boneTransform.localPosition = umaData.boneList["LeftLipsSuperiorMiddleAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.007f, -0.02f, 0.005f),
		//Mathf.Clamp(0, -0.05f, 0.05f));
		//umaData.boneList["RightLipsSuperiorMiddleAdjust"].boneTransform.localPosition = umaData.boneList["RightLipsSuperiorMiddleAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.007f, -0.005f, 0.02f),
		//Mathf.Clamp(0, -0.05f, 0.05f));
		//umaData.boneList["LeftLipsInferiorAdjust"].boneTransform.localPosition = umaData.boneList["LeftLipsInferiorAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.007f, -0.02f, 0.005f),
		//Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f));
		//umaData.boneList["RightLipsInferiorAdjust"].boneTransform.localPosition = umaData.boneList["RightLipsInferiorAdjust"].actualBonePosition + new Vector3(
		//Mathf.Clamp(0, -0.05f, 0.05f),
		//Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.007f, -0.005f, 0.02f),
		//Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f));


		////Bone structure change	
		skeleton.SetScale(UMASkeleton.StringToHash("Global"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.height - 0.5f) * 1.0f + (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f),
			  Mathf.Clamp(1 + (umaDna.height - 0.5f) * 1.0f + (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f),
			  Mathf.Clamp(1 + (umaDna.height - 0.5f) * 1.0f + (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f)));

		//umaData.ChangeBoneScale("Global",
		//new Vector3(
		//Mathf.Clamp(1 + (umaDna.height - 0.5f) * 1.0f + (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f),
		//Mathf.Clamp(1 + (umaDna.height - 0.5f) * 1.0f + (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f),
		//Mathf.Clamp(1 + (umaDna.height - 0.5f) * 1.0f + (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f)));

		skeleton.SetPosition(UMASkeleton.StringToHash("Position"),
			skeleton.GetPosition(UMASkeleton.StringToHash("Position")) +
		  new Vector3(
				Mathf.Clamp((umaDna.feetSize - 0.5f) * -0.27f, -0.15f, 0.0675f),
				Mathf.Clamp(0, -10, 10),
				Mathf.Clamp(0, -10, 10)));
	
		//umaData.ChangeBoneMoveRelative("Position", new Vector3(
		//Mathf.Clamp((umaDna.feetSize - 0.5f) * -0.27f, -0.15f, 0.0675f),
		//Mathf.Clamp(0, -10, 10),
		//Mathf.Clamp(0, -10, 10)));

		skeleton.SetScale(UMASkeleton.StringToHash("LowerBack"), 
		  new Vector3(
			  Mathf.Clamp(1 - (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f),
			  Mathf.Clamp(1 - (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f),
			  Mathf.Clamp(1 - (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f)));

		//umaData.ChangeBoneScale("LowerBack",
		//new Vector3(
		//Mathf.Clamp(1 - (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f),
		//Mathf.Clamp(1 - (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f),
		//Mathf.Clamp(1 - (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f)));

		skeleton.SetScale(UMASkeleton.StringToHash("Head"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2),
			  Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2),
			  Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2)));

		//umaData.ChangeBoneScale("Head",
		//new Vector3(
		//Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2),
		//Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2),
		//Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2)));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftArm"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightArm"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f)));

		//umaData.ChangeBoneScale("LeftArm",
		//new Vector3(
		//Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f)));
		//umaData.ChangeBoneScale("RightArm",
		//new Vector3(
		//Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f)));
		
		skeleton.SetScale(UMASkeleton.StringToHash("LeftForeArm"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightForeArm"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f)));

		//umaData.ChangeBoneScale("LeftForeArm",
		//new Vector3(
		//Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f)));
		//umaData.ChangeBoneScale("RightForeArm",
		//new Vector3(
		//Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f)));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftHand"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightHand"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f)));

		//umaData.ChangeBoneScale("LeftHand",
		//new Vector3(
		//Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f)));
		//umaData.ChangeBoneScale("RightHand",
		//new Vector3(
		//Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f)));

		skeleton.SetScale(UMASkeleton.StringToHash("LeftFoot"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f)));
		skeleton.SetScale(UMASkeleton.StringToHash("RightFoot"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
			  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f)));

		//umaData.ChangeBoneScale("LeftFoot",
		//new Vector3(
		//Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f)));
		//umaData.ChangeBoneScale("RightFoot",
		//new Vector3(
		//Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
		//Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f)));
		
		skeleton.SetPosition(UMASkeleton.StringToHash("LeftUpLeg"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftUpLeg")) +
		  new Vector3(
				Mathf.Clamp(0, -10, 10),
				Mathf.Clamp((umaDna.legSeparation - 0.5f) * -0.15f + (umaDna.lowerWeight - 0.5f) * -0.035f + (umaDna.legsSize - 0.5f) * 0.1f, -0.025f, 0.025f),
				Mathf.Clamp(0, -10, 10)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightUpLeg"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightUpLeg")) +
		  new Vector3(
				Mathf.Clamp(0, -10, 10),
				Mathf.Clamp((umaDna.legSeparation - 0.5f) * 0.15f + (umaDna.lowerWeight - 0.5f) * 0.035f + (umaDna.legsSize - 0.5f) * -0.1f, -0.025f, 0.025f),
				Mathf.Clamp(0, -10, 10)));
		
		//umaData.ChangeBoneMoveRelative("LeftUpLeg",new Vector3(
		//Mathf.Clamp(0, -10, 10),
		//Mathf.Clamp((umaDna.legSeparation - 0.5f) * -0.15f + (umaDna.lowerWeight - 0.5f) * -0.035f + (umaDna.legsSize - 0.5f) * 0.1f, -0.025f, 0.025f),
		//Mathf.Clamp(0, -10, 10)));
		//umaData.ChangeBoneMoveRelative("RightUpLeg",new Vector3(
		//Mathf.Clamp(0, -10, 10),
		//Mathf.Clamp((umaDna.legSeparation - 0.5f) * 0.15f + (umaDna.lowerWeight - 0.5f) * 0.035f + (umaDna.legsSize - 0.5f) * -0.1f, -0.025f, 0.025f),
		//Mathf.Clamp(0, -10, 10)));

		skeleton.SetPosition(UMASkeleton.StringToHash("LeftShoulder"),
			skeleton.GetPosition(UMASkeleton.StringToHash("LeftShoulder")) +
		  new Vector3(
				Mathf.Clamp(0, -10, 10),
				Mathf.Clamp(0.003f + (umaDna.upperMuscle - 0.5f) * -0.265f, -0.085f, 0.015f),
				Mathf.Clamp(0, -10, 10)));
		skeleton.SetPosition(UMASkeleton.StringToHash("RightShoulder"),
			skeleton.GetPosition(UMASkeleton.StringToHash("RightShoulder")) +
		  new Vector3(
				Mathf.Clamp(0, -10, 10),
				Mathf.Clamp(0.003f + (umaDna.upperMuscle - 0.5f) * 0.265f, -0.015f, 0.085f),
				Mathf.Clamp(0, -10, 10)));
				
		//umaData.ChangeBoneMoveRelative("LeftShoulder", new Vector3(
		//Mathf.Clamp(0, -10, 10),
		//Mathf.Clamp(0.003f + (umaDna.upperMuscle - 0.5f) * -0.265f, -0.085f, 0.015f),
		//Mathf.Clamp(0, -10, 10)));
		//umaData.ChangeBoneMoveRelative("RightShoulder",new Vector3(
		//Mathf.Clamp(0, -10, 10),
		//Mathf.Clamp(0.003f + (umaDna.upperMuscle - 0.5f) * 0.265f, -0.015f, 0.085f),
		//Mathf.Clamp(0, -10, 10)));

		skeleton.SetScale(UMASkeleton.StringToHash("Mandible"), 
		  new Vector3(
			  Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f),
			  Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f),
			  Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f)));

		//umaData.ChangeBoneScale("Mandible",
		//new Vector3(
		//Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f),
		//Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f)));
    }
コード例 #34
0
        /// <summary>
        /// Adjusts a skeleton to reflect the DNA values from UMA character data.
        /// </summary>
        /// <remarks>
        /// This will set the postion, rotation, and scale of the various adjustment
        /// bones used by the UMA human rigs to generate a unique character shape.
        /// Also calculates a somewhat realistic mass for the character and the
        /// height and radius of their default collider.
        /// </remarks>
        /// <param name="umaData">UMA data.</param>
        /// <param name="skeleton">Skeleton.</param>
        public static void UpdateUMAFemaleDNABones(UMAData umaData, UMASkeleton skeleton)
        {
            var umaDna = umaData.GetDna <UMADnaHumanoid>();

            skeleton.SetScale(headAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 1, 1),
                                  Mathf.Clamp(1 + (umaDna.headWidth - 0.5f) * 0.30f, 0.5f, 1.6f),
                                  Mathf.Clamp(1, 1, 1)));

            skeleton.SetScale(neckAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 0.80f, 0.5f, 1.6f),
                                  Mathf.Clamp(1 + (umaDna.neckThickness - 0.5f) * 1.2f, 0.5f, 1.6f)));

            skeleton.SetScale(leftOuterBreastHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f)));
            skeleton.SetScale(rightOuterBreastHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.breastSize - 0.5f) * 1.50f + (umaDna.upperWeight - 0.5f) * 0.10f, 0.6f, 1.5f)));

            skeleton.SetScale(leftEyeHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f, 0.7f, 1.4f),
                                  Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f, 0.7f, 1.4f),
                                  Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f, 0.7f, 1.4f)));
            skeleton.SetScale(rightEyeHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f, 0.7f, 1.4f),
                                  Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f, 0.7f, 1.4f),
                                  Mathf.Clamp(1 + (umaDna.eyeSize - 0.5f) * 0.3f, 0.7f, 1.4f)));

            skeleton.SetRotation(leftEyeAdjustHash,
                                 Quaternion.Euler(new Vector3((umaDna.eyeRotation - 0.5f) * 20, 0, 0)));
            skeleton.SetRotation(rightEyeAdjustHash,
                                 Quaternion.Euler(new Vector3(-(umaDna.eyeRotation - 0.5f) * 20, 0, 0)));

            skeleton.SetScale(spine1AdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.10f + (umaDna.upperMuscle - 0.5f) * 0.15f, 0.75f, 1.10f),
                                  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.10f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.85f, 1.00f)));

            skeleton.SetScale(spineAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.85f, 1.350f),
                                  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.upperMuscle - 0.5f) * 0.25f, 0.85f, 1.450f)));

            skeleton.SetScale(lowerBackBellyHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 1.75f, 0.35f, 1.75f),
                                  Mathf.Clamp(1 + (umaDna.waist - 0.5f) * 1.75f, 0.35f, 1.75f),
                                  Mathf.Clamp(1 + (umaDna.belly - 0.5f) * 3.00f, 0.35f, 3.0f)));

            skeleton.SetScale(lowerBackAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.25f + (umaDna.lowerWeight - 0.5f) * 0.15f, 0.85f, 1.5f)));

            skeleton.SetScale(leftTrapeziusHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
                                  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
                                  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f)));
            skeleton.SetScale(rightTrapeziusHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
                                  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f),
                                  Mathf.Clamp(1 + (umaDna.upperMuscle - 0.5f) * 1.35f, 0.65f, 1.35f)));

            skeleton.SetScale(leftArmAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f),
                                  Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f)));
            skeleton.SetScale(rightArmAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f),
                                  Mathf.Clamp(1 + (umaDna.armWidth - 0.5f) * 0.65f, 0.65f, 1.65f)));

            skeleton.SetScale(leftForeArmAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f),
                                  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f)));
            skeleton.SetScale(rightForeArmAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f),
                                  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.65f, 0.75f, 1.25f)));

            skeleton.SetScale(leftForeArmTwistAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f),
                                  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f)));
            skeleton.SetScale(rightForeArmTwistAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f),
                                  Mathf.Clamp(1 + (umaDna.forearmWidth - 0.5f) * 0.35f, 0.75f, 1.25f)));

            skeleton.SetScale(leftShoulderAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f),
                                  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f)));
            skeleton.SetScale(rightShoulderAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f),
                                  Mathf.Clamp(1 + (umaDna.upperWeight - 0.5f) * 0.35f + (umaDna.upperMuscle - 0.5f) * 0.55f, 0.75f, 1.25f)));

            skeleton.SetScale(leftUpLegAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f),
                                  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f)));
            skeleton.SetScale(rightUpLegAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f),
                                  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.65f + (umaDna.lowerMuscle - 0.5f) * 0.15f - (umaDna.legsSize - 0.5f), 0.45f, 1.35f)));

            skeleton.SetScale(leftLegAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.95f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f),
                                  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.75f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f)));
            skeleton.SetScale(rightLegAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1, 0.6f, 2),
                                  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.95f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f),
                                  Mathf.Clamp(1 + (umaDna.lowerWeight - 0.5f) * 0.15f + (umaDna.lowerMuscle - 0.5f) * 0.75f - (umaDna.legsSize - 0.5f), 0.65f, 1.45f)));

            skeleton.SetScale(leftGluteusHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f, 0.25f, 2.35f),
                                  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f, 0.25f, 2.35f),
                                  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f, 0.25f, 2.35f)));
            skeleton.SetScale(rightGluteusHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f, 0.25f, 2.35f),
                                  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f, 0.25f, 2.35f),
                                  Mathf.Clamp(1 + (umaDna.gluteusSize - 0.5f) * 1.35f, 0.25f, 2.35f)));

            skeleton.SetScale(leftEarAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f)));
            skeleton.SetScale(rightEarAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.earsSize - 0.5f) * 1.0f, 0.75f, 1.5f)));

            skeleton.SetPositionRelative(leftEarAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.01f, -0.01f, 0.01f),
                                             Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.03f, -0.03f, 0.03f),
                                             Mathf.Clamp(0 + (umaDna.earsPosition - 0.5f) * 0.02f, -0.02f, 0.02f)));
            skeleton.SetPositionRelative(rightEarAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * -0.01f, -0.01f, 0.01f),
                                             Mathf.Clamp(0 + (umaDna.headWidth - 0.5f) * 0.03f, -0.03f, 0.03f),
                                             Mathf.Clamp(0 + (umaDna.earsPosition - 0.5f) * 0.02f, -0.02f, 0.02f)));

            skeleton.SetRotation(leftEarAdjustHash,
                                 Quaternion.Euler(new Vector3(
                                                      Mathf.Clamp(0, -30, 80),
                                                      Mathf.Clamp(0, -30, 80),
                                                      Mathf.Clamp((umaDna.earsRotation - 0.5f) * 40, -15, 40))));
            skeleton.SetRotation(rightEarAdjustHash,
                                 Quaternion.Euler(new Vector3(
                                                      Mathf.Clamp(0, -30, 80),
                                                      Mathf.Clamp(0, -30, 80),
                                                      Mathf.Clamp((umaDna.earsRotation - 0.5f) * -40, -40, 15))));

            skeleton.SetScale(noseBaseAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 1.5f, 0.4f, 3.0f),
                                  Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 0.15f + (umaDna.noseWidth - 0.5f) * 1.0f, 0.25f, 3.0f),
                                  Mathf.Clamp(1 + (umaDna.noseSize - 0.5f) * 0.15f + (umaDna.noseFlatten - 0.5f) * 0.75f, 0.25f, 3.0f)));
            skeleton.SetScale(noseMiddleAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 1.9f + (umaDna.noseSize - 0.5f) * 1.0f, 0.5f, 3.0f),
                                  Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 0.15f + (umaDna.noseSize - 0.5f) * 0.25f + (umaDna.noseWidth - 0.5f) * 0.5f, 0.5f, 3.0f),
                                  Mathf.Clamp(1 + (umaDna.noseCurve - 0.5f) * 0.15f + (umaDna.noseSize - 0.5f) * 0.10f, 0.5f, 3.0f)));
            skeleton.SetRotation(noseBaseAdjustHash,
                                 Quaternion.Euler(new Vector3(
                                                      Mathf.Clamp(0, -30, 80),
                                                      Mathf.Clamp((umaDna.noseInclination - 0.5f) * 60, -60, 30),
                                                      Mathf.Clamp(0, -30, 80))));
            skeleton.SetPositionRelative(noseBaseAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.0125f, -0.025f, 0.025f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.0125f, -0.025f, 0.025f)));
            skeleton.SetPositionRelative(noseMiddleAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.006f, -0.012f, 0.012f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.007f, -0.015f, 0.015f)));

            skeleton.SetPositionRelative(leftNoseAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.0125f, -0.025f, 0.025f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.0125f, -0.025f, 0.025f)));
            skeleton.SetPositionRelative(rightNoseAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.nosePronounced - 0.5f) * -0.0125f, -0.025f, 0.025f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.0125f, -0.025f, 0.025f)));

            skeleton.SetPositionRelative(upperLipsAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.nosePosition - 0.5f) * 0.0045f, -0.0045f, 0.0045f)));

            skeleton.SetScale(mandibleAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.chinPronounced - 0.5f) * 0.18f, 0.55f, 1.75f),
                                  Mathf.Clamp(1 + (umaDna.chinSize - 0.5f) * 1.3f, 0.75f, 1.3f),
                                  Mathf.Clamp(1, 0.4f, 1.5f)));
            skeleton.SetPositionRelative(mandibleAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.0125f, 0.0125f),
                                             Mathf.Clamp(0, -0.0125f, 0.0125f),
                                             Mathf.Clamp(0 + (umaDna.chinPosition - 0.5f) * 0.0075f, -0.0075f, 0.0075f)));

            skeleton.SetPositionRelative(leftLowMaxilarAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.jawsSize - 0.5f) * 0.025f, -0.025f, 0.025f),
                                             Mathf.Clamp(0 + (umaDna.jawsPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));
            skeleton.SetPositionRelative(rightLowMaxilarAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.jawsSize - 0.5f) * -0.025f, -0.025f, 0.025f),
                                             Mathf.Clamp(0 + (umaDna.jawsPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));

            skeleton.SetScale(leftCheekAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
                                  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
                                  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f)));
            skeleton.SetScale(rightCheekAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
                                  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f),
                                  Mathf.Clamp(1 + (umaDna.cheekSize - 0.5f) * 1.05f, 0.35f, 2.05f)));
            skeleton.SetPositionRelative(leftCheekAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.cheekPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));
            skeleton.SetPositionRelative(rightCheekAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.cheekPosition - 0.5f) * 0.03f, -0.03f, 0.03f)));

            skeleton.SetPositionRelative(leftLowCheekAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.lowCheekPronounced - 0.5f) * -0.035f, -0.07f, 0.035f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.lowCheekPosition - 0.5f) * 0.06f, -0.06f, 0.06f)));
            skeleton.SetPositionRelative(rightLowCheekAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.lowCheekPronounced - 0.5f) * -0.035f, -0.07f, 0.035f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.lowCheekPosition - 0.5f) * 0.06f, -0.06f, 0.06f)));

            skeleton.SetPositionRelative(noseTopAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.025f + (umaDna.foreheadSize - 0.5f) * -0.0015f, -0.015f, 0.0025f)));

            skeleton.SetPositionRelative(leftEyebrowLowAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.02f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.015f, 0.005f)));
            skeleton.SetPositionRelative(leftEyebrowMiddleAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.04f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.025f, 0.005f)));
            skeleton.SetPositionRelative(leftEyebrowUpAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.007f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.010f, 0.005f)));

            skeleton.SetPositionRelative(rightEyebrowLowAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.02f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.015f, 0.005f)));
            skeleton.SetPositionRelative(rightEyebrowMiddleAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.04f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.025f, 0.005f)));
            skeleton.SetPositionRelative(rightEyebrowUpAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0 + (umaDna.foreheadSize - 0.5f) * -0.015f, -0.025f, 0.005f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.foreheadPosition - 0.5f) * -0.007f + (umaDna.foreheadSize - 0.5f) * -0.005f, -0.010f, 0.005f)));

            skeleton.SetScale(lipsSuperiorAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
            skeleton.SetScale(lipsInferiorAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 1.0f, 0.65f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 1.0f, 0.65f, 1.5f)));

            skeleton.SetScale(leftLipsSuperiorMiddleAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
            skeleton.SetScale(rightLipsSuperiorMiddleAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
            skeleton.SetScale(leftLipsInferiorAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));
            skeleton.SetScale(rightLipsInferiorAdjustHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.05f, 1.0f, 1.05f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f),
                                  Mathf.Clamp(1 + (umaDna.lipsSize - 0.5f) * 0.9f, 0.65f, 1.5f)));

            skeleton.SetPositionRelative(lipsInferiorAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f)));

            skeleton.SetPositionRelative(leftLipsAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.03f, -0.02f, 0.005f),
                                             Mathf.Clamp(0, -0.05f, 0.05f)));
            skeleton.SetPositionRelative(rightLipsAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.03f, -0.005f, 0.02f),
                                             Mathf.Clamp(0, -0.05f, 0.05f)));

            skeleton.SetPositionRelative(leftLipsSuperiorMiddleAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.007f, -0.02f, 0.005f),
                                             Mathf.Clamp(0, -0.05f, 0.05f)));
            skeleton.SetPositionRelative(rightLipsSuperiorMiddleAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.007f, -0.005f, 0.02f),
                                             Mathf.Clamp(0, -0.05f, 0.05f)));
            skeleton.SetPositionRelative(leftLipsInferiorAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * 0.007f, -0.02f, 0.005f),
                                             Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f)));
            skeleton.SetPositionRelative(rightLipsInferiorAdjustHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -0.05f, 0.05f),
                                             Mathf.Clamp(0 + (umaDna.mouthSize - 0.5f) * -0.007f, -0.005f, 0.02f),
                                             Mathf.Clamp(0 + (umaDna.lipsSize - 0.5f) * -0.008f, -0.1f, 0.1f)));


            ////Bone structure change
            float overallScale = 0.81f + (umaDna.height - 0.5f) * 1.0f + (umaDna.legsSize - 0.5f) * 1.0f;

            overallScale = Mathf.Clamp(overallScale, 0.4f, 1.8f);
            skeleton.SetScale(positionHash, new Vector3(overallScale, overallScale, overallScale));

            skeleton.SetPositionRelative(positionHash,
                                         new Vector3(
                                             Mathf.Clamp((umaDna.feetSize - 0.5f) * -0.17f, -0.15f, 0.0675f),
                                             Mathf.Clamp(0, -10, 10),
                                             Mathf.Clamp(0, -10, 10)));

            float lowerBackScale = Mathf.Clamp(1 - (umaDna.legsSize - 0.5f) * 1.0f, 0.5f, 3.0f);

            skeleton.SetScale(lowerBackHash, new Vector3(lowerBackScale, lowerBackScale, lowerBackScale));

            skeleton.SetScale(headHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2),
                                  Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2),
                                  Mathf.Clamp(1 + (umaDna.headSize - 0.5f) * 2.0f, 0.5f, 2)));

            skeleton.SetScale(leftArmHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f)));
            skeleton.SetScale(rightArmHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.armLength - 0.5f) * 2.0f, 0.5f, 2.0f)));

            skeleton.SetScale(leftForeArmHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f)));
            skeleton.SetScale(rightForeArmHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.forearmLength - 0.5f) * 2.0f, 0.5f, 2.0f)));

            skeleton.SetScale(leftHandHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f)));
            skeleton.SetScale(rightHandHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.handsSize - 0.5f) * 2.0f, 0.5f, 2.0f)));

            skeleton.SetScale(leftFootHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f)));
            skeleton.SetScale(rightFootHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f),
                                  Mathf.Clamp(1 + (umaDna.feetSize - 0.5f) * 2.0f, 0.5f, 2.0f)));

            skeleton.SetPositionRelative(leftUpLegHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -10, 10),
                                             Mathf.Clamp((umaDna.legSeparation - 0.5f) * -0.15f + (umaDna.lowerWeight - 0.5f) * -0.035f + (umaDna.legsSize - 0.5f) * 0.1f, -0.055f, 0.055f),
                                             Mathf.Clamp(0, -10, 10)));
            skeleton.SetPositionRelative(rightUpLegHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -10, 10),
                                             Mathf.Clamp((umaDna.legSeparation - 0.5f) * 0.15f + (umaDna.lowerWeight - 0.5f) * 0.035f + (umaDna.legsSize - 0.5f) * -0.1f, -0.055f, 0.055f),
                                             Mathf.Clamp(0, -10, 10)));

            skeleton.SetPositionRelative(leftShoulderHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -10, 10),
                                             Mathf.Clamp((umaDna.upperMuscle - 0.5f) * -0.0235f, -0.025f, 0.015f),
                                             Mathf.Clamp(0, -10, 10)));
            skeleton.SetPositionRelative(rightShoulderHash,
                                         new Vector3(
                                             Mathf.Clamp(0, -10, 10),
                                             Mathf.Clamp((umaDna.upperMuscle - 0.5f) * 0.0235f, -0.015f, 0.025f),
                                             Mathf.Clamp(0, -10, 10)));

            skeleton.SetScale(mandibleHash,
                              new Vector3(
                                  Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f),
                                  Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f),
                                  Mathf.Clamp(1 + (umaDna.mandibleSize - 0.5f) * 0.35f, 0.35f, 1.35f)));

            float raceHeight = umaData.umaRecipe.raceData.raceHeight;
            float raceRadius = umaData.umaRecipe.raceData.raceRadius;
            float raceMass   = umaData.umaRecipe.raceData.raceMass;

            umaData.characterHeight = raceHeight * overallScale * (0.425f + 0.6f * lowerBackScale) + ((umaDna.feetSize - 0.5f) * 0.20f);
            umaData.characterRadius = raceRadius + ((umaDna.height - 0.5f) * 0.32f) + ((umaDna.upperMuscle - 0.5f) * 0.01f);
            umaData.characterMass   = raceMass * overallScale + 28f * umaDna.upperWeight + 22f * umaDna.lowerWeight;
        }
コード例 #35
0
        /// <summary>
        /// Applies the data to a Unity mesh.
        /// </summary>
        /// <param name="renderer">Target renderer.</param>
        /// <param name="skeleton">Skeleton.</param>
        public void ApplyDataToUnityMesh(SkinnedMeshRenderer renderer, UMASkeleton skeleton)
        {
            if (renderer == null)
            {
                if (Debug.isDebugBuild)
                {
                    Debug.LogError("Renderer is null!");
                }
                return;
            }

            CreateTransforms(skeleton);

            Mesh mesh = renderer.sharedMesh;

#if UNITY_EDITOR
#if UNITY_2018_3_OR_NEWER
            if (UnityEditor.PrefabUtility.IsAddedComponentOverride(renderer))
            {
                if (Debug.isDebugBuild)
                {
                    Debug.LogError("Cannot apply changes to prefab!");
                }
            }
#else
            if (UnityEditor.PrefabUtility.IsComponentAddedToPrefabInstance(renderer))
            {
                if (Debug.isDebugBuild)
                {
                    Debug.LogError("Cannot apply changes to prefab!");
                }
            }
#endif
            if (UnityEditor.AssetDatabase.IsSubAsset(mesh))
            {
                if (Debug.isDebugBuild)
                {
                    Debug.LogError("Cannot apply changes to asset mesh!");
                }
            }
#endif
            mesh.subMeshCount = 1;
            mesh.triangles    = new int[0];

            if (OwnSharedBuffers())
            {
                ApplySharedBuffers(mesh);
            }
            else
            {
                mesh.vertices    = vertices;
                mesh.boneWeights = unityBoneWeights != null ? unityBoneWeights : UMABoneWeight.Convert(boneWeights);
                mesh.normals     = normals;
                mesh.tangents    = tangents;
                mesh.uv          = uv;
                mesh.uv2         = uv2;
                mesh.uv3         = uv3;
                mesh.uv4         = uv4;
                mesh.colors32    = colors32;
            }
            mesh.bindposes = bindPoses;

            var subMeshCount = submeshes.Length;
            mesh.subMeshCount = subMeshCount;
            for (int i = 0; i < subMeshCount; i++)
            {
                bool sharedBuffer = false;
                for (int j = 0; j < gSubmeshTris.Length; j++)
                {
                    if (gSubmeshTriIndices[j] == i)
                    {
                        sharedBuffer = true;
                        mesh.SetTriangles(gSubmeshTris[j], i);
                        gSubmeshTriIndices[j] = UNUSED_SUBMESH;
                        break;
                    }
                }

                if (!sharedBuffer)
                {
                    mesh.SetTriangles(submeshes[i].triangles, i);
                }
            }

            //Apply the blendshape data from the slot asset back to the combined UMA unity mesh.
            #region Blendshape
            mesh.ClearBlendShapes();
            if (blendShapes != null && blendShapes.Length > 0)
            {
                for (int shapeIndex = 0; shapeIndex < blendShapes.Length; shapeIndex++)
                {
                    if (blendShapes [shapeIndex] == null)
                    {
                        //Debug.LogError ("blendShapes [shapeIndex] == null!");
                        //No longer an error, this will be null if the blendshape got baked.
                        break;
                    }

                    for (int frameIndex = 0; frameIndex < blendShapes[shapeIndex].frames.Length; frameIndex++)
                    {
                        //There might be an extreme edge case where someone has the same named blendshapes on different meshes that end up on different renderers.
                        string name = blendShapes[shapeIndex].shapeName;

                        float     frameWeight   = blendShapes[shapeIndex].frames[frameIndex].frameWeight;
                        Vector3[] deltaVertices = blendShapes[shapeIndex].frames[frameIndex].deltaVertices;
                        Vector3[] deltaNormals  = blendShapes[shapeIndex].frames[frameIndex].deltaNormals;
                        Vector3[] deltaTangents = blendShapes[shapeIndex].frames[frameIndex].deltaTangents;

                        if (UMABlendFrame.isAllZero(deltaNormals))
                        {
                            deltaNormals = null;
                        }

                        if (UMABlendFrame.isAllZero(deltaTangents))
                        {
                            deltaTangents = null;
                        }

                        mesh.AddBlendShapeFrame(name, frameWeight, deltaVertices, deltaNormals, deltaTangents);
                    }
                }
            }
            #endregion

            mesh.RecalculateBounds();
            renderer.bones      = bones != null ? bones : skeleton.HashesToTransforms(boneNameHashes);
            renderer.sharedMesh = mesh;
            renderer.rootBone   = rootBone;

            if (clothSkinning != null && clothSkinning.Length > 0)
            {
                Cloth cloth = renderer.GetComponent <Cloth>();
                if (cloth != null)
                {
                    GameObject.DestroyImmediate(cloth);
                    cloth = null;
                }

                cloth = renderer.gameObject.AddComponent <Cloth>();
                UMAPhysicsAvatar physicsAvatar = renderer.gameObject.GetComponentInParent <UMAPhysicsAvatar>();
                if (physicsAvatar != null)
                {
                    cloth.sphereColliders  = physicsAvatar.SphereColliders.ToArray();
                    cloth.capsuleColliders = physicsAvatar.CapsuleColliders.ToArray();
                }

                cloth.coefficients = clothSkinning;
            }
        }
コード例 #36
0
        public void UpdateDynamicUMADnaBones(UMAData umaData, UMASkeleton skeleton, bool asReset = false)
        {
            UMADnaBase umaDna;

            //need to use the typehash
            umaDna = umaData.GetDna(DNATypeHash);

            if (umaDna == null || asReset == true)
            {
                umaDna = null;
            }
            //Make the DNAAssets match if they dont already...
            if (umaDna != null)
            {
                if (((DynamicUMADnaBase)umaDna).dnaAsset != dnaAsset)
                {
                    ((DynamicUMADnaBase)umaDna).dnaAsset = dnaAsset;
                }
            }
            float overallScaleCalc = 0;

            //float lowerBackScale = 0;
            //bool overallScaleFound = false;
            //bool lowerBackScaleFound = false;

            for (int i = 0; i < skeletonModifiers.Count; i++)
            {
                skeletonModifiers[i].umaDNA = umaDna;
                var thisHash = (skeletonModifiers[i].hash != 0) ? skeletonModifiers[i].hash : GetHash(skeletonModifiers[i].hashName);
                //With these ValueX.x is the calculated value and ValueX.y is min and ValueX.z is max
                var thisValueX = skeletonModifiers[i].ValueX;
                var thisValueY = skeletonModifiers[i].ValueY;
                var thisValueZ = skeletonModifiers[i].ValueZ;
                if (skeletonModifiers[i].hashName == "Position" && skeletonModifiers[i].property == SkeletonModifier.SkeletonPropType.Scale)
                {
                    //TODO eli added something for overall scale to RaceData- whats that supposed to do?
                    var calcVal = thisValueX.x - skeletonModifiers[i].valuesX.val.value + overallScale;
                    overallScaleCalc = Mathf.Clamp(calcVal, thisValueX.y, thisValueX.z);
                    skeleton.SetScale(skeletonModifiers[i].hash, new Vector3(overallScaleCalc, overallScaleCalc, overallScaleCalc));
                    //overallScaleFound = true;
                    //Debug.Log("overallScaleCalc was " + overallScaleCalc);
                }

                /*else if (skeletonModifiers[i].hashName == "LowerBack" && skeletonModifiers[i].property == SkeletonModifier.SkeletonPropType.Scale)
                 * {
                 *  lowerBackScale = Mathf.Clamp(thisValueX.x, thisValueX.y, thisValueX.z);
                 *  skeleton.SetScale(skeletonModifiers[i].hash, new Vector3(lowerBackScale, lowerBackScale, lowerBackScale));
                 *  lowerBackScaleFound = true;
                 * }*/
                else if (skeletonModifiers[i].property == SkeletonModifier.SkeletonPropType.Position)
                {
                    skeleton.SetPositionRelative(thisHash,
                                                 new Vector3(
                                                     Mathf.Clamp(thisValueX.x, thisValueX.y, thisValueX.z),
                                                     Mathf.Clamp(thisValueY.x, thisValueY.y, thisValueY.z),
                                                     Mathf.Clamp(thisValueZ.x, thisValueZ.y, thisValueZ.z)));
                }
                else if (skeletonModifiers[i].property == SkeletonModifier.SkeletonPropType.Rotation)
                {
                    skeleton.SetRotationRelative(thisHash,
                                                 Quaternion.Euler(new Vector3(
                                                                      Mathf.Clamp(thisValueX.x, thisValueX.y, thisValueX.z),
                                                                      Mathf.Clamp(thisValueY.x, thisValueY.y, thisValueY.z),
                                                                      Mathf.Clamp(thisValueZ.x, thisValueZ.y, thisValueZ.z))), 1f);
                }
                else if (skeletonModifiers[i].property == SkeletonModifier.SkeletonPropType.Scale)
                {
                    skeleton.SetScale(thisHash,
                                      new Vector3(
                                          Mathf.Clamp(thisValueX.x, thisValueX.y, thisValueX.z),
                                          Mathf.Clamp(thisValueY.x, thisValueY.y, thisValueY.z),
                                          Mathf.Clamp(thisValueZ.x, thisValueZ.y, thisValueZ.z)));
                }
            }
            if (startingPose != null && asReset == false)
            {
                for (int i = 0; i < startingPose.poses.Length; i++)
                {
                    skeleton.Morph(startingPose.poses[i].hash, startingPose.poses[i].position, startingPose.poses[i].scale, startingPose.poses[i].rotation, startingPoseWeight);
                }
            }
            //overall modifiers
            //Try to use updated Bounds to set the height.
            if (overallModifiersEnabled && umaData.myRenderer != null)
            {
                if (umaData.myRenderer.localBounds.size.y == 0)
                {
                    return;
                }
                var    currentSMROffscreenSetting = umaData.myRenderer.updateWhenOffscreen;
                Bounds newBounds;

                //for this to properly calculate if the character is in a scaled game object it needs to be moved into the root
                var umaTransform = umaData.transform;
                var oldParent    = umaTransform.parent;
                var originalRot  = umaTransform.localRotation;
                var originalPos  = umaTransform.localPosition;

                //we also need to disable any collider that is on it so it doesn't hit anything when its moved
                var  thisCollider        = umaData.gameObject.GetComponent <Collider>();
                bool thisColliderEnabled = false;
                if (thisCollider)
                {
                    thisColliderEnabled  = thisCollider.enabled;
                    thisCollider.enabled = false;
                }

                //Now move into the root
                umaTransform.SetParent(null, false);
                umaTransform.localRotation = Quaternion.identity;
                umaTransform.localPosition = Vector3.zero;

                //Do the calculations
                umaData.myRenderer.updateWhenOffscreen = true;
                newBounds = new Bounds(umaData.myRenderer.localBounds.center, umaData.myRenderer.localBounds.size);
                umaData.myRenderer.updateWhenOffscreen = currentSMROffscreenSetting;

                //move it back
                umaTransform.SetParent(oldParent, false);
                umaTransform.localRotation = originalRot;
                umaTransform.localPosition = originalPos;

                //set any collider to its original setting
                if (thisCollider)
                {
                    thisCollider.enabled = thisColliderEnabled;
                }

                //somehow the bounds end up beneath the floor i.e. newBounds.center.y - newBounds.extents.y is actually a minus number
                //tighten bounds fixes this
                if (tightenBounds)
                {
                    Vector3 newCenter = new Vector3(newBounds.center.x, newBounds.center.y, newBounds.center.z);
                    Vector3 newSize   = new Vector3(newBounds.size.x, newBounds.size.y, newBounds.size.z);
                    if (newBounds.center.y - newBounds.extents.y < 0)
                    {
                        var underAmount = newBounds.center.y - newBounds.extents.y;
                        newSize.y   = (newBounds.center.y * 2) - underAmount;
                        newCenter.y = newSize.y / 2;
                    }
                    Bounds modifiedBounds = new Bounds(newCenter, newSize);
                    newBounds = modifiedBounds;
                }
                //character height can be based on the resulting height
                umaData.characterHeight = newBounds.size.y * (1 + radiusAdjust.y);
                //radius could be based on the resulting width
                umaData.characterRadius = (newBounds.size.x * (radiusAdjust.x /*/2*/) + newBounds.size.z * (radiusAdjust.x /*/ 2*/)) / 2;
                //then base the mass on a compond of those two modified by the mass modifiers values
                var radiusAsDNA  = (umaData.characterRadius * 2) * overallScaleCalc;
                var radiusYAsDNA = ((1 + radiusAdjust.y) * 0.5f) * overallScaleCalc;
                umaData.characterMass = (massModifiers.x * overallScaleCalc) + massModifiers.y * radiusYAsDNA + massModifiers.z * radiusAsDNA;
                //add bounds padding if any was set
                if (boundsAdjust != Vector3.zero)
                {
                    newBounds.Expand(boundsAdjust);
                }
                //set the padded bounds
                umaData.myRenderer.localBounds = newBounds;
            }
        }