-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathinstall_ovphysx_helpers.sh
More file actions
executable file
·69 lines (60 loc) · 2.27 KB
/
Copy pathinstall_ovphysx_helpers.sh
File metadata and controls
executable file
·69 lines (60 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
GUIDE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
OV_REPO="${OV_REPO:-$HOME/work/ov-blender-hermes-demo/omniverse-labs/projects/ov-blender-example}"
OV_RUNTIME_ROOT="${OV_RUNTIME_ROOT:-}"
DEMO_ROOT="${DEMO_ROOT:-$HOME/work/ov-blender-hermes-demo}"
INSTALL_ROOT="${OVPHYSX_HELPER_ROOT:-$HOME/.local/share/nemoclaw-blender}"
CONFIG_ROOT="${OVPHYSX_HELPER_CONFIG_ROOT:-$HOME/.config/nemoclaw-blender}"
if [ -z "$OV_RUNTIME_ROOT" ]; then
echo "OV_RUNTIME_ROOT must point to the installed platform runtime root." >&2
exit 2
fi
fixture_root="$OV_REPO/tests/fixtures/data/demo_stair_drop_1280x720"
fixture="$fixture_root/fixture/stair_drop_ovrtx_ovphysx.usda"
prepare_script="$OV_REPO/tests/fixtures/demo_stair_drop_1280x720/prepare.py"
output_dir="${OVPHYSX_OUTPUT_DIR:-$DEMO_ROOT/out/stair-drop}"
mkdir -p "$INSTALL_ROOT" "$CONFIG_ROOT" "$output_dir"
install -m 0755 "$GUIDE_ROOT/scripts/run_ovphysx_timeline.py" "$INSTALL_ROOT/run_ovphysx_timeline.py"
install -m 0755 "$GUIDE_ROOT/scripts/ovphysx_host_helper.py" "$INSTALL_ROOT/ovphysx_host_helper.py"
python3 - \
"$CONFIG_ROOT/ovphysx-helper.json" \
"$OV_REPO" \
"$OV_RUNTIME_ROOT" \
"$fixture" \
"$prepare_script" \
"$INSTALL_ROOT/run_ovphysx_timeline.py" \
"$output_dir" <<'PY'
import json
from pathlib import Path
import sys
config = {
"ov_repo": sys.argv[2],
"runtime_root": sys.argv[3],
"fixture": sys.argv[4],
"prepare_script": sys.argv[5],
"timeline_runner": sys.argv[6],
"output_dir": sys.argv[7],
"body_prims": [
f"/World/PhysicsIsland/DynamicBodies/Cube_{index:02d}"
for index in range(12)
],
"address": "127.0.0.1:50095",
"device": "cpu",
"steps": 240,
"sample_every": 10,
"fps": 60.0,
"render_engine": "BLENDER_WORKBENCH",
"resolution": [640, 360],
"gif_fps": 12,
"replace_scene": True,
"ffmpeg": "/usr/bin/ffmpeg",
}
path = Path(sys.argv[1])
path.write_text(json.dumps(config, indent=2, sort_keys=True) + "\n", encoding="utf-8")
print(path)
PY
echo "installed OVPhysX helpers under $INSTALL_ROOT"
echo "wrote helper configuration to $CONFIG_ROOT/ovphysx-helper.json"