Skip to content

Instantly share code, notes, and snippets.

@erwincoumans
Created October 11, 2022 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erwincoumans/bc89e92188d7d96242d847c667b5b3e0 to your computer and use it in GitHub Desktop.
Save erwincoumans/bc89e92188d7d96242d847c667b5b3e0 to your computer and use it in GitHub Desktop.
Create 120k cubes in Blender 3.4 alpha: selection is broken (b key and select some region of cubes) and deletion (select all 'a', delete 'x') takes very long.
#See Aras' post, https://twitter.com/aras_p/status/1579383862165405696
import time
import bpy
print("hello world")
mesh = bpy.data.meshes['Cube']
start = time.time()
for z in range (0,7,3):
for x in range(-9,10):
for y in range(-9,10):
ob = bpy.data.objects.new("Gen", object_data=mesh)
ob.location.x = x*2.1
ob.location.y = y*2.1
ob.location.z = z
bpy.context.collection.objects.link(ob)
end = time.time()
print("Generated in ", end-start," sec")
start = end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment