From 52b0cd18d5c8d60eff2a23c2fba271beee2dd02f Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 24 Jul 2018 20:58:54 +0900 Subject: [PATCH] Set initial BlendShapeClip.BlendShapeName from asset file name --- Scripts/BlendShape/Editor/BlendShapeAvatarEditor.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Scripts/BlendShape/Editor/BlendShapeAvatarEditor.cs b/Scripts/BlendShape/Editor/BlendShapeAvatarEditor.cs index 0090f553a..77d27be20 100644 --- a/Scripts/BlendShape/Editor/BlendShapeAvatarEditor.cs +++ b/Scripts/BlendShape/Editor/BlendShapeAvatarEditor.cs @@ -29,8 +29,9 @@ namespace VRM return; } path = path.ToUnityRelativePath(); - Debug.LogFormat("{0}", path); + //Debug.LogFormat("{0}", path); var clip = ScriptableObject.CreateInstance(); + clip.BlendShapeName = Path.GetFileNameWithoutExtension(path); m_target.Clips.Add(clip); clip.Prefab = AssetDatabase.LoadAssetAtPath(AssetDatabase.GetAssetPath(m_target)); AssetDatabase.CreateAsset(clip, path); @@ -128,7 +129,9 @@ namespace VRM CurrentClip.Preset = (BlendShapePreset)EditorGUILayout.Popup("Preset", (int)CurrentClip.Preset, Presets); + GUI.enabled = false; CurrentClip.BlendShapeName = EditorGUILayout.TextField("BlendShapeName", CurrentClip.BlendShapeName); + GUI.enabled = true; var key = BlendShapeKey.CreateFrom(CurrentClip); if (m_target.Clips.Where(x => key.Match(x)).Count() > 1)