Skip to main content
single backtick code formatting for line wrapping (easier reading and copying), plus an image
Source Link
Markus von Broady
  • 38.2k
  • 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(1);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=a[i+5];b.scale=[.1]*3;b.location=Vector((2,sin(i/2),-cos(i/2))).normalized()*.8')for i in range(5)]

C.area.type='VIEW_3D';o=bpy.ops.object;a=D.objects;c=a[1];c.select_set(1);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=a[i+5];b.scale=[.1]*3;b.location=Vector((2,sin(i/2),-cos(i/2))).normalized()*.8')for i in range(5)]

Ctrl + C Copy it, in Blender in a new project (with default cube) press Shift + F4, then Ctrl + V to paste, Enter, done.

As requested by Jachym Michal on behalf of phone users and exceptionally lazy people, an image (click to reveal; please, instead just copy-paste the code once at home):

it's also a more readable and interactive version:

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(1);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=a[i+5];b.scale=[.1]*3;b.location=Vector((2,sin(i/2),-cos(i/2))).normalized()*.8')for i in range(5)]

Ctrl + C Copy it, in Blender in a new project (with default cube) press Shift + F4, then Ctrl + V to paste, Enter, done.

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(1);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=a[i+5];b.scale=[.1]*3;b.location=Vector((2,sin(i/2),-cos(i/2))).normalized()*.8')for i in range(5)]

Ctrl + C Copy it, in Blender in a new project (with default cube) press Shift + F4, then Ctrl + V to paste, Enter, done.

As requested by Jachym Michal on behalf of phone users and exceptionally lazy people, an image (click to reveal; please, instead just copy-paste the code once at home):

it's also a more readable and interactive version:

Properly format code block, clean up keyboard formatting
Source Link

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(1);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=a[i+5];b.scale=[.1]*3;b.location=Vector((2,sin(i/2),-cos(i/2))).normalized()*.8')for i in range(5)]

C.area.type='VIEW_3D';o=bpy.ops.object;a=D.objects;c=a[1];c.select_set(1);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=a[i+5];b.scale=[.1]*3;b.location=Vector((2,sin(i/2),-cos(i/2))).normalized()*.8')for i in range(5)]

Ctrl + C Copy it, in Blender in a new project (with default cube) press Shift + F4, then Ctrl + V to paste, Enter, done.

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(1);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=a[i+5];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.

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(1);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=a[i+5];b.scale=[.1]*3;b.location=Vector((2,sin(i/2),-cos(i/2))).normalized()*.8')for i in range(5)]

Ctrl + C Copy it, in Blender in a new project (with default cube) press Shift + F4, then Ctrl + V to paste, Enter, done.

deleted 13 characters in body
Source Link
Markus von Broady
  • 38.2k
  • 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(True1);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;b=a[i+5];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.

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.

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(1);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=a[i+5];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.

Source Link
Markus von Broady
  • 38.2k
  • 3
  • 34
  • 105
Loading