21 sr_description_path =
'/home/user/projects/shadow_robot/base_deps/src/sr_common/sr_description' 23 file_names = [
'forearm',
'forearm_muscle',
'forearm_muscle_disk',
'forearm_lite',
'wrist',
'palm',
'knuckle',
24 'lfmetacarpal',
'F1',
'F2',
'F3',
'TH1_z',
'TH2_z',
'TH3_z']
26 for file_name
in file_names:
27 source_file_name =
'{0}/hand/model/{1}.dae'.format(sr_description_path, file_name)
28 dest_file_name =
'{0}/mujoco_models/meshes/arm_and_hand_meshes/{1}.stl'.format(sr_description_path, file_name)
29 print(
'Converting {0} to {1}...'.format(source_file_name, dest_file_name))
31 bpy.ops.object.select_all(action=
'SELECT')
32 bpy.ops.object.delete()
34 bpy.ops.wm.collada_import(filepath=source_file_name)
36 bpy.ops.object.select_all(action=
'SELECT')
38 bpy.ops.transform.rotate(value=4.71238898038, axis=(1.0, 0, 0))
40 bpy.ops.export_mesh.stl(filepath=dest_file_name)