Skip to content

Instantly share code, notes, and snippets.

@SuddenDevelopment
Created January 23, 2023 15:45
Show Gist options
  • Select an option

  • Save SuddenDevelopment/23213e9ba094578c3e03a187dcda0e37 to your computer and use it in GitHub Desktop.

Select an option

Save SuddenDevelopment/23213e9ba094578c3e03a187dcda0e37 to your computer and use it in GitHub Desktop.
Blender bulk apply scale, location and separate by loose parts
import bpy
for obj in bpy.context.scene.objects:
if obj.type == 'MESH':
obj.select_set(True)
try:
bpy.context.view_layer.objects.active = obj
bpy.ops.mesh.separate(type='LOOSE')
bpy.ops.object.transform_apply(location=False, rotation=True, scale=True)
except:
pass
obj.select_set(False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment