Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Scripts/Editor/ImportBlendShapesDisabler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.IO;
using UnityEditor;
using UnityEngine;

public class ImportBlendShapesDisabler : AssetPostprocessor
{
private const string NoBlendShapesFolder = "NoBlendShapes";

private void OnPreprocessModel()
{
if(assetPath.Contains("NoBlendShapes"))
{
var modelImporter = assetImporter as ModelImporter;

if(modelImporter.importBlendShapes)
{
var assetName = Path.GetFileNameWithoutExtension(assetPath);
Debug.LogWarning(
$"[{assetName}]: Blendshapes are disabled in paths containing [{NoBlendShapesFolder}].");
modelImporter.importBlendShapes = false;
}
}
}
}