Last active
August 29, 2015 14:10
-
-
Save i5ar/b47123ba64ebc43da526 to your computer and use it in GitHub Desktop.
Blender Flip Normals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import bpy | |
| scene = bpy.context.scene | |
| for ob in scene.objects: | |
| if ob.type == 'MESH': | |
| scene.objects.active = ob | |
| bpy.ops.object.mode_set(mode='EDIT', toggle=False) | |
| # Run an edit-mode operator on every object in the scene [1] | |
| # [1]: http://blender.stackexchange.com/a/2639/8112 | |
| bpy.ops.mesh.reveal() | |
| bpy.ops.mesh.select_all(action='SELECT') | |
| # Operation in edit mode | |
| bpy.ops.mesh.flip_normals() | |
| bpy.ops.object.mode_set(mode='OBJECT', toggle=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import bpy | |
| scn = bpy.context.scene | |
| sel = bpy.context.selected_objects | |
| meshes = [o for o in sel if o.type == 'MESH'] | |
| for obj in meshes: | |
| scn.objects.active = obj | |
| bpy.ops.object.editmode_toggle() | |
| bpy.ops.mesh.select_all(action='SELECT') | |
| # Just flip normals | |
| bpy.ops.mesh.flip_normals() | |
| bpy.ops.object.mode_set() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python script fail in gistfile1.py...