Add .gitignore entries for spike Godot caches, import artifacts, and vendor asset downloads. Add tooling/blender wrapper that resolves flatpak/native Blender installs and auto-converts relative paths to absolute for flatpak sandbox compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
835 B
Bash
Executable File
29 lines
835 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Blender wrapper — resolves flatpak/native/brew installs to a single entry point.
|
|
# All project scripts should call this instead of 'blender' directly.
|
|
#
|
|
# Resolves relative paths in --python and -- args to absolute paths so flatpak
|
|
# sandboxing doesn't break file resolution.
|
|
#
|
|
# Usage:
|
|
# tooling/blender --background --python script.py -- input.glb output.glb
|
|
|
|
# Convert relative paths to absolute
|
|
args=()
|
|
for arg in "$@"; do
|
|
if [[ -e "$arg" ]]; then
|
|
args+=("$(realpath "$arg")")
|
|
else
|
|
args+=("$arg")
|
|
fi
|
|
done
|
|
|
|
if command -v blender &>/dev/null; then
|
|
exec blender "${args[@]}"
|
|
elif flatpak info org.blender.Blender &>/dev/null 2>&1; then
|
|
exec flatpak run org.blender.Blender "${args[@]}"
|
|
else
|
|
echo "ERROR: Blender not found (checked PATH and flatpak)" >&2
|
|
exit 1
|
|
fi
|