diff --git a/Scripts/BlendShape/Editor/BlendShapeBindingPropertyDrawer.cs b/Scripts/BlendShape/Editor/BlendShapeBindingPropertyDrawer.cs index 005458e41..4989e8136 100644 --- a/Scripts/BlendShape/Editor/BlendShapeBindingPropertyDrawer.cs +++ b/Scripts/BlendShape/Editor/BlendShapeBindingPropertyDrawer.cs @@ -16,7 +16,7 @@ namespace VRM { var y = position.y; for (var depth = property.depth; - property.NextVisible(true) && property.depth >= depth; + property.NextVisible(true) && property.depth > depth; ) { { diff --git a/Scripts/BlendShape/Editor/MaterialValueBindingPropertyDrawer.cs b/Scripts/BlendShape/Editor/MaterialValueBindingPropertyDrawer.cs index 7381c302e..e668d9d90 100644 --- a/Scripts/BlendShape/Editor/MaterialValueBindingPropertyDrawer.cs +++ b/Scripts/BlendShape/Editor/MaterialValueBindingPropertyDrawer.cs @@ -16,7 +16,7 @@ namespace VRM { var y = position.y; for (var depth = property.depth; - property.NextVisible(true) && property.depth >= depth; + property.NextVisible(true) && property.depth > depth; ) { { diff --git a/Scripts/BlendShape/Editor/PreviewFaceRenderer.cs b/Scripts/BlendShape/Editor/PreviewFaceRenderer.cs index 27c211149..15b0b7672 100644 --- a/Scripts/BlendShape/Editor/PreviewFaceRenderer.cs +++ b/Scripts/BlendShape/Editor/PreviewFaceRenderer.cs @@ -3,6 +3,7 @@ using System.Linq; using UnityEditor; using UnityEngine; using UniGLTF; +using System.Reflection; namespace VRM { @@ -48,7 +49,22 @@ namespace VRM m_previewInstance = (GameObject)GameObject.Instantiate(m_prefab, m_prefab.transform.position, m_prefab.transform.rotation); m_previewInstance.name = PreviewInstanceName; // HideFlags are special editor-only settings that let you have *secret* GameObjects in a scene, or to tell Unity not to save that temporary GameObject as part of the scene - m_previewInstance.hideFlags = HideFlags.DontSaveInEditor | HideFlags.DontSaveInBuild; // you could also hide it from the hierarchy or inspector, but personally I like knowing everything that's there + m_previewInstance.hideFlags = + HideFlags.HideAndDontSave + //HideFlags.DontSaveInEditor + //| HideFlags.DontSaveInBuild + ; // you could also hide it from the hierarchy or inspector, but personally I like knowing everything that's there + + var flags = BindingFlags.Static | BindingFlags.NonPublic; + var propInfo = typeof(Camera).GetProperty("PreviewCullingLayer", flags); + int previewLayer = (int)propInfo.GetValue(null, new object[0]); + //previewLayer のみ表示する + m_previewUtility.m_Camera.cullingMask = 1 << previewLayer; + + foreach (var x in m_previewInstance.transform.Traverse()) + { + x.gameObject.layer = previewLayer; + } } m_Renderers = m_previewInstance.transform.Traverse()