This commit is contained in:
ousttrue 2022-05-19 15:48:51 +09:00
parent 5fd867a1e3
commit d4609bc2c7

View File

@ -136,7 +136,6 @@ namespace VRM.Sample.BlendShapeMenu
Debug.LogError("no context");
return;
}
var assetPath = AssetDatabase.GetAssetPath(avatar);
var dir = EditorUtility.SaveFolderPanel("blendshape folder", assetPath, "");
@ -153,16 +152,25 @@ namespace VRM.Sample.BlendShapeMenu
var extension = Path.GetExtension(f).ToLower();
if (extension != ".asset")
{
// not asset
continue;
}
var clipPath = ToUnityPath(f);
sb.AppendLine(clipPath);
if (clipPath == null)
{
// not BlendShapeClip
continue;
}
var clip = AssetDatabase.LoadAssetAtPath<BlendShapeClip>(clipPath);
if (avatar.Clips.Contains(clip))
{
// already exists
continue;
}
sb.AppendLine(clipPath);
avatar.Clips.Add(clip);
}