Skip to content
Snippets Groups Projects
Commit c78bbb0f authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Update blender/README.md

parent 288697e7
No related branches found
No related tags found
No related merge requests found
......@@ -8,28 +8,9 @@ Script for importing in blender a motion viewed with gepetto viewer
## Exporting the scene
### Export Blender script - suggested approach
In python, run `gui.writeBlenderScript("blenderscript.py", ["node1", "node2"])`.
### URDF to blender conversion
Exporting from OpenSceneGraph does not always work. One can also convert URDF files to a script loadable by blender:
`blender/urdf_to_blender.py -p prefix/ -i robot.urdf -o robot_blend.py`
where `prefix` is the prefix you gave to Gepetto Viewer. _A trailing slash must be added_.
### Robot - moving objects
Robots have to be exported **before** applying any configuration. Right after having loaded all your models, do `gui.writeNodeFile (nodeName, filename)`
### Environment - static objects
Environment has to be exported **after** in place (having been placed correctly). Once they are at their good location, do
`gui.writeNodeFile (nodeName, filename)`
If you export them before placing them, you can capture them in a frame using the next method, in which case you will have
1 differents `path.yaml` files (one with N frames for the robot and one with 1 frame for the environment).
### OSG export results by file format
- Collada: seems OK, but quality seems poor.
- OBJ: not tested
- Box, Cylinders and other primitives: not supported by dae and obj file format
**Notice**: datas will be appended to `blenderscript.py` so it must be empty at the beginning. Otherwise, you will get an error when loading the file into blender.
## Recording frames
......@@ -42,6 +23,8 @@ use `gui.captureTransformOnRefresh(True)` to start capturing and `gui.captureTra
**Notice**: datas will be appended to `filename` so it must be empty at the beginning. Otherwise, you will get an error when loading the file into blender.
**Notice**: The size of this file quickly increases. Have in mind that your movie will most likely be at 25 frames per second.
```python
gui.setCaptureTransform ("path.yaml", "hrp2")
......@@ -87,11 +70,13 @@ blender-2.75a-linux-glibc211-i686/blender $@ --python "/local/jmirabel/devel/hpp
### Load the motion
- Load your object definition files of the robot and the environment.
* import collada or obj files from `File` menu
* import the script generated by `urdf_to_blender.py` by pressing `Space Bar` and searching for "Import a script generated with urdf_to_blend.py"
- Press `Space bar` and search for "Import a YAML Gepetto Viewer path file"
- Select the file containing the configurations and wait...
- Import the model file (generated at step 1):
* Press `Space Bar` and search for "Import a URDF blender script".
* You can do this as many times as you want.
- Import the motion file (generated at step 2):
* Press `Space bar` and search for "Import a YAML Gepetto Viewer path file"
* You can do this as many times as you want.
* This can take a while.
Voilà! A set of frames should automatically be generated, resulting in an animation.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment