Skip to content

Instantly share code, notes, and snippets.

@hgouveia
Created May 26, 2017 17:52
Show Gist options
  • Save hgouveia/c29ce42438661147aa733ed1b9a41165 to your computer and use it in GitHub Desktop.
Save hgouveia/c29ce42438661147aa733ed1b9a41165 to your computer and use it in GitHub Desktop.
Blender script for fix normals on selected objects
# Usage:
# 1. Select the objects in blender
# 2. Open a Text Editor view in Blender.
# 3. Press Alt + O, or go to Text>Open Text Block and open the .py file
# 4. Then simply press Run script
import bpy
if bpy.context.selected_objects != []:
for obj in bpy.context.selected_objects:
if obj.type == 'MESH':
print(obj.name)
bpy.context.scene.objects.active = obj
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.normals_make_consistent(inside=False)
bpy.ops.object.editmode_toggle()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment