---
name: basic-workflow
description: Create an ovphysx instance, load a USD scene, step simulation, and clean up. Use when starting a new ovphysx project, testing basic integration, or learning the minimal workflow.
---

# Basic Workflow: Load USD and Step

The smallest end-to-end ovphysx workflow.

## Python

```bash
pip install ovphysx
```

```python
from ovphysx import PhysX

physx = PhysX()
physx.add_usd("scene.usda")
physx.step(1.0 / 60.0, 0.0)
physx.release()
```

Full sample:
- `samples/python_samples/hello_world.py` (wheel)

## C

```c
#include "ovphysx/ovphysx.h"
#include <stdio.h>

ovphysx_create_args create_args = OVPHYSX_CREATE_ARGS_DEFAULT;
ovphysx_handle_t handle = 0;
ovphysx_result_t result = ovphysx_create_instance(&create_args, &handle);
if (result.status != OVPHYSX_API_SUCCESS) {
    fprintf(stderr, "Failed to create instance\n");
    if (result.error.ptr) ovphysx_destroy_error(result.error);
    return 1;
}

// Error handling omitted for brevity -- see full sample for production code.
ovphysx_string_t prefix = {NULL, 0};
ovphysx_usd_handle_t usd_handle = 0;
ovphysx_add_usd(handle, ovphysx_cstr("scene.usda"), prefix, &usd_handle);
ovphysx_step(handle, 1.0f / 60.0f, 0.0f);

ovphysx_destroy_instance(handle);
```

Full sample:
- `samples/c_samples/hello_world_c/main.c` (SDK)

Build the C sample with CMake:

```cmake
find_package(ovphysx REQUIRED)
add_executable(my_app main.c)
target_link_libraries(my_app PRIVATE ovphysx::ovphysx)
if(WIN32) # optionally copy ovphysx dlls into bin folder
    ovphysx_copy_runtime_dlls(my_app)
endif()
```

Configure and build:

```bash
cmake -B build -DCMAKE_PREFIX_PATH=/path/to/ovphysx
cmake --build build
```

## Key APIs

| Python | C |
|--------|---|
| `PhysX()` | `ovphysx_create_instance()` |
| `physx.add_usd(path)` | `ovphysx_add_usd()` |
| `physx.step(dt, time)` | `ovphysx_step()` |
| `physx.release()` | `ovphysx_destroy_instance()` |

## References

- Docs: `docs/markdown/tutorials/hello_world.md`
- Python sample: `samples/python_samples/hello_world.py` (wheel)
- C sample: `samples/c_samples/hello_world_c/main.c` (SDK)
- C header: `include/ovphysx/ovphysx.h`

