3
$\begingroup$

I am cleaning up a large file imported from another program with 500+ objects. All of these objects have Custom split normals that need to be cleared, and then Auto Smooth turned on. I know I can make changes to all selected objects at once by holding down Alt while changing a value or checking a box. However, this does not seem to work for pushing buttons, which is what you need to do to Clear Custom Split Normals Data.

Any ideas on how to do it to all my objects at once?

$\endgroup$
  • $\begingroup$ Does selecting them all and then going to <Space> > Clear Custom Split Normals Data work, or does that only work for the active object? $\endgroup$ – SilverWolf - Reinstate Monica Sep 6 '17 at 15:17
8
$\begingroup$
import bpy

selection = bpy.context.selected_objects

for o in selection:
    bpy.context.view_layer.objects.active = o
    bpy.ops.mesh.customdata_custom_splitnormals_clear()

This is the new code as the coding has changed a bit in 2.8

$\endgroup$
4
$\begingroup$

Just stumbled upon the same problem. Here's the code. Select the mesh objects you want and run it. It'll think a bit if you have a ton of objects, because of make each of the objects active. May be someone knows the way to avoid that, but this one works.

import bpy

selection = bpy.context.selected_objects

for o in selection:
    bpy.context.scene.objects.active = o
    bpy.ops.mesh.customdata_custom_splitnormals_clear()
$\endgroup$
0
$\begingroup$

There. I have a workaround for that: Select all objects. Ctrl + J to join. then hit " Clear custom split Normals data ", then go Edit mode, Mesh - Separate - By loose parts. That's all.

$\endgroup$
  • $\begingroup$ Your solution would work, but is a bad workaround. You'll loose all your individual object names when joining meshes. $\endgroup$ – Christoph Werner Sep 11 '19 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.