Skip to content

Commit

Permalink
Apply mesh scale from dae file
Browse files Browse the repository at this point in the history
  • Loading branch information
hwiedPro committed Sep 18, 2023
1 parent e7f3a37 commit bac32f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions phobos/io/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,10 @@ def load_mesh(self, reload=False):
bpy.context.view_layer.objects.active = mesh_objects[0]
if len(mesh_objects) > 1:
bpy.ops.object.join()
# DAE meshes can contain scales. These scales are not that that may be defined by URDF.
# Therefore we do apply this scale here, as other software would handle it this way as well.
# During export the mesh will problably be overwritten with a mesh containing the true scale.
bpy.ops.object.transform_apply(scale=True)
self._mesh_object = bpy.data.meshes.new_from_object(bpy.context.object)
self._mesh_object.name = self.unique_name
bpy.ops.object.select_all(action='DESELECT')
Expand Down

0 comments on commit bac32f3

Please sign in to comment.