> This page is for version Release 2.3.
> For other versions, use one of these documentation indexes:
> - Release 3.0 (default): https://docs.nvidia.com/isaaclab/3.0/llms.txt
> - Release 2.3: https://docs.nvidia.com/isaaclab/2.3/llms.txt
> - Release 2.2: https://docs.nvidia.com/isaaclab/2.2/llms.txt
> - Release 2.1: https://docs.nvidia.com/isaaclab/2.1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/isaaclab/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/isaaclab/_mcp/server.

# Recording Animations of Simulations

Isaac Lab supports two approaches for recording animations of physics simulations: the **Stage Recorder** and the **OVD Recorder**.
Both generate USD outputs that can be played back in Omniverse, but they differ in how they work and when you’d use them.

The [Stage Recorder](https://docs.omniverse.nvidia.com/extensions/latest/ext_animation_stage-recorder.html) extension listens to all motion and USD property changes in the stage during simulation
and records them as **time-sampled data**. The result is a USD file that captures only the animated changes—**not** the
full scene—and matches the hierarchy of the original stage at the time of recording.
This makes it easy to add as a sublayer for playback or rendering.

This method is built into Isaac Lab’s UI through the `~isaaclab.envs.ui.BaseEnvWindow`.
However, to record the animation of a simulation, you need to disable [Fabric](https://docs.omniverse.nvidia.com/kit/docs/usdrt/latest/docs/usd_fabric_usdrt.html) to allow reading and writing
all the changes (such as motion and USD properties) to the USD stage.

The **OVD Recorder** is designed for more scalable or automated workflows. It uses OmniPVD to capture simulated physics from a played stage
and then **bakes** that directly into an animated USD file. It works with Fabric enabled and runs with CLI arguments.
The animated USD can be quickly replayed and reviewed by scrubbing through the timeline window, without simulating expensive physics operations.

> **Note**
>
> Omniverse only supports **either** physics simulation **or** animation playback on a USD prim—never both at once.
> Disable physics on the prims you want to animate.

## Stage Recorder

In Isaac Lab, the Stage Recorder is integrated into the `~isaaclab.envs.ui.BaseEnvWindow` class.
It’s the easiest way to capture physics simulations visually and works directly through the UI.

To record, Fabric must be disabled—this allows the recorder to track changes to USD and write them out.

### Stage Recorder Settings

Isaac Lab sets up the Stage Recorder with sensible defaults in `base_env_window.py`. If needed,
you can override or inspect these by using the Stage Recorder extension directly in Omniverse Create.

```python
def _toggle_recording_animation_fn(self, value: bool):
    """Toggles the animation recording."""
    if value:
        # log directory to save the recording
        if not hasattr(self, "animation_log_dir"):
            # create a new log directory
            log_dir = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
            self.animation_log_dir = os.path.join(os.getcwd(), "recordings", log_dir)
        # start the recording
        _ = omni.kit.commands.execute(
            "StartRecording",
            target_paths=[("/World", True)],
            live_mode=True,
            use_frame_range=False,
            start_frame=0,
            end_frame=0,
            use_preroll=False,
            preroll_frame=0,
            record_to="FILE",
            fps=0,
            apply_root_anim=False,
            increment_name=True,
            record_folder=self.animation_log_dir,
            take_name="TimeSample",
        )
    else:
        # stop the recording
        _ = omni.kit.commands.execute("StopRecording")
        # save the current stage
        source_layer = self.stage.GetRootLayer()
        # output the stage to a file
        stage_usd_path = os.path.join(self.animation_log_dir, "Stage.usd")
        source_prim_path = "/"
        # creates empty anon layer
        temp_layer = Sdf.Find(stage_usd_path)
        if temp_layer is None:
            temp_layer = Sdf.Layer.CreateNew(stage_usd_path)
        temp_stage = Usd.Stage.Open(temp_layer)
        # update stage data
        UsdGeom.SetStageUpAxis(temp_stage, UsdGeom.GetStageUpAxis(self.stage))
        UsdGeom.SetStageMetersPerUnit(temp_stage, UsdGeom.GetStageMetersPerUnit(self.stage))
        # copy the prim
        Sdf.CreatePrimInLayer(temp_layer, source_prim_path)
        Sdf.CopySpec(source_layer, source_prim_path, temp_layer, source_prim_path)
        # set the default prim
        temp_layer.defaultPrim = Sdf.Path(source_prim_path).name
        # remove all physics from the stage
        for prim in temp_stage.TraverseAll():
            # skip if the prim is an instance
            if prim.IsInstanceable():
                continue
            # if prim has articulation then disable it
            if prim.HasAPI(UsdPhysics.ArticulationRootAPI):
                prim.RemoveAPI(UsdPhysics.ArticulationRootAPI)
                prim.RemoveAPI(PhysxSchema.PhysxArticulationAPI)
            # if prim has rigid body then disable it
            if prim.HasAPI(UsdPhysics.RigidBodyAPI):
                prim.RemoveAPI(UsdPhysics.RigidBodyAPI)
                prim.RemoveAPI(PhysxSchema.PhysxRigidBodyAPI)
            # if prim is a joint type then disable it
            if prim.IsA(UsdPhysics.Joint):
                prim.GetAttribute("physics:jointEnabled").Set(False)
        # resolve all paths relative to layer path
        omni.usd.resolve_paths(source_layer.identifier, temp_layer.identifier)
        # save the stage
        temp_layer.Save()
        # print the path to the saved stage
        print("Recording completed.")
        print(f"\tSaved recorded stage to    : {stage_usd_path}")
        print(f"\tSaved recorded animation to: {os.path.join(self.animation_log_dir, 'TimeSample_tk001.usd')}")
        print("\nTo play the animation, check the instructions in the following link:")
        print(
            "\thttps://docs.omniverse.nvidia.com/extensions/latest/ext_animation_stage-recorder.html#using-the-captured-timesamples"
        )
        print("\n")
        # reset the log directory
        self.animation_log_dir = None
```

### Example Usage

In standalone Isaac Lab environments, pass the `--disable_fabric` flag:

```bash
./isaaclab.sh -p scripts/environments/state_machine/lift_cube_sm.py --num_envs 8 --device cpu --disable_fabric
```

After launching, the Isaac Lab UI window will display a "Record Animation" button.
Click to begin recording. Click again to stop.

The following files are saved to the `recordings/` folder:

* `Stage.usd` — the original stage with physics disabled
* `TimeSample_tk001.usd` — the animation (time-sampled) layer

To play back:

```bash
./isaaclab.sh -s  # Opens Isaac Sim
```

Inside the Layers panel, insert both `Stage.usd` and `TimeSample_tk001.usd` as sublayers.
The animation will now play back when you hit the play button.

See the [tutorial on layering in Omniverse](https://www.youtube.com/watch?v=LTwmNkSDh-c\&ab_channel=NVIDIAOmniverse) for more on working with layers.

## OVD Recorder

The OVD Recorder uses OmniPVD to record simulation data and bake it directly into a new USD stage.
This method is more scalable and better suited for large-scale training scenarios (e.g. multi-env RL).

It’s not UI-controlled—the whole process is enabled through CLI flags and runs automatically.

### Workflow Summary

1. User runs Isaac Lab with animation recording enabled via CLI
2. Isaac Lab starts simulation
3. OVD data is recorded as the simulation runs
4. At the specified stop time, the simulation is baked into an outputted USD file, and IsaacLab is closed
5. The final result is a fully baked, self-contained USD animation

### Example Usage

To record an animation:

```bash
./isaaclab.sh -p scripts/tutorials/03_envs/run_cartpole_rl_env.py \
  --anim_recording_enabled \
  --anim_recording_start_time 1 \
  --anim_recording_stop_time 3
```

> **Note**
>
> The provided `--anim_recording_stop_time` should be greater than the simulation time.

> **Warning**
>
> Currently, the final recording step can output many warning logs from \[omni.usd]. This is a known issue, and these warning messages can be ignored.

After the stop time is reached, a file will be saved to:

```none
anim_recordings/<timestamp>/baked_animation_recording.usda
```