I've been trying this a bunch of ways but no matter what I do I get a blank white plane. What I want is to programmatically create a plane with the ocean modifier applied to it. What am I missing?
bpy.ops.mesh.primitive_plane_add(radius=10, view_align=False, location=(0, 0, 0))
bpy.ops.transform.translate(value=(0,0,-1.0 * model_height / 2.0 + 0.2 * model_height))
for obj in bpy.data.objects:
obj.select = False
plane = bpy.data.objects['Plane']
plane.select = True
bpy.context.scene.objects.active = plane
bpy.ops.object.modifier_apply(modifier='Ocean')