Blender Script to Recalculate then set from face per object Hi I'm trying to find a script to use in Blender that would select each mesh one by one (I have 350 to do), go into edit mode, select all the faces, recalculate the normal's and then set from faces all the normal's.

I'm new to Blender scripts so any help would be greatly helpful!
I figured out how to do this using the following script.

import bpy

if bpy.context.selected_objects != []:
for obj in bpy.context.selected_objects: #loop through all the selected objects
    if obj.type == 'MESH':
        bpy.context.scene.objects.active = obj
        bpy.ops.object.editmode_toggle() #enter edit mode
        bpy.ops.mesh.select_all(action='SELECT') #select all objects elements
        bpy.ops.mesh.normals_make_consistent(inside=False) #recalc normals
        bpy.ops.mesh.set_normals_from_faces() #set from faces
        bpy.ops.object.editmode_toggle() #exit edit mode