Skip to main content

No project description provided

Project description

simrender 🎬

A Python package for easily rendering robotic simulation environments to a web-ready (GLTF) format, including animated episodes for visualization and analysis. It also supports easy rendering to notebook cells in Jupyter and Marimo.

Features

  • 🎯 GLB Export: Export static scenes and animated sequences to industry-standard GLB format
  • 🎮 Gymnasium Integration: Automatic support for Gymnasium environments with InteractiveRenderWrapper
  • 📊 Animation Recording: Capture animated episodes with configurable capture frame rates
  • 📕 Notebook Support: Rendering wrapper classes can be displayed in Jupyter/Marimo notebooks out of the box

Simulator Support

  • MuJoCo
  • MJX/MuJoCo Warp
  • Newton
  • Isaac Sim
  • Isaac Gym (legacy)

Installation

pip install simrender

Usage

Gymnasium Environments

Wrap any Gymnasium environment to enable GLB export:

import gymnasium as gym
from simrender.gym import InteractiveRenderWrapper

# Create and wrap environment
env = gym.make("Ant-v5")
env = InteractiveRenderWrapper(env)

# Record an animated episode
with env.animation(fps=30):
    obs, _ = env.reset(seed=42)
    for _ in range(1000):
        action = env.action_space.sample()
        obs, reward, terminated, truncated, info = env.step(action)
        env.render()
        if terminated or truncated:
            break

# Save to GLB file
env.save("episode.glb")

# or, display it if running in a notebook cell
env

MuJoCo Models

For direct MuJoCo model rendering:

import mujoco
from simrender.mujoco import MujocoRender

# Load MuJoCo model
model = mujoco.MjModel.from_xml_file("scene.xml")
data = mujoco.MjData(model)

# Create renderer
render = MujocoRender(model)

# Single frame render
mujoco.mj_step(model, data)
render.render(data)
render.save("single_frame.glb")

# Animated sequence
with render.animation(fps=10):
    for i in range(3000):
        mujoco.mj_step(model, data)
        render.render(data)

render.save("animated_sequence.glb")

# or, display it if running in a notebook cell
render

File Format

The exported GLB files are compatible with:

  • 🌐 Web browsers (Three.js, Babylon.js)
  • 🎨 3D modeling software (Blender, Maya, 3ds Max)
  • 🎮 Game engines (Unity, Unreal Engine)
  • 📱 AR/VR applications
  • Anything that supports GLTF/GLB

License

This project is dual-licensed under MIT and Apache 2.0 licenses. You may choose either license for your use.

Contributing

Contributions are welcome! Please feel free to submit pull requests, report bugs, or suggest features.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simrender-0.1.0.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simrender-0.1.0-py3-none-any.whl (37.4 kB view details)

Uploaded Python 3

File details

Details for the file simrender-0.1.0.tar.gz.

File metadata

  • Download URL: simrender-0.1.0.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.5

File hashes

Hashes for simrender-0.1.0.tar.gz
Algorithm Hash digest
SHA256 abfdcaf810e403c61c40b6df402c337437827a608ce011f8654abb37de8dbb87
MD5 6122da81a964509ffbd01740b727aeb4
BLAKE2b-256 0d0315bddc371fde354493e0ef851d6f402f3c9cf257eea4b4948c0e6e89d537

See more details on using hashes here.

File details

Details for the file simrender-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: simrender-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.5

File hashes

Hashes for simrender-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14dd04142583e63a9db37fdbfa445fac1b0ade508c0140ae5a1769e9bad7cfd0
MD5 3fcba77ee6e6315dd81936f4b7b79058
BLAKE2b-256 94ff81bbdfc843f55cc4686ea744b03edbbc33b6d496b54efa4fdf92963a5eb3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page