due to a sketchup import half my objects are inside out
how can i make a script (novice) that selects all objects (one by one?), put them in edit mode, recalculate outside (cntl n) and back into object mode.
due to a sketchup import half my objects are inside out
how can i make a script (novice) that selects all objects (one by one?), put them in edit mode, recalculate outside (cntl n) and back into object mode.
The easiest way to approach the building of a script if you are not keen on python coding would be to perform all the tasks you need, then copy the command that shows up in the info editor and paste in a loop that iterate through all the objects.
Here's a possible code:
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.object.editmode_toggle() #exit edit mode
Here's the script in action:
scenewithview_layerin newer versions of Blender ♀️ – Sandra Mar 13 '23 at 12:11