Skip to content

Instantly share code, notes, and snippets.

@EnsekiTT
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save EnsekiTT/280c1a0aa808f8a907e3 to your computer and use it in GitHub Desktop.

Select an option

Save EnsekiTT/280c1a0aa808f8a907e3 to your computer and use it in GitHub Desktop.
Blenderで全てスクリプトから生成するときに毎回オブジェクトが蓄積しないようにする
#!BPY
import bpy
def clear_all():
for item in bpy.context.scene.objects:
bpy.context.scene.objects.unlink(item)
for item in bpy.data.objects:
bpy.data.objects.remove(item)
for item in bpy.data.meshes:
bpy.data.meshes.remove(item)
for item in bpy.data.materials:
bpy.data.materials.remove(item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment