Skip to content

SaiiPrashanth/Asset_Validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asset Validator

A Unity Editor tool that automatically validates imported 3D assets and textures against configurable project standards, logging issues to a dedicated editor window.

Demo

Demo

Overview

Maintaining pipeline quality means catching problems early. This tool hooks into Unity's import pipeline via AssetPostprocessor to validate every model and texture the moment it lands in the project, flagging naming violations, excessive poly counts, missing LODs, and texture issues without any manual intervention.

Features

  • Automatic Model Validation (on import):
    • Poly Count Check: Flags meshes exceeding the configurable triangle limit (default: 65,000 tris).
    • Naming Convention: Enforces PascalCase / snake_case with no spaces or special characters.
    • LOD Warning: Warns when a high-poly mesh (> 5,000 tris) has no LODGroup component.
  • Automatic Texture Validation (pre-import):
    • Naming Convention: Same pattern check applied to texture file names.
    • Max Texture Size: Caps oversized textures and logs the change.
    • Normal Map Detection: Auto-sets import type to NormalMap based on file name suffixes (_n, _nrm, normal).
  • Validator Log Window (Tools > Validator Log):
    • Filterable log with Info / Warning / Error levels.
    • Auto-opens on warnings or errors so issues are never missed.
    • Clickable entries to ping the asset in the Project window.

Prerequisites

  • Unity (2021.3 LTS or newer recommended).
  • Place Scripts/AssetValidator.cs inside an Editor/ folder in your Unity project.

Usage

  1. Drop Scripts/AssetValidator.cs into any Editor/ folder in your Unity project (e.g., Assets/Editor/).
  2. Import any 3D model or texture — validation runs automatically.
  3. Open Tools > Validator Log to review all flagged issues.

Configuration

Edit the static fields at the top of AssetValidator.cs to adjust thresholds:

Field Default Description
MaxPolyCount 65000 Maximum triangle count before a warning
MaxTextureSize 4096 Maximum import texture size
MinTextureSize 32 Minimum texture size (reference)
EnforceNaming true Toggle naming convention checks
CheckLODs true Toggle LOD group warnings

Script Reference

Scripts/AssetValidator.cs

  • OnPostprocessModel(): Runs after model import. Checks triangle count, naming, and LOD groups.
  • OnPreprocessTexture(): Runs before texture import. Checks naming, max texture size, and auto-detects normal maps.
  • ValidatorLogWindow: Custom EditorWindow that collects and displays timestamped log entries with filtering by type.

License

This project is licensed under the MIT License - see the LICENSE file for details. Copyright (c) 2025 ARGUS

About

A Unity Editor tool that automatically validates imported 3D models and textures against configurable pipeline standards, flagging poly count violations, naming errors, missing LODs, and texture issues in a dedicated log window.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages