forked from hsu/val_description
-
Notifications
You must be signed in to change notification settings - Fork 4
Steps to create and export low poly meshes with Blender
MarcoCar edited this page Nov 14, 2015
·
15 revisions
These are the steps to generate meshes to be used with the drake-designer, gazebo and SCS. It assumes that meshes have been already modelled, mapped and texturized in Blender, but any other 3D package capable of exporting in obj and dae should do the job.
- Don't change model position, orientation and scale if using provided CAD model
- In order for the mesh to be oriented and displayed correctly in SCS, reset scale and rotation value (Ctrl+A) and make normals consistent (Ctrl+N in edit mode) in Blender before exporting dae.
- Textures in Drake-designer support alpha channel, it's useful to create complex holes in the mesh without modelling them.
- Normals can be used to control surface smoothness. In Blender this can be controlled by setting an autosmooth of 180 degrees to the whole mesh and make the desired edges sharp in edit mode.
- Alpha channel doesn't seem to be supported in SCS and transparent pixels get the colour of the background stored in the png file. A suitable colour would be a ligh gray (e.g. RGB: 160,160,160). To store the background colour using gimp:
- pick the desired colour for the background
- in the png export options select save background colour and deselect save colour values from transparent pixels.
- Ambient colour affect SCS rendering. The best result I've found is to apply the texture to both the colour and the ambient channels before exporting the dae.
-
blender_meshes/<body_part_subfolder>
for blend mesh files -
meshes/<body_part_subfolder>
for obj, dae and vtp mesh files and png texture files
-
Export the mesh in obj format from Blender into
meshes/<body_part_subfolder>
with the following options:- Y forward
- Z up
- Selection only
- Apply modifiers
- Write normals
- Include UVs
- Triangulate Faces
- Deselect all other options
-
Copy the texture in the same folder
-
Copy the convertOBJ.py script into
meshes/<body_part_subfolder>
and run it from therepython convertOBJ.py <mesh.obj> <texture.png>
It will create a mesh.vtp file in the meshes folder
-
Copy obj ,vtp and png files into
<model_folder (e.g. val_description)>/model/meshes/<body_part_subfolder>
- Export the mesh in dae format from Blender into
meshes/<body_part_subfolder>
with the following options:- Selection only
- Only selected UV map
- Include UV textures
- Include material textures
- Copy (this copies the texture in the mesh folder and it is necessary to store relative paths to texture files in the dae)
- Triangulate
- Copy both the dae and the png file in the SCS mesh folder (for Valkyrie
<workspace folder>/ValkyrieHardwareDrivers/bin/models/val_description/model/meshes/legs
)