一键导入
tune-parameters
Interactive parameter tuning for a Usd Optimize operation. Use to iterate on op parameters, or to author a tuning guide.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Interactive parameter tuning for a Usd Optimize operation. Use to iterate on op parameters, or to author a tuning guide.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | tune-parameters |
| description | Interactive parameter tuning for a Usd Optimize operation. Use to iterate on op parameters, or to author a tuning guide. |
| version | 1.0.0 |
| allowed-tools | Read, Glob, Edit, Write, Bash |
| metadata | {"author":"NVIDIA Corporation","tags":["tuning","parameters","interactive"]} |
Operation guides live in .agents/operations/. Use the Glob tool to list them when needed.
You are a tuning assistant for Usd Optimize operations. Follow this protocol.
Search this doc for keywords like Tier 1, Tier 2, Tier 3, session log, screenshot, usdview, guide authoring, INVOCATION.md to jump.
pxr or fallback)..agents/operations/<key>.md.Companion docs: .agents/operations/<key>.md (per-operation guides), .agents/operations/_template.md (guide skeleton), .agents/operations/INVOCATION.md (how to actually run an operation), .agents/operations/PIPELINES.md (multi-op chains by bottleneck). Companion skills: run-operations (executes the tuned config), interpret-validators (decides which op to tune in the first place).
Check what the user is asking for:
Read .agents/operations/INDEX.md and help the user pick an operation. The index lists operations sorted by argument count — operations with more arguments generally benefit more from guided tuning.
If the user has a goal rather than a specific operation (e.g., "reduce polycount", "close holes"), consult the operation guides in .agents/operations/ and PLUGINS.md to recommend the right operation for their goal.
Use a three-tier fallback.
Guide exists at .agents/operations/<operation>.md:
.agents/docs/sessions/<operation>.md for session logsNo guide, but .agents/docs/sessions/<operation>.md exists:
No guide and no session logs:
source/operations/<operation>/ — extract addArgument() calls to build a parameter table/tune-parameters create a guide for <operation>."Ask the user for:
If the user provides a USD file path, auto-inspect it to extract scene units, bounding box, and prim hierarchy — do not ask the user for these manually.
Use a 3-tier approach to inspect the USD file. Try each tier in order and use the first one that works.
Probe: run python -c "from pxr import Usd; print('ok')" (Windows) or python3 -c "from pxr import Usd; print('ok')" (Linux/macOS). If it prints ok, standalone pxr is available.
Write a temp script to ./_tmp_usd_traverse.py in the current working directory:
from pxr import Usd, UsdGeom
stage = Usd.Stage.Open('<input.usdc>')
lines = []
lines.append(f'metersPerUnit: {UsdGeom.GetStageMetersPerUnit(stage)}')
lines.append(f'upAxis: {UsdGeom.GetStageUpAxis(stage)}')
bb = UsdGeom.BBoxCache(Usd.TimeCode.Default(), [UsdGeom.Tokens.default_])
rng = bb.ComputeWorldBound(stage.GetPseudoRoot()).GetRange()
lines.append(f'bbox size: {rng.GetMax() - rng.GetMin()}')
lines.append('Top-level prims:')
for p in stage.GetPseudoRoot().GetChildren():
lines.append(f' {p.GetPath()} ({p.GetTypeName()})')
lines.append('All Mesh prims:')
for p in stage.Traverse():
if p.GetTypeName() == 'Mesh':
lines.append(f' {p.GetPath()}')
print('\n'.join(lines))
Run: python _tmp_usd_traverse.py (Windows) or python3 _tmp_usd_traverse.py (Linux/macOS). Read output directly from bash stdout.
If the standalone pxr probe fails, tell the user:
"USD inspection requires usd-core (pip install usd-core). Install it for the fastest experience."
Skip to Step 4 with whatever context the user can provide manually.
Use metersPerUnit to determine scene units (0.001 = mm, 0.01 = cm, 1.0 = m) and scale world-space parameters accordingly.
After inspecting the USD file, offer to generate a rendered screenshot:
"I can generate a rendered preview of the scene. By default I'll auto-position a camera based on the bounding box. Would you like:
Execution flow:
python3 -c "import ovrtx; print('ok')" (Linux/macOS) or python -c "import ovrtx; print('ok')" (Windows)which usdrecord (Linux/macOS) or where usdrecord (Windows)usd-core (pip install usd-core) or ovrtx--purposes render by default (renders the full-detail geometry). Only use --purposes proxy if the user explicitly requests proxy geometry.open <path> (macOS), xdg-open <path> (Linux), powershell.exe -Command "Invoke-Item '<path>'" (Windows)<output_dir>/screenshot_<operation>_v<iteration>.pngWireframe rendering: If the user requests wireframe or wireframe-on-shaded, read .agents/docs/screenshot-generation.md#wireframe-rendering for the full approach comparison and implementation details. Quick summary:
UsdImagingGLEngine with DRAW_WIREFRAME_ON_SURFACE — single-pass, requires PySide6 + pxrovrtx.config.json to set /rtx/wireframe/mode to 1, render, restore configLineCollectionReference scripts: all rendering approaches have full working implementations committed at .agents/scripts/rendering/. Use these as templates — replace REPLACE_WITH_* placeholders with scene-specific values.
See .agents/docs/screenshot-generation.md for full implementation details, environment setup, and code snippets.
After screenshot generation probes, also probe for interactive viewing tools. Cache these results for Steps 4–5.
usdview: Do NOT hardcode paths. usdview is only in full OpenUSD builds or system packages — pip usd-core does NOT include it.
Probe in order:
where usdview (Windows) or which usdview (Linux/macOS)python -c "import pxr, pathlib; p = pathlib.Path(pxr.__file__).parent.parent.parent / 'bin' / 'usdview'; print(p) if p.exists() else print('')" (Windows) or same with python3 (Linux/macOS)$USD_INSTALL_ROOT/bin/usdview or $USD_PATH/bin/usdviewpython <usdview_path> --help 2>&1 | head -1 (Linux/macOS) or python <usdview_path> --help 2>&1 | Select-Object -First 1 (PowerShell) — should print usage infoCache: usdview_available (bool), usdview_path (path), usdview_python (the Python interpreter that can import pxr — use the same one to launch usdview)
Explain what the key parameters do in plain language (use the guide's Overview, or C++ source descriptions for Tier 2/3) so the user can iterate independently. Then pick a starting config from the guide (Tier 1), session logs (Tier 2), or construct a conservative default (Tier 3), and provide:
[{"operation": "<key>", "param1": value1, ...}]usdOptimize binary from the build output.After presenting the CLI command, check the cached interactive viewing probes and offer:
If usdview available:
"After running the batch optimization, I can open the result in usdview for 3D inspection. Would you like that?"
If user accepts: run the batch command first, then launch usdview on the output (see usdview Viewer Launch).
If neither available: proceed with headless batch + screenshots (current behavior).
.agents/docs/sessions/<operation>.md? This helps future users and improves the tuning experience for this operation." If yes, append the session (input, goal, iteration log, key learnings, final config) to the session file.For operation developers who want to create a tuning guide. Triggered by "create a guide for X" or similar.
source/operations/<operation>/ — extract all addArgument() calls (name, type, default, description, hidden flag).agents/operations/_template.md.agents/operations/<operation>.md:
TODO(developer) wrapped in an HTML comment, written as <!-- TODO(developer) -->) with contextual prompts based on what we know from the sourceINDEX.md if a new operation was addedUse this to open a USD file in the standalone USD viewer for 3D inspection. Viewer-only — no parameter editing. User runs batch optimization separately.
Use the same probing steps described in the usdview section of Step 2 (Interactive Viewing Tool Probes) above. Use cached usdview_available, usdview_path, and usdview_python values from that probe.
bin/usdview) plus a .cmd wrapper. The Python script has a hardcoded shebang that may not match the current Python. Always launch via python <usdview_path> to use the active interpreter.PYTHONPATH and PATH set by shell config. usdview is on PATH after sourcing.apt install usd-tools): usdview directly on PATH.<venv>/bin/python <venv>/bin/usdview.PYTHONPATH sourced but bin/ not on PATH: pxr importable but usdview not callable. Derive path from pxr location (probe step 2).# Windows (always use python to avoid shebang issues):
python <usdview_path> <output.usd>
# Linux/macOS — if on PATH:
usdview <output.usd> &
# Linux/macOS — if in a venv:
<venv>/bin/python <venv>/bin/usdview <output.usd> &
# Linux/macOS — if pxr importable but usdview not on PATH:
python3 <usdview_path> <output.usd> &
Run in background (run_in_background: true) so the tuning session continues.
TODO(developer) wrapped in an HTML comment, written as <!-- TODO(developer) -->) indicate gaps in the guide. Be transparent and suggest the user experiment or consult the operation author.Run an interactive, screenshot-driven tuning loop for a single Scene Optimizer operation. Loads a tier-appropriate knowledge source (full guide → session log → C++ source), generates a starting config based on the asset's metrics, and iterates one-parameter-at-a-time with the user until the output is acceptable. Doubles as the guide-authoring mode for operation developers.
./repo.sh build or repo.bat build) so the
usdOptimize binary and bundled Python are available.pxr for the Step 3 inspection — either
standalone (pip install usd-core) or the build's bundled
_build/target-deps/python/.ovrtx, usdrecord, or usdview)
for visual diagnosis. The skill probes for these and falls back to
headless mode if none is available.run-operations with --pipeline; this skill iterates a single op.| Symptom | Likely cause | Fix |
|---|---|---|
pxr probe fails | USD bindings not installed and the repo isn't built. | pip install usd-core or run the build skill first. |
| usdview probe finds nothing | usdview isn't installed (pip usd-core doesn't include it). | Use a full OpenUSD build, install the system usd-tools package, or fall back to headless screenshots. |
| Operation guide says one thing, source says another | Guide is stale (drift from C++ defaults). | Trust the C++ source for parameter defaults; flag the guide entry for the operation author. |
| Iteration loop drifts off-target | Changing more than one parameter at a time. | Revert to the previous config and adjust one parameter; ask the user before composing changes. |
printStats shows different counts than the proxy | printStats is whole-stage. | For per-subtree numbers, use the post-export traversal in the operation guide (e.g. create-proxy runtime verification). |
Reference for Usd Optimize's validator infrastructure (registration, CLI, logging, REQUIRES_MESH cache). Do not use for ad-hoc validation runs — use run-validators instead.
Build Usd Optimize from source via repo.sh (Linux) or repo.bat (Windows). Use when compiling the repo, switching configs, or selecting a USD flavor.
Diff two USD stages by prim/mesh/vertex/material count, file size, and validator summary. Use for before/after optimization comparisons.
Create a USD proxy mesh sibling. Use to generate decimated, bbox, or LOD stand-ins, with optional render/proxy purpose variant set.
Triage a failing Usd Optimize operation. Use when an op errors, silently no-ops, or returns unexpected output.
Collapse duplicate prim hierarchies into instanceable internal references. Use when deduplicating subtrees or folding repeated prims into prototypes.