public void TextureTransformTest() { var tex0 = new Texture2D(128, 128) { wrapMode = TextureWrapMode.Repeat, filterMode = FilterMode.Bilinear, }; var textureManager = new TextureExporter(); var srcMaterial = new Material(Shader.Find("VRM/MToon")); var offset = new Vector2(0.3f, 0.2f); var scale = new Vector2(0.5f, 0.6f); srcMaterial.mainTexture = tex0; srcMaterial.mainTextureOffset = offset; srcMaterial.mainTextureScale = scale; var materialExporter = new VRMMaterialExporter(); var vrmMaterial = VRMMaterialExporter.CreateFromMaterial(srcMaterial, textureManager); Assert.AreEqual(vrmMaterial.vectorProperties["_MainTex"], new float[] { 0.3f, 0.2f, 0.5f, 0.6f }); var materialImporter = new VRMMaterialImporter(new System.Collections.Generic.List <glTF_VRM_Material> { vrmMaterial }); }
public void ExportTest() { { var material = Resources.Load <Material>("Materials/vrm_unlit_texture"); var exporter = new VRMMaterialExporter(); var exported = exporter.ExportMaterial(material, null); Assert.NotNull(exported.extensions.KHR_materials_unlit); Assert.AreEqual("OPAQUE", exported.alphaMode); } { var material = Resources.Load <Material>("Materials/vrm_unlit_transparent"); var exporter = new VRMMaterialExporter(); var exported = exporter.ExportMaterial(material, null); Assert.NotNull(exported.extensions.KHR_materials_unlit); Assert.AreEqual("BLEND", exported.alphaMode); } { var material = Resources.Load <Material>("Materials/vrm_unlit_cutout"); var exporter = new VRMMaterialExporter(); var exported = exporter.ExportMaterial(material, null); Assert.NotNull(exported.extensions.KHR_materials_unlit); Assert.AreEqual("MASK", exported.alphaMode); } { var material = Resources.Load <Material>("Materials/vrm_unlit_transparent_zwrite"); var exporter = new VRMMaterialExporter(); var exported = exporter.ExportMaterial(material, null); Assert.NotNull(exported.extensions.KHR_materials_unlit); Assert.AreEqual("BLEND", exported.alphaMode); } { var material = Resources.Load <Material>("Materials/mtoon_opaque"); var exporter = new VRMMaterialExporter(); var exported = exporter.ExportMaterial(material, null); Assert.NotNull(exported.extensions.KHR_materials_unlit); Assert.AreEqual("OPAQUE", exported.alphaMode); } { var material = Resources.Load <Material>("Materials/mtoon_transparent"); var exporter = new VRMMaterialExporter(); var exported = exporter.ExportMaterial(material, null); Assert.NotNull(exported.extensions.KHR_materials_unlit); Assert.AreEqual("BLEND", exported.alphaMode); } { var material = Resources.Load <Material>("Materials/mtoon_cutout"); var exporter = new VRMMaterialExporter(); var exported = exporter.ExportMaterial(material, null); Assert.NotNull(exported.extensions.KHR_materials_unlit); Assert.AreEqual("MASK", exported.alphaMode); } { var material = Resources.Load <Material>("Materials/mtoon_culloff"); var exporter = new VRMMaterialExporter(); var exported = exporter.ExportMaterial(material, null); Assert.NotNull(exported.extensions.KHR_materials_unlit); Assert.True(exported.doubleSided); } }
static string GltfMaterialFromUnityShaderName(string shaderName) { var name = VRMMaterialExporter.VrmMaterialName(shaderName); if (!string.IsNullOrEmpty(name)) { return(name); } return(MeshExportValidator.DefaultGltfMaterialType(shaderName)); }
public override string GetGltfMaterialTypeFromUnityShaderName(string shaderName) { var name = VRMMaterialExporter.VrmMaterialName(shaderName); if (!string.IsNullOrEmpty(name)) { return(name); } return(base.GetGltfMaterialTypeFromUnityShaderName(shaderName)); }
public override void Export(MeshExportSettings configuration) { base.Export(configuration); // avatar var animator = Copy.GetComponent <Animator>(); if (animator != null) { var humanoid = Copy.GetComponent <VRMHumanoidDescription>(); UniHumanoid.AvatarDescription description = null; var nodes = Copy.transform.Traverse().Skip(1).ToList(); { var isCreated = false; if (humanoid != null) { description = humanoid.GetDescription(out isCreated); } if (description != null) { // use description VRM.humanoid.Apply(description, nodes); } if (isCreated) { GameObject.DestroyImmediate(description); } } { // set humanoid bone mapping var avatar = animator.avatar; foreach (HumanBodyBones key in Enum.GetValues(typeof(HumanBodyBones))) { if (key == HumanBodyBones.LastBone) { break; } var transform = animator.GetBoneTransform(key); if (transform != null) { VRM.humanoid.SetNodeIndex(key, nodes.IndexOf(transform)); } } } } // morph var master = Copy.GetComponent <VRMBlendShapeProxy>(); if (master != null) { var avatar = master.BlendShapeAvatar; if (avatar != null) { foreach (var x in avatar.Clips) { VRM.blendShapeMaster.Add(x, this); } } } // secondary VRMSpringUtility.ExportSecondary(Copy.transform, Nodes, x => VRM.secondaryAnimation.colliderGroups.Add(x), x => VRM.secondaryAnimation.boneGroups.Add(x) ); #pragma warning disable 0618 // meta(obsolete) { var meta = Copy.GetComponent <VRMMetaInformation>(); if (meta != null) { VRM.meta.author = meta.Author; VRM.meta.contactInformation = meta.ContactInformation; VRM.meta.title = meta.Title; if (meta.Thumbnail != null) { VRM.meta.texture = TextureExporter.ExportTexture(glTF, glTF.buffers.Count - 1, meta.Thumbnail, glTFTextureTypes.Unknown); } VRM.meta.licenseType = meta.LicenseType; VRM.meta.otherLicenseUrl = meta.OtherLicenseUrl; VRM.meta.reference = meta.Reference; } } #pragma warning restore 0618 // meta { var _meta = Copy.GetComponent <VRMMeta>(); if (_meta != null && _meta.Meta != null) { var meta = _meta.Meta; // info VRM.meta.version = meta.Version; VRM.meta.author = meta.Author; VRM.meta.contactInformation = meta.ContactInformation; VRM.meta.reference = meta.Reference; VRM.meta.title = meta.Title; if (meta.Thumbnail != null) { VRM.meta.texture = TextureExporter.ExportTexture(glTF, glTF.buffers.Count - 1, meta.Thumbnail, glTFTextureTypes.Unknown); } // ussage permission VRM.meta.allowedUser = meta.AllowedUser; VRM.meta.violentUssage = meta.ViolentUssage; VRM.meta.sexualUssage = meta.SexualUssage; VRM.meta.commercialUssage = meta.CommercialUssage; VRM.meta.otherPermissionUrl = meta.OtherPermissionUrl; // distribution license VRM.meta.licenseType = meta.LicenseType; if (meta.LicenseType == LicenseType.Other) { VRM.meta.otherLicenseUrl = meta.OtherLicenseUrl; } } } // firstPerson var firstPerson = Copy.GetComponent <VRMFirstPerson>(); if (firstPerson != null) { if (firstPerson.FirstPersonBone != null) { VRM.firstPerson.firstPersonBone = Nodes.IndexOf(firstPerson.FirstPersonBone); VRM.firstPerson.firstPersonBoneOffset = firstPerson.FirstPersonOffset; VRM.firstPerson.meshAnnotations = firstPerson.Renderers.Select(x => new glTF_VRM_MeshAnnotation { mesh = Meshes.IndexOf(x.SharedMesh), firstPersonFlag = x.FirstPersonFlag.ToString(), }).ToList(); } // lookAt { var lookAtHead = Copy.GetComponent <VRMLookAtHead>(); if (lookAtHead != null) { var boneApplyer = Copy.GetComponent <VRMLookAtBoneApplyer>(); var blendShapeApplyer = Copy.GetComponent <VRMLookAtBlendShapeApplyer>(); if (boneApplyer != null) { VRM.firstPerson.lookAtType = LookAtType.Bone; VRM.firstPerson.lookAtHorizontalInner.Apply(boneApplyer.HorizontalInner); VRM.firstPerson.lookAtHorizontalOuter.Apply(boneApplyer.HorizontalOuter); VRM.firstPerson.lookAtVerticalDown.Apply(boneApplyer.VerticalDown); VRM.firstPerson.lookAtVerticalUp.Apply(boneApplyer.VerticalUp); } else if (blendShapeApplyer != null) { VRM.firstPerson.lookAtType = LookAtType.BlendShape; VRM.firstPerson.lookAtHorizontalOuter.Apply(blendShapeApplyer.Horizontal); VRM.firstPerson.lookAtVerticalDown.Apply(blendShapeApplyer.VerticalDown); VRM.firstPerson.lookAtVerticalUp.Apply(blendShapeApplyer.VerticalUp); } } } } // materials foreach (var m in Materials) { VRM.materialProperties.Add(VRMMaterialExporter.CreateFromMaterial(m, TextureManager.Textures)); } // Serialize VRM var f = new JsonFormatter(); VRMSerializer.Serialize(f, VRM); var bytes = f.GetStoreBytes(); glTFExtensionExport.GetOrCreate(ref glTF.extensions).Add("VRM", bytes); }
/// <summary> /// エクスポート可能か検証する /// </summary> /// <returns></returns> public IEnumerable <Validation> Validate() { if (ExportRoot == null) { yield break; } if (DuplicateBoneNameExists()) { yield return(Validation.Warning("There is a bone with the same name in the hierarchy. If exported, these bones will be automatically renamed.")); } if (m_settings.ReduceBlendshape && ExportRoot.GetComponent <VRMBlendShapeProxy>() == null) { yield return(Validation.Error("ReduceBlendshapeSize needs VRMBlendShapeProxy. You need to convert to VRM once.")); } var vertexColor = ExportRoot.GetComponentsInChildren <SkinnedMeshRenderer>().Any(x => x.sharedMesh.colors.Length > 0); if (vertexColor) { yield return(Validation.Warning("This model contains vertex color")); } var renderers = ExportRoot.GetComponentsInChildren <Renderer>(); if (renderers.All(x => !x.gameObject.activeInHierarchy)) { yield return(Validation.Error("No active mesh")); } var materials = renderers.SelectMany(x => x.sharedMaterials).Distinct(); foreach (var material in materials) { if (material.shader.name == "Standard") { // standard continue; } if (VRMMaterialExporter.UseUnlit(material.shader.name)) { // unlit continue; } if (VRMMaterialExporter.VRMExtensionShaders.Contains(material.shader.name)) { // VRM supported continue; } yield return(Validation.Warning(string.Format("{0}: unknown shader '{1}' is used. this will export as `Standard` fallback", material.name, material.shader.name))); } foreach (var material in materials) { if (IsFileNameLengthTooLong(material.name)) { yield return(Validation.Error(string.Format("FileName '{0}' is too long. ", material.name))); } } var textureNameList = new List <string>(); foreach (var material in materials) { var shader = material.shader; int propertyCount = ShaderUtil.GetPropertyCount(shader); for (int i = 0; i < propertyCount; i++) { if (ShaderUtil.GetPropertyType(shader, i) == ShaderUtil.ShaderPropertyType.TexEnv) { if ((material.GetTexture(ShaderUtil.GetPropertyName(shader, i)) != null)) { var textureName = material.GetTexture(ShaderUtil.GetPropertyName(shader, i)).name; if (!textureNameList.Contains(textureName)) { textureNameList.Add(textureName); } } } } } foreach (var textureName in textureNameList) { if (IsFileNameLengthTooLong(textureName)) { yield return(Validation.Error(string.Format("FileName '{0}' is too long. ", textureName))); } } var vrmMeta = ExportRoot.GetComponent <VRMMeta>(); if (vrmMeta != null && vrmMeta.Meta != null && vrmMeta.Meta.Thumbnail != null) { var thumbnailName = vrmMeta.Meta.Thumbnail.name; if (IsFileNameLengthTooLong(thumbnailName)) { yield return(Validation.Error(string.Format("FileName '{0}' is too long. ", thumbnailName))); } } var meshFilters = ExportRoot.GetComponentsInChildren <MeshFilter>(); var meshesName = meshFilters.Select(x => x.sharedMesh.name).Distinct(); foreach (var meshName in meshesName) { if (IsFileNameLengthTooLong(meshName)) { yield return(Validation.Error(string.Format("FileName '{0}' is too long. ", meshName))); } } var skinnedmeshRenderers = ExportRoot.GetComponentsInChildren <SkinnedMeshRenderer>(); var skinnedmeshesName = skinnedmeshRenderers.Select(x => x.sharedMesh.name).Distinct(); foreach (var skinnedmeshName in skinnedmeshesName) { if (IsFileNameLengthTooLong(skinnedmeshName)) { yield return(Validation.Error(string.Format("FileName '{0}' is too long. ", skinnedmeshName))); } } }
IEnumerable <Validation> _Validate(GameObject ExportRoot, VRMExportSettings m_settings) { if (ExportRoot == null) { yield break; } if (DuplicateBoneNameExists(ExportRoot)) { yield return(Validation.Warning(Msg(VRMExporterWizardMessages.DUPLICATE_BONE_NAME_EXISTS))); } if (m_settings.ReduceBlendshape && ExportRoot.GetComponent <VRMBlendShapeProxy>() == null) { yield return(Validation.Error(Msg(VRMExporterWizardMessages.NEEDS_VRM_BLENDSHAPE_PROXY))); } var renderers = ExportRoot.GetComponentsInChildren <Renderer>(); foreach (var r in renderers) { for (int i = 0; i < r.sharedMaterials.Length; ++i) { if (r.sharedMaterials[i] == null) { yield return(Validation.Error($"Renderer: {r.name}.Materials[{i}] is null. please fix it")); } } } var materials = renderers.SelectMany(x => x.sharedMaterials).Where(x => x != null).Distinct(); foreach (var material in materials) { if (material == null) { continue; } if (material.shader.name == "Standard") { // standard continue; } if (VRMMaterialExporter.UseUnlit(material.shader.name)) { // unlit continue; } if (VRMMaterialExporter.VRMExtensionShaders.Contains(material.shader.name)) { // VRM supported continue; } yield return(Validation.Warning($"Material: {material.name}. Unknown Shader: \"{material.shader.name}\" is used. {Msg(VRMExporterWizardMessages.UNKNOWN_SHADER)}")); } foreach (var material in materials) { if (IsFileNameLengthTooLong(material.name)) { yield return(Validation.Error(Msg(VRMExporterWizardMessages.FILENAME_TOO_LONG) + material.name)); } } var textureNameList = new List <string>(); foreach (var material in materials) { var shader = material.shader; int propertyCount = ShaderUtil.GetPropertyCount(shader); for (int i = 0; i < propertyCount; i++) { if (ShaderUtil.GetPropertyType(shader, i) == ShaderUtil.ShaderPropertyType.TexEnv) { if ((material.GetTexture(ShaderUtil.GetPropertyName(shader, i)) != null)) { var textureName = material.GetTexture(ShaderUtil.GetPropertyName(shader, i)).name; if (!textureNameList.Contains(textureName)) { textureNameList.Add(textureName); } } } } } foreach (var textureName in textureNameList) { if (IsFileNameLengthTooLong(textureName)) { yield return(Validation.Error(Msg(VRMExporterWizardMessages.FILENAME_TOO_LONG) + textureName)); } } var vrmMeta = ExportRoot.GetComponent <VRMMeta>(); if (vrmMeta != null && vrmMeta.Meta != null && vrmMeta.Meta.Thumbnail != null) { var thumbnailName = vrmMeta.Meta.Thumbnail.name; if (IsFileNameLengthTooLong(thumbnailName)) { yield return(Validation.Error(Msg(VRMExporterWizardMessages.FILENAME_TOO_LONG) + thumbnailName)); } } var meshFilters = ExportRoot.GetComponentsInChildren <MeshFilter>(); var meshesName = meshFilters.Select(x => x.sharedMesh.name).Distinct(); foreach (var meshName in meshesName) { if (IsFileNameLengthTooLong(meshName)) { yield return(Validation.Error(Msg(VRMExporterWizardMessages.FILENAME_TOO_LONG) + meshName)); } } var skinnedmeshRenderers = ExportRoot.GetComponentsInChildren <SkinnedMeshRenderer>(); var skinnedmeshesName = skinnedmeshRenderers.Select(x => x.sharedMesh.name).Distinct(); foreach (var skinnedmeshName in skinnedmeshesName) { if (IsFileNameLengthTooLong(skinnedmeshName)) { yield return(Validation.Error(Msg(VRMExporterWizardMessages.FILENAME_TOO_LONG) + skinnedmeshName)); } } }
/// <summary> /// エクスポート可能か検証する /// </summary> /// <returns></returns> public IEnumerable <Validation> Validate() { if (ExportRoot == null) { yield break; } if (DuplicateBoneNameExists()) { yield return(Validation.Warning(Msg.DUPLICATE_BONE_NAME_EXISTS)); } if (m_settings.ReduceBlendshape && ExportRoot.GetComponent <VRMBlendShapeProxy>() == null) { yield return(Validation.Error(Msg.NEEDS_VRM_BLENDSHAPE_PROXY)); } var vertexColor = ExportRoot.GetComponentsInChildren <SkinnedMeshRenderer>().Any(x => x.sharedMesh.colors.Length > 0); if (vertexColor) { yield return(Validation.Warning(Msg.VERTEX_COLOR_IS_INCLUDED)); } var renderers = ExportRoot.GetComponentsInChildren <Renderer>(); var materials = renderers.SelectMany(x => x.sharedMaterials).Distinct(); foreach (var material in materials) { if (material.shader.name == "Standard") { // standard continue; } if (VRMMaterialExporter.UseUnlit(material.shader.name)) { // unlit continue; } if (VRMMaterialExporter.VRMExtensionShaders.Contains(material.shader.name)) { // VRM supported continue; } yield return(Validation.Warning($"Material: {material.name}. Unknown Shader: \"{material.shader.name}\" is used. {Msg.UNKNOWN_SHADER}")); } foreach (var material in materials) { if (IsFileNameLengthTooLong(material.name)) { yield return(Validation.Error(Msg.FILENAME_TOO_LONG + material.name)); } } var textureNameList = new List <string>(); foreach (var material in materials) { var shader = material.shader; int propertyCount = ShaderUtil.GetPropertyCount(shader); for (int i = 0; i < propertyCount; i++) { if (ShaderUtil.GetPropertyType(shader, i) == ShaderUtil.ShaderPropertyType.TexEnv) { if ((material.GetTexture(ShaderUtil.GetPropertyName(shader, i)) != null)) { var textureName = material.GetTexture(ShaderUtil.GetPropertyName(shader, i)).name; if (!textureNameList.Contains(textureName)) { textureNameList.Add(textureName); } } } } } foreach (var textureName in textureNameList) { if (IsFileNameLengthTooLong(textureName)) { yield return(Validation.Error(Msg.FILENAME_TOO_LONG + textureName)); } } var vrmMeta = ExportRoot.GetComponent <VRMMeta>(); if (vrmMeta != null && vrmMeta.Meta != null && vrmMeta.Meta.Thumbnail != null) { var thumbnailName = vrmMeta.Meta.Thumbnail.name; if (IsFileNameLengthTooLong(thumbnailName)) { yield return(Validation.Error(Msg.FILENAME_TOO_LONG + thumbnailName)); } } var meshFilters = ExportRoot.GetComponentsInChildren <MeshFilter>(); var meshesName = meshFilters.Select(x => x.sharedMesh.name).Distinct(); foreach (var meshName in meshesName) { if (IsFileNameLengthTooLong(meshName)) { yield return(Validation.Error(Msg.FILENAME_TOO_LONG + meshName)); } } var skinnedmeshRenderers = ExportRoot.GetComponentsInChildren <SkinnedMeshRenderer>(); var skinnedmeshesName = skinnedmeshRenderers.Select(x => x.sharedMesh.name).Distinct(); foreach (var skinnedmeshName in skinnedmeshesName) { if (IsFileNameLengthTooLong(skinnedmeshName)) { yield return(Validation.Error(Msg.FILENAME_TOO_LONG + skinnedmeshName)); } } }
/// <summary> /// エクスポート可能か検証する /// </summary> /// <returns></returns> public IEnumerable <Validation> Validate() { if (Source == null) { yield return(Validation.Error("Require source")); yield break; } if (Source.transform.position != Vector3.zero || Source.transform.rotation != Quaternion.identity || Source.transform.localScale != Vector3.one) { // EditorUtility.DisplayDialog("Error", "The Root transform should have Default translation, rotation and scale.", "ok"); yield return(Validation.Warning("The Root translation, rotation and scale will be dropped.")); } var animator = Source.GetComponent <Animator>(); if (animator == null) { yield return(Validation.Error("Require animator. ")); } else if (animator.avatar == null) { yield return(Validation.Error("Require animator.avatar. ")); } else if (!animator.avatar.isValid) { yield return(Validation.Error("Animator.avatar is not valid. ")); } else if (!animator.avatar.isHuman) { yield return(Validation.Error("Animator.avatar is not humanoid. Please change model's AnimationType to humanoid. ")); } var jaw = animator.GetBoneTransform(HumanBodyBones.Jaw); if (jaw != null) { yield return(Validation.Warning("Jaw bone is included. It may not be what you intended. Please check the humanoid avatar setting screen")); } if (DuplicateBoneNameExists()) { yield return(Validation.Warning("There is a bone with the same name in the hierarchy. If exported, these bones will be automatically renamed.")); } if (string.IsNullOrEmpty(Title)) { yield return(Validation.Error("Require Title. ")); } if (string.IsNullOrEmpty(Version)) { yield return(Validation.Error("Require Version. ")); } if (string.IsNullOrEmpty(Author)) { yield return(Validation.Error("Require Author. ")); } if (ReduceBlendshape && Source.GetComponent <VRMBlendShapeProxy>() == null) { yield return(Validation.Error("ReduceBlendshapeSize needs VRMBlendShapeProxy. You need to convert to VRM once.")); } var vertexColor = Source.GetComponentsInChildren <SkinnedMeshRenderer>().Any(x => x.sharedMesh.colors.Length > 0); if (vertexColor) { yield return(Validation.Warning("This model contains vertex color")); } var renderers = Source.GetComponentsInChildren <Renderer>(); if (renderers.All(x => !x.gameObject.activeInHierarchy)) { yield return(Validation.Error("No active mesh")); } var materials = renderers.SelectMany(x => x.sharedMaterials).Distinct(); foreach (var material in materials) { if (material.shader.name == "Standard") { // standard continue; } if (VRMMaterialExporter.UseUnlit(material.shader.name)) { // unlit continue; } if (VRMMaterialExporter.VRMExtensionShaders.Contains(material.shader.name)) { // VRM supported continue; } yield return(Validation.Warning(string.Format("{0}: unknown shader '{1}' is used. this will export as `Standard` fallback", material.name, material.shader.name))); } foreach (var material in materials) { if (IsFileNameLengthTooLong(material.name)) { yield return(Validation.Error(string.Format("FileName '{0}' is too long. ", material.name))); } } var textureNameList = new List <string>(); foreach (var material in materials) { var shader = material.shader; int propertyCount = ShaderUtil.GetPropertyCount(shader); for (int i = 0; i < propertyCount; i++) { if (ShaderUtil.GetPropertyType(shader, i) == ShaderUtil.ShaderPropertyType.TexEnv) { if ((material.GetTexture(ShaderUtil.GetPropertyName(shader, i)) != null)) { var textureName = material.GetTexture(ShaderUtil.GetPropertyName(shader, i)).name; if (!textureNameList.Contains(textureName)) { textureNameList.Add(textureName); } } } } } foreach (var textureName in textureNameList) { if (IsFileNameLengthTooLong(textureName)) { yield return(Validation.Error(string.Format("FileName '{0}' is too long. ", textureName))); } } var vrmMeta = Source.GetComponent <VRMMeta>(); if (vrmMeta != null && vrmMeta.Meta != null && vrmMeta.Meta.Thumbnail != null) { var thumbnailName = vrmMeta.Meta.Thumbnail.name; if (IsFileNameLengthTooLong(thumbnailName)) { yield return(Validation.Error(string.Format("FileName '{0}' is too long. ", thumbnailName))); } } var meshFilters = Source.GetComponentsInChildren <MeshFilter>(); var meshesName = meshFilters.Select(x => x.sharedMesh.name).Distinct(); foreach (var meshName in meshesName) { if (IsFileNameLengthTooLong(meshName)) { yield return(Validation.Error(string.Format("FileName '{0}' is too long. ", meshName))); } } var skinnedmeshRenderers = Source.GetComponentsInChildren <SkinnedMeshRenderer>(); var skinnedmeshesName = skinnedmeshRenderers.Select(x => x.sharedMesh.name).Distinct(); foreach (var skinnedmeshName in skinnedmeshesName) { if (IsFileNameLengthTooLong(skinnedmeshName)) { yield return(Validation.Error(string.Format("FileName '{0}' is too long. ", skinnedmeshName))); } } }