BugFix: forgot to clear modifiers after object copy and using to_mesh()

not clearing modifiers after assigning the new higher density mesh will
cause excessive memory usage.
pull/78/head
Jeff Doyle (nfz) 2016-06-05 21:47:58 -03:00
rodzic 4ff1787940
commit 179e16d04d
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -968,6 +968,7 @@ def meshFromCurve(o, use_modifiers = False):
if use_modifiers:
newmesh = co.to_mesh(bpy.context.scene, True, 'RENDER')
oldmesh = co.data
co.modifiers.clear()
co.data = newmesh
bpy.data.meshes.remove(oldmesh)

Wyświetl plik

@ -152,10 +152,12 @@ def prepareBulletCollision(o):
bpy.ops.object.convert(target='MESH', keep_original=False)
if o.use_modifiers:
newmesh = collisionob.to_mesh(bpy.context.scene, True, 'RENDER')
newmesh = collisionob.to_mesh(bpy.context.scene, True, 'RENDER', False)
oldmesh = collisionob.data
collisionob.modifiers.clear()
collisionob.data = newmesh
bpy.data.meshes.remove(oldmesh)
#subdivide long edges here:
if o.exact_subdivide_edges:
subdivideLongEdges(collisionob, o.cutter_diameter*2)
@ -169,7 +171,6 @@ def prepareBulletCollision(o):
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
getCutterBullet(o)
#machine objects scaling up to simulation scale
if bpy.data.groups.find('machine')>-1:
for ob in bpy.data.groups['machine'].objects: