| name | anvil-level-design-blender |
| description | Expert in Anvil Level Design Blender addon for Trenchbroom-inspired level design with automated material/UV management and geometry tools |
| triggers | ["how do I use Anvil Level Design in Blender","set up material application with Anvil addon","apply textures automatically in Blender level design","create hotspot mapping for texture atlas","use Anvil geometry tools for level design","configure UV management in Anvil Blender","export levels with Anvil Level Design","troubleshoot Anvil texture application"] |
Anvil Level Design Blender Addon
Skill by ara.so — Design Skills collection.
Anvil Level Design (Anvil LD) is a Blender addon combining Trenchbroom-inspired tools for video game level design. It features automated material application and UV management, hotspot mapping for texture atlases, camera and grid tools, geometry operators with backface culling selection, and improved GLB export workflow.
Installation
Requirements:
- Blender 5.1 or higher
- Python (bundled with Blender)
Installation steps:
- Download the repository as ZIP from GitHub
- In Blender: Edit → Preferences → Add-ons
- Click the v arrow → Install From Disk
- Select the downloaded ZIP file
- Enable the addon in preferences
Initial setup:
The addon adds two custom workspaces:
- Level Design - Main workspace for level geometry and texturing
- Hotspot Mapping - Workspace for defining texture atlas hotspots
Custom hotkey remapping:
All addon hotkeys are collected in addon preferences for easy remapping. Common keys to customize:
- Camera tools
- Texture application tools
- Geometry operators
Core Concepts
Material and UV Management Philosophy
Anvil manages materials automatically to prevent duplicates. Materials are applied with automatic UV unwrapping that tiles seamlessly across faces. Critical: Do not resize in object mode using scale operator - resize by moving and extruding faces to maintain proper UV coordinates.
Workspace Requirements
You must be in "Level Design" or "Hotspot Mapping" workspace to use Anvil features. Features are workspace-contextual.
Key Commands - Material Application
Basic Texture Application
Apply texture from file browser:
Copy material between faces:
Alt + Left Mouse on target face: Apply same material with seamless tiling
Alt + Right Mouse on source face: Pick texture from face (works across objects)
Stretched material application:
Shift + Alt + Left Mouse: Apply texture stretched to fit target face dimensions
Shift + Alt + Right Mouse: Pick texture to be stretched
UV-only operations (no material change):
Ctrl + Alt + Left Mouse: Apply UV without changing material
Ctrl + Alt + Right Mouse: Pick UV without changing material
Interactive UV Modes
Face Snapping UV Mode (T key):
Grid Snapping UV Mode:
UV Transform Mode (Shift + T):
Material Panel Settings
Access via N key → Anvil panel:
Scale U/V: 1.0
Rotation: 0.0
Offset U/V: 0.0, 0.0
UV_Lock: True
UV_Lock: False
Utility operations:
- Reset scale, rotation, offset (Face-Aligned project)
- Center material to face
- Fit material to face dimensions
Material properties:
Default material settings:
- Panel: Anvil (Settings) - per-file defaults
- Addon Preferences - global defaults for new .blend files
Material Cleanup
"Cleanup Unused Materials" button
Hotspot Mapping System
Hotspot mapping assigns UV coordinates by matching face shapes to predefined regions on a texture atlas. Hotspot UVs are never mirrored - always non-flipped mapping.
Setting Up Hotspot Maps
In Hotspot Mapping workspace:
Data storage:
- Stored in .blend file by default
- Optional external JSON for cross-project sharing
Hotspot Orientation Types
Click orientation button next to hotspot or icon on hotspot itself to cycle:
Any
Upwards
Floor
Ceiling
Applying Hotspots
In 3D viewport Anvil panel:
"Randomise Hotspots" button
"Auto Apply Hotspots" toggle
"Fixed" property
"Choose Hotspot" button
Combined Faces & Seam Mode
Allow Combined Faces:
Seam Mode:
"Maintain User Seams"
"Display All Seams"
"Clear All Seams"
Size Weight slider:
Best practices:
- Create wide variety of aspect ratios and sizes in atlas
- Ensures good hotspot matching on any geometry
- Algorithm doesn't split non-rectangular islands (e.g., L-shapes remain separate faces)
Geometry Tools
Selection Tools
Backface Culling Override:
Vertex Paint mode:
Paint Select (Ctrl + Left Mouse):
Select Connected:
L
Ctrl+L
Ctrl+Shift+L
Shift+L
Context Aware Weld (W key)
Cube Cut Mode (C key in Edit mode)
1. Press C in Edit mode
2. Click on face to start drawing
3. Move mouse and click to define rectangular face
4. Move mouse third time to define depth
5. Click third time to make cut
Basic Navigation
Right Mouse Button
Tab
G
E
Alt+Click
B
L
Configuration
Addon Preferences
Access: Edit → Preferences → Add-ons → Anvil Level Design
"Create Level Design Workspace"
"Create Hotspot Mapping Workspace"
Default_Pixels_Per_Meter: 100.0
Default_Roughness: 0.5
Default_Transparency_Mode: "OPAQUE"
Per-File Settings
Anvil (Settings) panel:
Pixels_Per_Meter: 100.0
Roughness: 0.5
Enable_Vertex_Colors: False
Transparency_Settings: {...}
Code Examples
Python API - Material Application
import bpy
def apply_texture_to_selected_face(image_path):
"""Apply texture from file to selected face"""
img = bpy.data.images.load(image_path)
obj = bpy.context.active_object
if obj and obj.mode == 'EDIT':
pass
def get_anvil_material_settings():
"""Access Anvil material settings"""
prefs = bpy.context.preferences.addons['anvil-level-design'].preferences
settings = {
'pixels_per_meter': prefs.default_pixels_per_meter,
'roughness': prefs.default_roughness,
}
return settings
def set_uv_scale_rotation(scale_u=1.0, scale_v=1.0, rotation=0.0):
"""Set UV transformation via Anvil properties"""
obj = bpy.context.active_object
if obj and obj.mode == 'EDIT':
pass
Python API - Hotspot Management
import bpy
import json
def create_hotspot_data(image_name, hotspots):
"""Define hotspot data structure"""
hotspot_data = {
'image': image_name,
'hotspots': []
}
for hs in hotspots:
hotspot_data['hotspots'].append({
'bounds': {
'x_min': hs['x_min'],
'y_min': hs['y_min'],
'x_max': hs['x_max'],
'y_max': hs['y_max']
},
'orientation': hs.get('orientation', 'Any'),
'name': hs.get('name', '')
})
return hotspot_data
def export_hotspot_json(data, filepath):
"""Export hotspot data to external JSON"""
with open(filepath, 'w') as f:
json.dump(data, f, indent=2)
def apply_random_hotspots():
"""Trigger hotspot randomization on selected faces"""
pass
example_hotspots = [
{
'x_min': 0, : , : , : ,
: ,
:
},
{
: , : , : , : ,
: ,
:
}
]
Python API - Geometry Operations
import bpy
def context_aware_weld():
"""Execute context-aware weld"""
pass
def select_connected_by_normal():
"""Select connected faces with matching normals"""
pass
def paint_select_setup():
"""Setup for paint select mode"""
obj = bpy.context.active_object
if obj and obj.type == 'MESH':
bpy.ops.object.mode_set(mode='EDIT')
bpy.context.tool_settings.mesh_select_mode = (False, False, True)
Common Patterns
Level Design Workflow
Texture Atlas Setup
Material Optimization
Troubleshooting
Textures Not Applying Correctly
Problem: Alt+Left Mouse doesn't apply texture
1. Are you in Level Design workspace?
2. Is face actually selected (orange highlight)?
3. Is object in Edit mode?
4. Try Alt+Right Mouse to pick texture first
5. Check UV Lock setting in Anvil panel
6. Verify Scale U/V values (should typically be 1.0 or close)
7. Check if texture is mirrored (negative Scale U/V) - use panel to reset
Problem: Textures stretch when extruding
Hotspot Issues
Problem: Hotspots not applying
1. Is image marked as "Hotspottable" in Hotspot Mapping workspace?
2. Are hotspot regions properly defined (visible lines in Image Editor)?
3. Does face orientation match hotspot orientation type?
- Use Shift+Z to toggle wireframe and see face normals
4. Is "Allow Combined Faces" causing unexpected island grouping?
- Try disabling to process faces individually
Problem: Wrong hotspots selected
Problem: Hotspots creating seams
"Maintain User Seams"
"Display All Seams"
"Clear All Seams"
1. Switch to "Display All Seams" mode
2. See where algorithm splits geometry
3. Manually add seams where needed
4. Or disable "Allow Combined Faces" for per-face control
Selection Problems
Problem: Selecting through geometry
1. Turn OFF X-ray mode (Alt+Z) for backface culling to work
2. Use single-click selections, not drag selections
3. Avoid circle select - use Paint Select (Ctrl+Left Mouse) instead
4. Box select and lasso work for clicks, not drags
Problem: Cannot select specific faces
Ctrl+L
L
Shift+L
Alt+Click
Ctrl+Left Mouse
Performance Issues
Problem: Slow material application
1. Use "Cleanup Unused Materials" in Anvil panel regularly
2. Consolidate similar materials to atlases
3. Check material count in Outliner
1. Use decimation modifier on detail geometry
2. Merge unnecessary faces
3. Use instancing for repeated elements
Problem: Hotspot randomization slow
1. Reduce atlas resolution if possible
2. Reduce number of hotspot regions
3. Disable "Auto Apply Hotspots" during heavy modeling
4. Manually trigger with "Randomise Hotspots" when ready
Export Issues
Problem: Transparent materials wrong in GLB
1. Use "Fix Alpha Bleed" tool on source textures
2. Or enable premultiply alpha in material settings
3. Check material blend mode (should be appropriate for engine)
1. Verify all materials are assigned in Blender
2. Check Anvil (Export) panel settings
3. Test with simpler material setup first
Workspace Lost
Problem: Level Design or Hotspot Mapping workspace missing
1. Edit → Preferences → Add-ons → Anvil Level Design
2. Click "Create Level Design Workspace"
3. Click "Create Hotspot Mapping Workspace"
4. Workspaces appear at top of Blender window
Keyboard Shortcuts Not Working
Problem: Hotkeys don't trigger Anvil features
1. Are you in correct workspace? (Level Design or Hotspot Mapping)
2. Are you in correct mode? (Object vs Edit mode)
3. Check addon preferences for hotkey conflicts
4. Remap conflicting keys in preferences
5. Verify addon is enabled in preferences
Advanced Configuration
Custom Hotkey Setup
T
Shift+T
C
W
B
Performance Tuning
Max_Materials_Before_Warning: 50
Size_Weight: 0.3
Allow_Combined_Faces: False
Disable paint select if not needed
UV_Lock: False
Integration with Version Control
1. Define hotspots on texture atlas
2. Export hotspot data to JSON
3. Commit JSON to version control
4. Team members load same JSON
5. Consistent hotspot behavior across team
Resources
Quick Reference Card
Alt+Left Mouse
Alt+Right Mouse
Shift+Alt+Left Mouse
Ctrl+Alt+Left Mouse
T
Shift+T
WASD (in UV mode)
Q/E (in UV mode)
L
Ctrl+L
Shift+L
Ctrl+Left Mouse
B
C (Edit mode)
E
G
W
Right Mouse
Tab
Alt+Click
[ ]