Skip to content

Instantly share code, notes, and snippets.

@Dylancyclone
Last active March 12, 2023 21:46
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dylancyclone/d9bd1b53dbdd02702814661d8d82be5d to your computer and use it in GitHub Desktop.
Save Dylancyclone/d9bd1b53dbdd02702814661d8d82be5d to your computer and use it in GitHub Desktop.
Blender script to clear all Custom Split Normal Data from selected objects. Simply select all the objects and run the script. This is useful when importing a bunch of objects used in game development, such as the output generated from https://github.com/Dylancyclone/VMF2OBJ/
import bpy
selection = bpy.context.selected_objects
for o in selection:
try:
bpy.context.view_layer.objects.active = o
bpy.ops.mesh.customdata_custom_splitnormals_clear()
except:
print("Object has no custom split normals: " + o.name + ", skipping")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment