Skip to content

Commit

Permalink
Added support for multiple loops per mesh object
Browse files Browse the repository at this point in the history
  • Loading branch information
bartteunis committed Jul 24, 2019
1 parent d280492 commit c22aa51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions operator_rigidbody_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ def write_scene_physics(context, filepath):
# Get reference to object data
d = o.data

# Select the necessary stuff (single face loop)
# Select the necessary stuff (multiple face loops)
physics_settings['coords'] = []
for poly in d.polygons:
vtx_indices = [d.loops[x].vertex_index for x in poly.loop_indices]
ordered_verts = [d.vertices[x].co.xy[:] for x in vtx_indices]
physics_settings['coords'] = ordered_verts
physics_settings['coords'].append(ordered_verts)

object_list.append({'object': object_settings, 'physics': physics_settings})
object_mapping[o.name] = len(object_list)-1 # Index in list
Expand Down

0 comments on commit c22aa51

Please # to comment.