Metadata-Version: 2.3
Name: usd2msd
Version: 0.8.0
Summary: convert pxr-usd file to msd file
Author: Motphys
Author-email: Motphys <developers@motphys.com>
License: MIT
Requires-Dist: usd-core~=25.8
Requires-Dist: types-usd~=24.5.2
Requires-Dist: numpy
Requires-Dist: pillow~=11.3.0
Requires-Dist: gltf-ibl-sampler==0.1.1b0
Requires-Dist: requests~=2.32.0
Requires-Dist: meshoptimizer>=0.2.20a5
Requires-Dist: motrixsim-core==0.8.0
Requires-Python: >=3.10, <3.14
Description-Content-Type: text/markdown

# usd2msd

This project is an offline converter for Omniverse-specific USD files to MSD.

This project is a sub-project. Unless explicitly specified, all paths in this README are relative
to the project root, and all commands are assumed to run from that directory.

## Setup Environment

This project uses `pyproject.toml` to manage dependencies. You can use any Python package manager
that supports PEP 518. With `uv`, run:

```
uv sync
```

to install runtime dependencies and the default dev dependency group.

This project requires Python `>=3.10, <3.14`.

## Hello World USD

Run the Python script using:

```
uv run examples/hello_world_usd.py
```

This converts `hello_world.usda` and loads it directly into MotrixSim via the PyO3 MSD binding. No intermediate file is written.

## Usage

`Converter.convert()` returns an `msd.World` object (a PyO3 Rust object) directly:

```python
from pathlib import Path
from usd2msd import Converter

converter = Converter()
world = converter.convert(Path("scene.usda"))
# world is a motrixsim.msd.World object, ready for use in MotrixSim
```

To use the world in MotrixSim:

```python
import motrixsim as mx

model = mx.load_usd("scene.usda")  # internally calls Converter and builds the scene
```

## Developer Guide

### Update MSD Python Stubs

MSD types are exposed directly via PyO3 bindings from `motrixsim.msd`. When MSD structure in the main project changes, regenerate the Python stubs:

```
cd motrixsim-python/motrixsim-core
cargo run --bin stub_gen
```

### Inspect Binary USD Files

To convert or flatten a binary USD file to readable USDA for inspection or debugging, edit and run:

```
uv run scripts/flatten_to_usda.py
```
