This was one of my most important functions in 2.7 Python, and there seem to be conflicting opinions on how to update it for 2.8. Any suggestions?
def applyModifiers(obj): mesh = obj.to_mesh(scene = bpy.context.scene, apply_modifiers=True, settings = 'PREVIEW') meshObj = bpy.data.objects.new(obj.name + "_mesh", mesh) bpy.context.scene.objects.link(meshObj) bpy.context.scene.objects.active = meshObj meshObj.matrix_world = obj.matrix_world bpy.ops.object.select_all(action='DESELECT') bpy.data.objects[obj.name].hide = False bpy.data.objects[obj.name].select = True bpy.ops.object.delete() return meshObj