home / skills / besty0728 / unity-skills / importer

importer skill

/unity-skills/skills/importer

This skill helps you configure Unity asset import settings for textures, audio, and models, supporting batch operations for multiple assets.

npx playbooks add skill besty0728/unity-skills --skill importer

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
6.0 KB
---
name: unity-importer
description: "Get and set import settings for Textures, Audio, and Models. Use *_batch skills for 2+ assets."
---

# Unity Importer Skills

> **BATCH-FIRST**: Use `*_batch` skills when configuring 2+ assets.

## Skills Overview

| Single Object | Batch Version | Use Batch When |
|---------------|---------------|----------------|
| `texture_set_settings` | `texture_set_settings_batch` | Configuring 2+ textures |
| `audio_set_settings` | `audio_set_settings_batch` | Configuring 2+ audio files |
| `model_set_settings` | `model_set_settings_batch` | Configuring 2+ models |

**Query Skills** (no batch needed):
- `texture_get_settings` - Get texture import settings
- `audio_get_settings` - Get audio import settings
- `model_get_settings` - Get model import settings

---

## Texture Skills

### texture_get_settings / texture_set_settings

| Parameter | Type | Description |
|-----------|------|-------------|
| `assetPath` | string | Path like `Assets/Textures/icon.png` |
| `textureType` | string | Default, NormalMap, Sprite, EditorGUI, Cursor, Cookie, Lightmap, SingleChannel |
| `maxSize` | int | 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192 |
| `filterMode` | string | Point, Bilinear, Trilinear |
| `compression` | string | None, LowQuality, Normal, HighQuality |
| `mipmapEnabled` | bool | Generate mipmaps |
| `sRGB` | bool | sRGB color space |
| `readable` | bool | CPU readable (for GetPixel) |
| `spritePixelsPerUnit` | float | Pixels per unit for Sprite type |
| `wrapMode` | string | Repeat, Clamp, Mirror, MirrorOnce |

```python
# Single - convert to sprite
unity_skills.call_skill("texture_set_settings",
    assetPath="Assets/Textures/ui_button.png",
    textureType="Sprite",
    spritePixelsPerUnit=100,
    filterMode="Bilinear"
)

# Batch - convert multiple to sprites
unity_skills.call_skill("texture_set_settings_batch", items=[
    {"assetPath": "Assets/Textures/icon1.png", "textureType": "Sprite"},
    {"assetPath": "Assets/Textures/icon2.png", "textureType": "Sprite"},
    {"assetPath": "Assets/Textures/icon3.png", "textureType": "Sprite"}
])
```

---

## Audio Skills

### audio_get_settings / audio_set_settings

| Parameter | Type | Description |
|-----------|------|-------------|
| `assetPath` | string | Path like `Assets/Audio/bgm.mp3` |
| `forceToMono` | bool | Force to mono channel |
| `loadInBackground` | bool | Load in background thread |
| `preloadAudioData` | bool | Preload on scene load |
| `loadType` | string | DecompressOnLoad, CompressedInMemory, Streaming |
| `compressionFormat` | string | PCM, Vorbis, ADPCM |
| `quality` | float | 0.0 ~ 1.0 (Vorbis quality) |

```python
# BGM - use streaming for memory efficiency
unity_skills.call_skill("audio_set_settings",
    assetPath="Assets/Audio/bgm.mp3",
    loadType="Streaming",
    compressionFormat="Vorbis",
    quality=0.7
)

# SFX - decompress for low latency
unity_skills.call_skill("audio_set_settings",
    assetPath="Assets/Audio/sfx_hit.wav",
    loadType="DecompressOnLoad",
    forceToMono=True
)

# Batch
unity_skills.call_skill("audio_set_settings_batch", items=[
    {"assetPath": "Assets/Audio/sfx1.wav", "loadType": "DecompressOnLoad"},
    {"assetPath": "Assets/Audio/sfx2.wav", "loadType": "DecompressOnLoad"}
])
```

---

## Model Skills

### model_get_settings / model_set_settings

| Parameter | Type | Description |
|-----------|------|-------------|
| `assetPath` | string | Path like `Assets/Models/char.fbx` |
| `globalScale` | float | Import scale factor |
| `meshCompression` | string | Off, Low, Medium, High |
| `isReadable` | bool | CPU readable mesh data |
| `generateSecondaryUV` | bool | Generate lightmap UVs |
| `importBlendShapes` | bool | Import blend shapes |
| `importCameras` | bool | Import cameras |
| `importLights` | bool | Import lights |
| `animationType` | string | None, Legacy, Generic, Humanoid |
| `importAnimation` | bool | Import animations |
| `materialImportMode` | string | None, ImportViaMaterialDescription, ImportStandard |

