From b76ef91bbd35a34a9acb22e58e585130762c75c0 Mon Sep 17 00:00:00 2001 From: sator Date: Tue, 18 Feb 2020 12:16:44 +0900 Subject: [PATCH] Add non-string based method to search prefab --- Assets/VRM/UniVRM/Editor/BlendShape/PreviewEditor.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/VRM/UniVRM/Editor/BlendShape/PreviewEditor.cs b/Assets/VRM/UniVRM/Editor/BlendShape/PreviewEditor.cs index 113a46315..c12f8d6d3 100644 --- a/Assets/VRM/UniVRM/Editor/BlendShape/PreviewEditor.cs +++ b/Assets/VRM/UniVRM/Editor/BlendShape/PreviewEditor.cs @@ -95,6 +95,12 @@ namespace VRM } var prefab = AssetDatabase.LoadAssetAtPath(assetPath); + // search prefab if nothing + if (prefab == null && 0 < (target as BlendShapeAvatar).Clips.Count) + { + prefab = (target as BlendShapeAvatar).Clips[0].Prefab; + } + // once more, with string-based method if (prefab == null) { var parent = UniGLTF.UnityPath.FromUnityPath(assetPath).Parent;