chencws/Stable-text-to-motion
0
1# Pyrender2 3[](https://travis-ci.org/mmatl/pyrender)4[](https://pyrender.readthedocs.io/en/latest/?badge=latest)5[](https://coveralls.io/github/mmatl/pyrender?branch=master)6[](https://badge.fury.io/py/pyrender)7[](https://pepy.tech/project/pyrender)8 9Pyrender is a pure Python (2.7, 3.4, 3.5, 3.6) library for physically-based10rendering and visualization.11It is designed to meet the [glTF 2.0 specification from Khronos](https://www.khronos.org/gltf/).12 13Pyrender is lightweight, easy to install, and simple to use.14It comes packaged with both an intuitive scene viewer and a headache-free15offscreen renderer with support for GPU-accelerated rendering on headless16servers, which makes it perfect for machine learning applications.17 18Extensive documentation, including a quickstart guide, is provided [here](https://pyrender.readthedocs.io/en/latest/).19 20For a minimal working example of GPU-accelerated offscreen rendering using EGL,21check out the [EGL Google CoLab Notebook](https://colab.research.google.com/drive/1pcndwqeY8vker3bLKQNJKr3B-7-SYenE?usp=sharing).22 23 24<p align="center">25 <img width="48%" src="https://github.com/mmatl/pyrender/blob/master/docs/source/_static/rotation.gif?raw=true" alt="GIF of Viewer"/>26 <img width="48%" src="https://github.com/mmatl/pyrender/blob/master/docs/source/_static/damaged_helmet.png?raw=true" alt="Damaged Helmet"/>27</p>28 29## Installation30You can install pyrender directly from pip.31 32```bash33pip install pyrender34```35 36## Features37 38Despite being lightweight, pyrender has lots of features, including:39 40* Simple interoperation with the amazing [trimesh](https://github.com/mikedh/trimesh) project,41which enables out-of-the-box support for dozens of mesh types, including OBJ,42STL, DAE, OFF, PLY, and GLB.43* An easy-to-use scene viewer with support for animation, showing face and vertex44normals, toggling lighting conditions, and saving images and GIFs.45* An offscreen rendering module that supports OSMesa and EGL backends.46* Shadow mapping for directional and spot lights.47* Metallic-roughness materials for physically-based rendering, including several48types of texture and normal mapping.49* Transparency.50* Depth and color image generation.51 52## Sample Usage53 54For sample usage, check out the [quickstart55guide](https://pyrender.readthedocs.io/en/latest/examples/index.html) or one of56the Google CoLab Notebooks:57 58* [EGL Google CoLab Notebook](https://colab.research.google.com/drive/1pcndwqeY8vker3bLKQNJKr3B-7-SYenE?usp=sharing)59 60## Viewer Keyboard and Mouse Controls61 62When using the viewer, the basic controls for moving about the scene are as follows:63 64* To rotate the camera about the center of the scene, hold the left mouse button and drag the cursor.65* To rotate the camera about its viewing axis, hold `CTRL` left mouse button and drag the cursor.66* To pan the camera, do one of the following:67 * Hold `SHIFT`, then hold the left mouse button and drag the cursor.68 * Hold the middle mouse button and drag the cursor.69* To zoom the camera in or out, do one of the following:70 * Scroll the mouse wheel.71 * Hold the right mouse button and drag the cursor.72 73The available keyboard commands are as follows:74 75* `a`: Toggles rotational animation mode.76* `c`: Toggles backface culling.77* `f`: Toggles fullscreen mode.78* `h`: Toggles shadow rendering.79* `i`: Toggles axis display mode (no axes, world axis, mesh axes, all axes).80* `l`: Toggles lighting mode (scene lighting, Raymond lighting, or direct lighting).81* `m`: Toggles face normal visualization.82* `n`: Toggles vertex normal visualization.83* `o`: Toggles orthographic camera mode.84* `q`: Quits the viewer.85* `r`: Starts recording a GIF, and pressing again stops recording and opens a file dialog.86* `s`: Opens a file dialog to save the current view as an image.87* `w`: Toggles wireframe mode (scene default, flip wireframes, all wireframe, or all solid).88* `z`: Resets the camera to the default view.89 90As a note, displaying shadows significantly slows down rendering, so if you're91experiencing low framerates, just kill shadows or reduce the number of lights in92your scene.93 