Skip to content

Commit

Permalink
#71 Fix offset for Mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
Weisl committed Jun 29, 2023
1 parent 1cb0479 commit c8b6faf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion collider_shapes/add_collision_mesh.py
Expand Up @@ -88,6 +88,7 @@ def execute(self, context):

scene = context.scene
mesh_collider_data['parent'] = base_ob
mesh_collider_data['mtx_world'] = base_ob.matrix_world.copy()
mesh_collider_data['new_collider'] = new_collider
collider_data.append(mesh_collider_data)

Expand All @@ -97,16 +98,18 @@ def execute(self, context):
for mesh_collider_data in collider_data:
parent = mesh_collider_data['parent']
new_collider = mesh_collider_data['new_collider']
mtx_world = mesh_collider_data['mtx_world']

context.scene.collection.objects.link(new_collider)
self.shape_suffix = self.prefs.mesh_shape

# create collision meshes
new_collider.matrix_world = mtx_world
self.custom_set_parent(context, parent, new_collider)
self.remove_all_modifiers(context, new_collider)

# align objects
new_collider.matrix_world = parent.matrix_world
#new_collider.matrix_world = parent.matrix_world

super().set_collider_name(new_collider, parent.name)

Expand Down

0 comments on commit c8b6faf

Please sign in to comment.