```python
# Character with humanoid animation
unity_skills.call_skill("model_set_settings",
    assetPath="Assets/Models/character.fbx",
    animationType="Humanoid",
    meshCompression="Medium",
    generateSecondaryUV=True
)

# Static prop - optimize
unity_skills.call_skill("model_set_settings",
    assetPath="Assets/Models/prop_barrel.fbx",
    animationType="None",
    importAnimation=False,
    importCameras=False,
    importLights=False,
    meshCompression="High"
)

# Batch
unity_skills.call_skill("model_set_settings_batch", items=[
    {"assetPath": "Assets/Models/prop1.fbx", "animationType": "None", "meshCompression": "High"},
    {"assetPath": "Assets/Models/prop2.fbx", "animationType": "None", "meshCompression": "High"}
])
```

---

## Example: Efficient Asset Configuration

```python
import unity_skills

# BAD: 5 API calls
unity_skills.call_skill("texture_set_settings", assetPath="Assets/UI/btn1.png", textureType="Sprite")
unity_skills.call_skill("texture_set_settings", assetPath="Assets/UI/btn2.png", textureType="Sprite")
unity_skills.call_skill("texture_set_settings", assetPath="Assets/UI/btn3.png", textureType="Sprite")
unity_skills.call_skill("texture_set_settings", assetPath="Assets/UI/btn4.png", textureType="Sprite")
unity_skills.call_skill("texture_set_settings", assetPath="Assets/UI/btn5.png", textureType="Sprite")

# GOOD: 1 API call
unity_skills.call_skill("texture_set_settings_batch", items=[
    {"assetPath": f"Assets/UI/btn{i}.png", "textureType": "Sprite", "mipmapEnabled": False}
    for i in range(1, 6)
])
```

## Best Practices

### Textures
- Use `Sprite` type for UI images
- Disable mipmaps for UI textures to save memory
- Use `Point` filter for pixel art
- Set `readable=false` unless you need CPU access

### Audio
- Use `Streaming` for long BGM tracks
- Use `DecompressOnLoad` for short SFX
- Use `Vorbis` compression with quality 0.5-0.7 for good balance

### Models
- Use `Humanoid` animation type for characters with retargeting
- Disable unused imports (cameras, lights) for props
- Enable `generateSecondaryUV` for static objects using baked lighting

Overview

This skill provides programmatic control over Unity asset import settings for Textures, Audio, and Models. It supports single-asset operations and batch variants for applying the same configuration to multiple assets in one call. Use it to enforce consistent import policies, reduce repetitive work, and optimize runtime memory and performance.

How this skill works

The skill inspects and updates importer properties by asset path (e.g., Assets/Textures/icon.png). For textures it handles type, size, filtering, compression, mipmaps, sRGB, readability, wrap mode, and sprite pixels-per-unit. For audio it adjusts load type, compression format, mono conversion, background loading, and quality. For models it sets scale, mesh compression, read/write, UV generation, blend shapes, camera/light import, and animation options. Batch variants accept an items array to change 2+ assets with one call.

When to use it

  • When standardizing import settings across a project
  • When converting many UI images to Sprite type
  • When optimizing audio assets for streaming or low-latency SFX
  • When preparing models for runtime (scale, compression, animation settings)
  • When you need to disable expensive read/write flags programmatically

Best practices

  • Prefer batch APIs whenever configuring two or more assets to reduce calls and speed up processing
  • For UI textures use Sprite type, disable mipmaps, and set readable=false unless GetPixel is required
  • Use Streaming for long BGM and DecompressOnLoad for short SFX; Vorbis at 0.5–0.7 balances size and quality
  • Apply Point filtering for pixel art and Bilinear/Trilinear for smooth textures
  • For static models enable generateSecondaryUV for lightmapping and disable camera/light import for props

Example use cases

  • Convert an entire UI folder to sprites with a single batch call and disable mipmaps
  • Set all SFX to DecompressOnLoad and force mono where appropriate for low latency
  • Batch-optimize environmental props: high mesh compression, no animations, generate lightmap UVs
  • Configure character FBX to Humanoid with medium mesh compression and import blend shapes
  • Query current import settings for an asset before modifying them to avoid regressions

FAQ

When should I use the batch variant?

Use the batch variant whenever you need to configure two or more assets. It reduces API calls and is faster for bulk changes.

What values are valid for texture maxSize and compression?

Max size options include 32–8192. Compression options include None, LowQuality, Normal, and HighQuality; filter modes include Point, Bilinear, and Trilinear.