Files
settled-reach/.claude/skills/sprite-gen/scripts/render.sh
T
jpmschweitzerandClaude Opus 4.6 f0bab3999d chore(skills): rename all skills to domain-action convention
Adopts the whatsinagame naming pattern where the domain comes
first and the action second (e.g. pr-review, sprint-start,
audio-gen). Updated all cross-references in settings, agents,
docs, and inter-skill references.

12 renames: commit→git-commit, create-skill→skill-create,
gen-audio→audio-gen, gen-image→image-gen, plan-sprint→sprint-plan,
push-pr→pr-push, render-sprite→sprite-gen, review-pr→pr-review,
search-docs→docs-search, start-sprint→sprint-start,
start-workshop→workshop-start.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 12:51:56 +01:00

48 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# Render a 3D model to 2D sprites at 3 resolutions from 4 cardinal directions.
# Usage: render.sh <model_name> [godot_path]
# Example: render.sh wall_structural
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/renderer"
SCENE="res://render_scene.tscn"
OUTPUT="$PROJECT/output"
# Verify model exists
MODEL_FILE="$PROJECT/models/${MODEL_NAME}.tscn"
if [ ! -f "$MODEL_FILE" ]; then
echo "ERROR: Model not found: $MODEL_FILE"
echo "Available models:"
ls "$PROJECT/models/"*.tscn 2>/dev/null | xargs -I{} basename {} .tscn
exit 1
fi
echo "Rendering: $MODEL_NAME"
echo "Godot: $GODOT"
echo "Project: $PROJECT"
# Ensure resources are imported (headless, no display needed)
echo "Importing resources..."
"$GODOT" --path "$PROJECT" --headless --import 2>&1 || echo "Warning: import step had errors (may be non-fatal)"
# Run Godot with the render scene, passing model name as user arg
"$GODOT" --path "$PROJECT" "$SCENE" -- "$MODEL_NAME" 2>&1
# Check output
EXPECTED_FILES=0
for dir in north east south west; do
for res in 1024 256 64; do
f="$OUTPUT/${MODEL_NAME}_${dir}_${res}.png"
if [ -f "$f" ]; then
EXPECTED_FILES=$((EXPECTED_FILES + 1))
fi
done
done
echo ""
echo "Generated $EXPECTED_FILES/12 files in $OUTPUT/"
ls -la "$OUTPUT/${MODEL_NAME}"_*.png 2>/dev/null || echo "No output files found."