"""
Retopology Pipeline Prompt
Provides guided workflow for complete retopology from high-poly to game-ready asset.
"""
def retopo_pipeline() -> str:
"""Guided workflow for complete retopology pipeline from high-poly to game-ready asset"""
return """# Retopology Pipeline: High-Poly to Clean Low-Poly
This prompt guides you through a complete retopology workflow in Blender.
## Phase 1: Analysis & Preparation
1. **Analyze the high-poly mesh**
- Use `mesh_stats(active_only=true)` to understand current topology
- Use `detect_topology_issues()` to identify problems
- Fix critical issues before proceeding (non-manifold, inverted normals, etc.)
2. **Clean up if needed**
- If mesh is very messy: Use `voxel_remesh(voxel_size=0.1)` for initial cleanup
- This creates uniform topology suitable for further processing
## Phase 2: Remeshing Strategy
Choose based on your needs:
**Option A: Quad-Dominant (Best for animation/subdivision)**
- Use `quadriflow_remesh(target_faces=5000, preserve_sharp=true)`
- IMPORTANT: Requires manifold mesh with consistent normals
- If it fails, run `detect_topology_issues()` and fix reported problems
**Option B: Voxel-Based (Good for organic/sculpted forms)**
- Use `voxel_remesh(voxel_size=0.05, adaptivity=0.5)`
- Smaller voxel_size = more detail
- Higher adaptivity = more detail in curved areas
**Option C: Manual Decimation (For LODs)**
- Use `decimate(ratio=0.5, mode="COLLAPSE")`
- Reduces polycount while preserving shape
- Good for creating LOD meshes
## Phase 3: Refinement
1. **Project to preserve silhouette** (if using manual retopo)
- Use `shrinkwrap_reproject(high="HighPoly", low="LowPoly", method="NEAREST_SURFACEPOINT")`
- Ensures low-poly conforms to high-poly surface
2. **Mark edges for shading**
- Use `mark_sharp_by_angle(angle=30)` for hard-surface models
- This ensures proper smooth shading with crisp edges
3. **Prepare for UV unwrapping**
- Use `mark_seams_by_angle(angle=60)` to auto-place UV seams
- Seams will be placed at sharp corners automatically
## Phase 4: Visual Inspection
1. **Check different views**
- Use `align_view_to_axis(axis="Y", side="POS")` for front view
- Use `set_view_projection(projection="ORTHO")` for orthographic view
- Use `get_viewport_screenshot(preset="wire")` to capture wireframe for review
2. **Verify topology**
- Use `mesh_stats()` to confirm target polycount
- Use `detect_topology_issues()` to ensure clean topology
## Phase 5: Export (Future Enhancement)
Export the finalized mesh for use in game engines or rendering.
## Common Workflows
**Sculpted Character → Game-Ready:**
1. `detect_topology_issues()` - check for problems
2. `quadriflow_remesh(target_faces=8000)` - create quad mesh
3. `mark_sharp_by_angle(angle=45)` - fix shading
4. `mesh_stats()` - verify polycount
**High-Poly Scan → LOD Mesh:**
1. `voxel_remesh(voxel_size=0.1)` - initial cleanup
2. `decimate(ratio=0.25, mode="COLLAPSE")` - reduce to 25%
3. `mark_seams_by_angle(angle=60)` - prep for UVs
4. `mesh_stats()` - verify
**Hard-Surface Asset → Clean Topology:**
1. `detect_topology_issues()` - identify problems
2. `quadriflow_remesh(target_faces=3000, preserve_sharp=true)`
3. `mark_sharp_by_angle(angle=30)` - preserve hard edges
4. Visual inspection with viewport tools
## Tips
- Always check mesh stats before and after operations
- QuadriFlow is powerful but requires clean input - fix topology issues first
- Use viewport screenshots to get visual feedback during the process
- Mark sharp edges AFTER remeshing for best results
- Lower voxel size = more detail but more faces
"""