diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/GltfExportSettings.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/GltfExportSettings.cs
index b29f85d82..b35cfe965 100644
--- a/Assets/UniGLTF/Runtime/UniGLTF/IO/GltfExportSettings.cs
+++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/GltfExportSettings.cs
@@ -1,6 +1,7 @@
using System;
+using UnityEngine;
namespace UniGLTF
{
@@ -45,5 +46,12 @@ namespace UniGLTF
/// Keep VertexColor
///
public bool KeepVertexColor;
+
+ ///
+ /// https://github.com/vrm-c/UniVRM/issues/1582
+ ///
+ /// Allowed hide flags for MeshFilters to be exported
+ ///
+ public HideFlags MeshFilterAllowedHideFlags = HideFlags.None;
}
}
diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs
index be80eba52..952cb37f2 100644
--- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs
+++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MeshIO/MeshExportInfo.cs
@@ -202,7 +202,7 @@ namespace UniGLTF
else if (renderer is MeshRenderer mr)
{
var filter = mr.GetComponent();
- if (filter != null && filter.hideFlags == HideFlags.None)
+ if (filter != null && settings.MeshFilterAllowedHideFlags.HasFlag(filter.hideFlags))
{
if (filter.sharedMesh != null && filter.sharedMesh.vertexCount > 0)
{