Skip to main content
1 of 4
Markus von Broady
  • 38.7k
  • 3
  • 34
  • 105

Lately I find myself tired with all those mouse clicks to add a sphere, and duplicate it 2 times, it's just so much work... So I just type some code, like this instead:

C.area.type='VIEW_3D';o=bpy.ops.object;a=D.objects;c=a[1];c.select_set(True);o.shade_smooth();d=o.duplicate;m=c.modifiers.new('','SUBSURF');m.levels=3;d();b=a[2];b.location.z=-1.6;b.scale*=1.5;d();b=a[3];b.location.z-=2;b.scale*=1.5;d();b=a[4];m=b.modifiers.new('','MIRROR');m.mirror_object=c;m.use_axis=0>1,1>0,1<0;m=D.materials[1];m.diffuse_color=[2]*4;m=m.copy();b.active_material=m;b.location=[.5]*3;m.diffuse_color=0,0,0,1;b.scale/=10;[exec('d();b=C.active_object;b.scale=[.1]*3;b.location=Vector((2,sin(i/2),-cos(i/2))).normalized()*.8') for i in range(5)]

CtrlC Copy it, in Blender in a new project (with default cube) press ShiftF4, then CtrlV to paste, Enter, done.

Markus von Broady
  • 38.7k
  • 3
  • 34
  • 105