diff --git a/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMADefaultMeshCombiner.cs b/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMADefaultMeshCombiner.cs index 890f2eea3..fd4eff58d 100644 --- a/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMADefaultMeshCombiner.cs +++ b/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMADefaultMeshCombiner.cs @@ -179,11 +179,6 @@ public override void UpdateUMAMesh(bool updatedAtlas, UMAData umaData, int atlas { //Move umaMesh creation to with in the renderer loops //May want to make sure to set all it's buffers to null instead of creating a new UMAMeshData - UMAMeshData umaMesh = new UMAMeshData(); - umaMesh.ClaimSharedBuffers(); - - umaMesh.subMeshCount = 0; - umaMesh.vertexCount = 0; combinedMeshList.Clear(); combinedMaterialList.Clear(); @@ -199,6 +194,12 @@ public override void UpdateUMAMesh(bool updatedAtlas, UMAData umaData, int atlas } else { + UMAMeshData umaMesh = new UMAMeshData(); + umaMesh.ClaimSharedBuffers(); + + umaMesh.subMeshCount = 0; + umaMesh.vertexCount = 0; + SkinnedMeshCombiner.CombineMeshes(umaMesh, combinedMeshList.ToArray(), umaData.blendShapeSettings ); if (updatedAtlas) @@ -207,6 +208,7 @@ public override void UpdateUMAMesh(bool updatedAtlas, UMAData umaData, int atlas } umaMesh.ApplyDataToUnityMesh(renderers[currentRendererIndex], umaData.skeleton); + umaMesh.ReleaseSharedBuffers(); } var cloth = renderers[currentRendererIndex].GetComponent(); if (clothProperties != null) @@ -228,7 +230,6 @@ public override void UpdateUMAMesh(bool updatedAtlas, UMAData umaData, int atlas combinedMaterialList[i].skinnedMeshRenderer = renderers[currentRendererIndex]; } renderers[currentRendererIndex].sharedMaterials = materials; - umaMesh.ReleaseSharedBuffers(); } umaData.umaRecipe.ClearDNAConverters(); diff --git a/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs b/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs index f4602897f..ec2f3d2f9 100644 --- a/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs +++ b/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAGeneratorBuiltin.cs @@ -494,7 +494,7 @@ public virtual void UMAReady() umaData.Show(); umaData.FireUpdatedEvent(false); umaData.FireCharacterCompletedEvents(); - if (umaData.skeleton.boneCount > 300) + if (umaData.skeleton.boneCount > 500) { if (Debug.isDebugBuild) Debug.LogWarning("Skeleton has " + umaData.skeleton.boneCount + " bones, may be an error with slots!"); diff --git a/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAMeshData.cs b/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAMeshData.cs index a00a5569a..78da2c761 100644 --- a/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAMeshData.cs +++ b/UMAProject/Assets/UMA/Core/StandardAssets/UMA/Scripts/UMAMeshData.cs @@ -593,19 +593,12 @@ public void ApplyDataToUnityMesh(SkinnedMeshRenderer renderer, UMASkeleton skele 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)