Added ExportSetting to allow HideFlags

This commit is contained in:
Matthias Brenner
2022-03-23 16:39:21 +01:00
parent 47fc47fa31
commit 3cf971e907
2 changed files with 9 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
using System;
using UnityEngine;
namespace UniGLTF
{
@@ -45,5 +46,12 @@ namespace UniGLTF
/// Keep VertexColor
/// </summary>
public bool KeepVertexColor;
/// <summary>
/// https://github.com/vrm-c/UniVRM/issues/1582
///
/// Allowed hide flags for MeshFilters to be exported
/// </summary>
public HideFlags MeshFilterAllowedHideFlags = HideFlags.None;
}
}

View File

@@ -202,7 +202,7 @@ namespace UniGLTF
else if (renderer is MeshRenderer mr)
{
var filter = mr.GetComponent<MeshFilter>();
if (filter != null && filter.hideFlags == HideFlags.None)
if (filter != null && settings.MeshFilterAllowedHideFlags.HasFlag(filter.hideFlags))
{
if (filter.sharedMesh != null && filter.sharedMesh.vertexCount > 0)
{