---
name: validate-metadata
description: Stamp SimReady validation results into a USD asset's customLayerData after a validation run. Use when writing validation outcomes into a USD file's SimReady_Metadata — including results for failing assets.
license: Apache-2.0
compatibility: Requires simready-validate (pip install simready-validate). Asset must be a .usd or .usda file.
metadata:
  author: NVIDIA
  library: simready.validate
  version: "2026.06"
---

## Stamp validation results into a USD (Python)

Pass `write_metadata=True` to `AssetValidationConfig`. Results are written whenever
validation produces results — including for failing assets. The file is saved in place.

```python
import simready.validate as sv

result = sv.validate_asset(sv.AssetValidationConfig(
    asset_path="/assets/crate_01.usd",
    profile_id="Prop-Robotics-Neutral",
    profile_version="2.0.0",
    write_metadata=True,
))

if result is None:
    print("Asset not found or no profile resolved.")
else:
    passed = all(f["passed"] for f in result.features_summary.values())
    print("PASSED" if passed else "FAILED", "— metadata stamped into USD.")
```

## Stamp validation results into a USD (CLI)

Use `--stamp-asset-validation`. Writes validation results into the USD regardless of
pass/fail, as long as results are produced.

```bash
simready-validate \
  --rules-path /specs/capabilities \
  --features-path /specs/features \
  --profiles-path /specs/profiles \
  --profile Prop-Robotics-Neutral --version 2.0.0 \
  --stamp-asset-validation \
  /assets/crate_01.usd
```

Combine with `--asset_list` to stamp a batch:

```bash
simready-validate \
  --rules-path /specs/capabilities \
  --features-path /specs/features \
  --profiles-path /specs/profiles \
  --profile Prop-Robotics-Neutral \
  --stamp-asset-validation \
  --asset_list assets.txt
```

## Metadata structure written into the USD

```
customLayerData["SimReady_Metadata"]["validation"] = {
    "profile": "Prop-Robotics-Neutral",
    "profile_version": "2.0.0",
    "validated_features": {
        "2026-05-01": {
            "FET001_BASE_NEUTRAL": { "version": "1.0.0", "passed": true },
            ...
        }
    }
}
```

Multiple runs accumulate entries under different date keys in `validated_features`.

## Key rules

- Stamping fires whenever `write_metadata=True` and validation produced results — both
  passing and failing assets are stamped with their actual results.
- Stamping is skipped only when `validate_asset` returns `None` (missing file, wrong
  extension, or no profile resolved) — in that case there are no results to write.
- `simready.validate` owns the `validation` section only — it never writes
  `runtime_tests` or base fields (`asset_id`, `asset_class`, etc.).

For full API reference see [references/python-api.md](references/python-api.md).
