Skip to content

Instantly share code, notes, and snippets.

@p2or
Last active May 21, 2023 18:22
Show Gist options
  • Save p2or/177c908cbf5bcf4eee9c to your computer and use it in GitHub Desktop.
Save p2or/177c908cbf5bcf4eee9c to your computer and use it in GitHub Desktop.
Add and apply subsurf #Blender #BSE
import bpy
obj = bpy.context.object
bpy.ops.object.modifier_add(type='SUBSURF')
for mod in obj.modifiers:
if mod.type == "SUBSURF":
obj.modifiers[mod.name].levels = 1
bpy.ops.object.modifier_apply(apply_as='DATA', modifier=mod.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment