Skip to content
Snippets Groups Projects
Commit 4a1328af authored by Campbell Barton's avatar Campbell Barton
Browse files

Update make_shape_2d_from_blend: for 2.8x

parent 030bd4be
No related branches found
No related tags found
No related merge requests found
...@@ -34,14 +34,11 @@ def curve_to_loops(ob): ...@@ -34,14 +34,11 @@ def curve_to_loops(ob):
import bmesh import bmesh
cu = ob.data cu = ob.data
# Support 2.7x & 2.8x me = ob.to_mesh()
if bpy.app.version >= (2, 8):
me = ob.to_mesh(bpy.context.scene, bpy.context.view_layer, True, 'PREVIEW')
else:
me = ob.to_mesh(bpy.context.scene, True, 'PREVIEW', calc_tessface=False)
bm = bmesh.new() bm = bmesh.new()
bm.from_mesh(me) bm.from_mesh(me)
me = ob.to_mesh_clear()
bmesh.ops.beautify_fill(bm, faces=bm.faces, edges=bm.edges) bmesh.ops.beautify_fill(bm, faces=bm.faces, edges=bm.edges)
edges = bm.edges[:] edges = bm.edges[:]
...@@ -75,7 +72,6 @@ def curve_to_loops(ob): ...@@ -75,7 +72,6 @@ def curve_to_loops(ob):
) )
data_all.append((points, f.material_index)) data_all.append((points, f.material_index))
bm.free() bm.free()
bpy.data.meshes.remove(me)
return data_all return data_all
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment