fix: Dokumente-Ordner sprachunabhaengig aufloesen
- neues tools/_paths.sh loest den Dokumente-Ordner zur Laufzeit auf: xdg-user-dir DOCUMENTS, sonst ~/Dokumente, sonst ~/Documents - sync_assets.sh und rotoscope.sh nutzen workbench_dir statt $HOME/Documents/workbench_rinkplanner - promote_rotoscope.py und blender/rotoscope.py loesen den Workbench-Pfad genauso auf und bevorzugen weiterhin RINKPLANNER_WORKBENCH - Doku auf den tatsaechlichen Pfad ~/Dokumente/workbench_rinkplanner umgestellt
This commit is contained in:
parent
c3677bf3e1
commit
0ac0624ba2
9 changed files with 108 additions and 14 deletions
|
|
@ -177,7 +177,7 @@ Sprung. Der Export verwendet die zusammengesetzte Caption (`3Lz+2T`,
|
||||||
|
|
||||||
**D13 – 3D-Assets liegen extern, das Repo hält nur das Manifest.**
|
**D13 – 3D-Assets liegen extern, das Repo hält nur das Manifest.**
|
||||||
Die Binärdateien (GLB, `.blend`, Texturen) liegen im Workbench-Archiv unter
|
Die Binärdateien (GLB, `.blend`, Texturen) liegen im Workbench-Archiv unter
|
||||||
`~/Documents/workbench_rinkplanner`, nicht im Git-Repo. Das Repo enthält
|
`~/Dokumente/workbench_rinkplanner`, nicht im Git-Repo. Das Repo enthält
|
||||||
`assets/asset_manifest.json` mit ID, Quell-/Zielpfad, SHA-256, Größe,
|
`assets/asset_manifest.json` mit ID, Quell-/Zielpfad, SHA-256, Größe,
|
||||||
Platzierungsdaten und Rig-Metadaten. `tools/sync_assets.sh` prüft beide
|
Platzierungsdaten und Rig-Metadaten. `tools/sync_assets.sh` prüft beide
|
||||||
Seiten gegen den Hash, kopiert nach `assets/external/` (gitignored) und stößt
|
Seiten gegen den Hash, kopiert nach `assets/external/` (gitignored) und stößt
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ bleiben im Workbench-Archiv.
|
||||||
## Verzeichnisse
|
## Verzeichnisse
|
||||||
|
|
||||||
```
|
```
|
||||||
/home/torsten/Documents/workbench_rinkplanner/
|
/home/torsten/Dokumente/workbench_rinkplanner/
|
||||||
├── inbox/ # Eingang, unverändert lassen
|
├── inbox/ # Eingang, unverändert lassen
|
||||||
├── library/ # kuratiert, vom Manifest referenziert
|
├── library/ # kuratiert, vom Manifest referenziert
|
||||||
│ └── characters/
|
│ └── characters/
|
||||||
|
|
@ -112,7 +112,7 @@ Weitere Umgebungsvariablen:
|
||||||
|
|
||||||
| Variable | Standard | Zweck |
|
| Variable | Standard | Zweck |
|
||||||
| :--- | :--- | :--- |
|
| :--- | :--- | :--- |
|
||||||
| `RINKPLANNER_WORKBENCH` | `~/Documents/workbench_rinkplanner` | Archivpfad |
|
| `RINKPLANNER_WORKBENCH` | `~/Dokumente/workbench_rinkplanner` | Archivpfad |
|
||||||
| `RINKPLANNER_CREDENTIALS` | `<repo>/docs/credentials.txt` | FTP-Konfiguration |
|
| `RINKPLANNER_CREDENTIALS` | `<repo>/docs/credentials.txt` | FTP-Konfiguration |
|
||||||
| `GODOT` | `/opt/godot/Godot_v4.7.2-stable_linux.x86_64` | Import-Binary |
|
| `GODOT` | `/opt/godot/Godot_v4.7.2-stable_linux.x86_64` | Import-Binary |
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ reproduzierbar ins Projekt kommen.
|
||||||
|
|
||||||
- ARP liegt als Blender-5.2-Extension unter
|
- ARP liegt als Blender-5.2-Extension unter
|
||||||
`~/.config/blender/5.2/extensions/superhivemarket_com/`.
|
`~/.config/blender/5.2/extensions/superhivemarket_com/`.
|
||||||
- Die AI-Marker-Dateien fehlen (`~/Documents/AutoRigPro/AI` existiert nicht).
|
- Die AI-Marker-Dateien fehlen (`~/Dokumente/AutoRigPro/AI` existiert nicht).
|
||||||
Die Marker wurden deshalb skriptbasiert gesetzt:
|
Die Marker wurden deshalb skriptbasiert gesetzt:
|
||||||
Neck, Chin, Head Tip, Root, Thigh, Knee, Foot, Shoulder, Elbow, Hand,
|
Neck, Chin, Head Tip, Root, Thigh, Knee, Foot, Shoulder, Elbow, Hand,
|
||||||
Hand Tip.
|
Hand Tip.
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ Ohne eigenes Videomaterial lässt sich die Pipeline vollständig prüfen:
|
||||||
```bash
|
```bash
|
||||||
./tools/rotoscope.sh test-reference
|
./tools/rotoscope.sh test-reference
|
||||||
./tools/rotoscope.sh setup \
|
./tools/rotoscope.sh setup \
|
||||||
--reference "$HOME/Documents/workbench_rinkplanner/source/characters/skater/rotoscope/references/test_reference.mp4" \
|
--reference "$HOME/Dokumente/workbench_rinkplanner/source/characters/skater/rotoscope/references/test_reference.mp4" \
|
||||||
--out /tmp/rotoscope_test.blend --force
|
--out /tmp/rotoscope_test.blend --force
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
39
tools/_paths.sh
Normal file
39
tools/_paths.sh
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Gemeinsame Pfad-Helfer. Wird gesourct, nicht direkt ausgeführt.
|
||||||
|
|
||||||
|
# documents_dir
|
||||||
|
# Liefert den Dokumente-Ordner des Benutzers. Der Verzeichnisname hängt von
|
||||||
|
# der Systemsprache ab (XDG, z. B. ~/Dokumente oder ~/Documents) und wird
|
||||||
|
# deshalb zur Laufzeit aufgelöst.
|
||||||
|
documents_dir() {
|
||||||
|
local candidate=""
|
||||||
|
|
||||||
|
if command -v xdg-user-dir >/dev/null 2>&1; then
|
||||||
|
candidate="$(xdg-user-dir DOCUMENTS 2>/dev/null || true)"
|
||||||
|
# xdg-user-dir liefert $HOME, wenn kein Dokumente-Ordner konfiguriert ist.
|
||||||
|
if [[ -n "$candidate" && "$candidate" != "$HOME" && -d "$candidate" ]]; then
|
||||||
|
printf '%s\n' "$candidate"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
for candidate in "$HOME/Dokumente" "$HOME/Documents"; do
|
||||||
|
if [[ -d "$candidate" ]]; then
|
||||||
|
printf '%s\n' "$candidate"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
printf '%s\n' "$HOME/Documents"
|
||||||
|
}
|
||||||
|
|
||||||
|
# workbench_dir
|
||||||
|
# Pfad zum Workbench-Archiv: RINKPLANNER_WORKBENCH oder
|
||||||
|
# <Dokumente>/workbench_rinkplanner.
|
||||||
|
workbench_dir() {
|
||||||
|
if [[ -n "${RINKPLANNER_WORKBENCH:-}" ]]; then
|
||||||
|
printf '%s\n' "$RINKPLANNER_WORKBENCH"
|
||||||
|
else
|
||||||
|
printf '%s\n' "$(documents_dir)/workbench_rinkplanner"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
@ -4,14 +4,38 @@ import json
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
import struct
|
import struct
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
|
|
||||||
WORKBENCH = os.environ.get(
|
def documents_dir() -> str:
|
||||||
"RINKPLANNER_WORKBENCH",
|
"""Dokumente-Ordner des Benutzers; der Name hängt von der Sprache ab."""
|
||||||
os.path.expanduser("~/Documents/workbench_rinkplanner"),
|
home = os.path.expanduser("~")
|
||||||
|
try:
|
||||||
|
result = subprocess.run(
|
||||||
|
["xdg-user-dir", "DOCUMENTS"],
|
||||||
|
capture_output=True,
|
||||||
|
text=True,
|
||||||
|
check=False,
|
||||||
|
)
|
||||||
|
except OSError:
|
||||||
|
result = None
|
||||||
|
if result is not None and result.returncode == 0:
|
||||||
|
candidate = result.stdout.strip()
|
||||||
|
# xdg-user-dir liefert $HOME, wenn kein Ordner konfiguriert ist.
|
||||||
|
if candidate and candidate != home and os.path.isdir(candidate):
|
||||||
|
return candidate
|
||||||
|
for name in ("Dokumente", "Documents"):
|
||||||
|
candidate = os.path.join(home, name)
|
||||||
|
if os.path.isdir(candidate):
|
||||||
|
return candidate
|
||||||
|
return os.path.join(home, "Documents")
|
||||||
|
|
||||||
|
|
||||||
|
WORKBENCH = os.environ.get("RINKPLANNER_WORKBENCH") or os.path.join(
|
||||||
|
documents_dir(), "workbench_rinkplanner"
|
||||||
)
|
)
|
||||||
DEFAULT_RIG = os.path.join(
|
DEFAULT_RIG = os.path.join(
|
||||||
WORKBENCH, "source", "characters", "skater", "skater_rig_v006.blend"
|
WORKBENCH, "source", "characters", "skater", "skater_rig_v006.blend"
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,34 @@ import sys
|
||||||
|
|
||||||
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
MANIFEST = os.path.join(REPO_ROOT, "rinkplanner", "assets", "asset_manifest.json")
|
MANIFEST = os.path.join(REPO_ROOT, "rinkplanner", "assets", "asset_manifest.json")
|
||||||
WORKBENCH = os.environ.get(
|
|
||||||
"RINKPLANNER_WORKBENCH",
|
|
||||||
os.path.expanduser("~/Documents/workbench_rinkplanner"),
|
def documents_dir() -> str:
|
||||||
|
"""Dokumente-Ordner des Benutzers; der Name hängt von der Sprache ab."""
|
||||||
|
home = os.path.expanduser("~")
|
||||||
|
try:
|
||||||
|
result = subprocess.run(
|
||||||
|
["xdg-user-dir", "DOCUMENTS"],
|
||||||
|
capture_output=True,
|
||||||
|
text=True,
|
||||||
|
check=False,
|
||||||
|
)
|
||||||
|
except OSError:
|
||||||
|
result = None
|
||||||
|
if result is not None and result.returncode == 0:
|
||||||
|
candidate = result.stdout.strip()
|
||||||
|
# xdg-user-dir liefert $HOME, wenn kein Ordner konfiguriert ist.
|
||||||
|
if candidate and candidate != home and os.path.isdir(candidate):
|
||||||
|
return candidate
|
||||||
|
for name in ("Dokumente", "Documents"):
|
||||||
|
candidate = os.path.join(home, name)
|
||||||
|
if os.path.isdir(candidate):
|
||||||
|
return candidate
|
||||||
|
return os.path.join(home, "Documents")
|
||||||
|
|
||||||
|
|
||||||
|
WORKBENCH = os.environ.get("RINKPLANNER_WORKBENCH") or os.path.join(
|
||||||
|
documents_dir(), "workbench_rinkplanner"
|
||||||
)
|
)
|
||||||
ASSET_ID = "character.skater.figure"
|
ASSET_ID = "character.skater.figure"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,9 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
WORKBENCH="${RINKPLANNER_WORKBENCH:-$HOME/Documents/workbench_rinkplanner}"
|
# shellcheck source=tools/_paths.sh
|
||||||
|
source "$REPO_ROOT/tools/_paths.sh"
|
||||||
|
WORKBENCH="$(workbench_dir)"
|
||||||
BLENDER="${BLENDER:-$(command -v blender || true)}"
|
BLENDER="${BLENDER:-$(command -v blender || true)}"
|
||||||
SCRIPT="$REPO_ROOT/tools/blender/rotoscope.py"
|
SCRIPT="$REPO_ROOT/tools/blender/rotoscope.py"
|
||||||
|
|
||||||
|
|
@ -47,6 +49,7 @@ Aufruf: tools/rotoscope.sh <befehl> [optionen]
|
||||||
|
|
||||||
Umgebung:
|
Umgebung:
|
||||||
RINKPLANNER_WORKBENCH Workbench-Archiv
|
RINKPLANNER_WORKBENCH Workbench-Archiv
|
||||||
|
(Standard: <Dokumente>/workbench_rinkplanner)
|
||||||
BLENDER Blender-Binary
|
BLENDER Blender-Binary
|
||||||
RINKPLANNER_RIG Quell-Rig (Standard: skater_rig_v006.blend)
|
RINKPLANNER_RIG Quell-Rig (Standard: skater_rig_v006.blend)
|
||||||
EOF
|
EOF
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,11 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
# shellcheck source=tools/_paths.sh
|
||||||
|
source "$REPO_ROOT/tools/_paths.sh"
|
||||||
PROJECT_DIR="$REPO_ROOT/rinkplanner"
|
PROJECT_DIR="$REPO_ROOT/rinkplanner"
|
||||||
MANIFEST="$PROJECT_DIR/assets/asset_manifest.json"
|
MANIFEST="$PROJECT_DIR/assets/asset_manifest.json"
|
||||||
WORKBENCH="${RINKPLANNER_WORKBENCH:-$HOME/Documents/workbench_rinkplanner}"
|
WORKBENCH="$(workbench_dir)"
|
||||||
GODOT="${GODOT:-/opt/godot/Godot_v4.7.2-stable_linux.x86_64}"
|
GODOT="${GODOT:-/opt/godot/Godot_v4.7.2-stable_linux.x86_64}"
|
||||||
if [[ ! -x "$GODOT" && -x "/Applications/Godot.app/Contents/MacOS/Godot" ]]; then
|
if [[ ! -x "$GODOT" && -x "/Applications/Godot.app/Contents/MacOS/Godot" ]]; then
|
||||||
GODOT="/Applications/Godot.app/Contents/MacOS/Godot"
|
GODOT="/Applications/Godot.app/Contents/MacOS/Godot"
|
||||||
|
|
@ -51,7 +53,8 @@ Aufruf: tools/sync_assets.sh [--check|--sync|--publish] [--force]
|
||||||
|
|
||||||
Umgebung:
|
Umgebung:
|
||||||
RINKPLANNER_WORKBENCH Pfad zum Workbench-Archiv
|
RINKPLANNER_WORKBENCH Pfad zum Workbench-Archiv
|
||||||
(Standard: ~/Documents/workbench_rinkplanner)
|
(Standard: <Dokumente>/workbench_rinkplanner,
|
||||||
|
z. B. ~/Dokumente/workbench_rinkplanner)
|
||||||
RINKPLANNER_CREDENTIALS Pfad zur FTP-Konfiguration
|
RINKPLANNER_CREDENTIALS Pfad zur FTP-Konfiguration
|
||||||
(Standard: <repo>/docs/credentials.txt)
|
(Standard: <repo>/docs/credentials.txt)
|
||||||
RINKPLANNER_FTP_HOST FTP-Host (überschreibt FTP_URL)
|
RINKPLANNER_FTP_HOST FTP-Host (überschreibt FTP_URL)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue