refactor(assets): move sprite renderer to standalone project at renderer/
Separates the 3D-to-2D render pipeline from the game client into its own minimal Godot project. No autoloads, no plugins, no game code — just the render scene, models, textures, and export script. Eliminates SimBridge parse errors and gdUnit4 scanning during renders. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,8 +6,7 @@ description: >
|
||||
east, south, west) with outline applied at working resolution. Use when the
|
||||
user says "render sprite", "render model", "run the render pipeline",
|
||||
"test the pipeline", "/render-sprite", or asks to render a specific model
|
||||
(e.g., "render wall_structural"). Output: 12 PNG files in
|
||||
client/tooling/sprite_renderer/output/.
|
||||
(e.g., "render wall_structural"). Output: 12 PNG files in renderer/output/.
|
||||
---
|
||||
|
||||
## Render Pipeline
|
||||
@@ -20,15 +19,15 @@ Run the render script with the model name:
|
||||
|
||||
### Available Models
|
||||
|
||||
Models live at `client/tooling/sprite_renderer/models/<name>.tscn`. List them:
|
||||
Models live at `renderer/models/<name>.tscn`. List them:
|
||||
|
||||
```bash
|
||||
ls client/tooling/sprite_renderer/models/*.tscn | xargs -I{} basename {} .tscn
|
||||
ls renderer/models/*.tscn | xargs -I{} basename {} .tscn
|
||||
```
|
||||
|
||||
### Output
|
||||
|
||||
12 files per model in `client/tooling/sprite_renderer/output/`:
|
||||
12 files per model in `renderer/output/`:
|
||||
|
||||
```
|
||||
<model>_north_1024.png <model>_north_256.png <model>_north_64.png
|
||||
@@ -46,11 +45,11 @@ ls client/tooling/sprite_renderer/models/*.tscn | xargs -I{} basename {} .tscn
|
||||
### Troubleshooting
|
||||
|
||||
- **No output files**: Godot needs a display. If running headless, prefix with `xvfb-run`.
|
||||
- **Model not found**: Check the model .tscn exists in `models/` directory.
|
||||
- **Model not found**: Check the model .tscn exists in `renderer/models/`.
|
||||
- **Godot not found**: Pass path as second arg: `render.sh wall_structural /path/to/godot`
|
||||
|
||||
### Adding New Models
|
||||
|
||||
1. Create model scene at `client/tooling/sprite_renderer/models/<name>.tscn`
|
||||
2. Apply texture from `textures/` via StandardMaterial3D
|
||||
1. Create model scene at `renderer/models/<name>.tscn`
|
||||
2. Apply texture from `renderer/textures/` via StandardMaterial3D
|
||||
3. Run: `.claude/skills/render-sprite/scripts/render.sh <name>`
|
||||
|
||||
@@ -7,16 +7,16 @@ set -euo pipefail
|
||||
MODEL_NAME="${1:?Usage: render.sh <model_name> [godot_path]}"
|
||||
GODOT="${2:-$HOME/bin/godot}"
|
||||
REPO_ROOT="$(cd "$(dirname "$0")" && git rev-parse --show-toplevel)"
|
||||
PROJECT="$REPO_ROOT/client"
|
||||
SCENE="res://tooling/sprite_renderer/render_scene.tscn"
|
||||
OUTPUT="$PROJECT/tooling/sprite_renderer/output"
|
||||
PROJECT="$REPO_ROOT/renderer"
|
||||
SCENE="res://render_scene.tscn"
|
||||
OUTPUT="$PROJECT/output"
|
||||
|
||||
# Verify model exists
|
||||
MODEL_FILE="$PROJECT/tooling/sprite_renderer/models/${MODEL_NAME}.tscn"
|
||||
MODEL_FILE="$PROJECT/models/${MODEL_NAME}.tscn"
|
||||
if [ ! -f "$MODEL_FILE" ]; then
|
||||
echo "ERROR: Model not found: $MODEL_FILE"
|
||||
echo "Available models:"
|
||||
ls "$PROJECT/tooling/sprite_renderer/models/"*.tscn 2>/dev/null | xargs -I{} basename {} .tscn
|
||||
ls "$PROJECT/models/"*.tscn 2>/dev/null | xargs -I{} basename {} .tscn
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user