1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
| def plane(size: float = 1.0, location: tuple = (0, 0, 0)): bpy.ops.mesh.primitive_plane_add( size=size, enter_editmode=False, align="WORLD", location=location, ) return bpy.context.active_object
def cube(size: float = 1.0, location: tuple = (0, 0, 0)): bpy.ops.mesh.primitive_cube_add( size=size, enter_editmode=False, align="WORLD", location=location, ) return bpy.context.active_object
def circle(radius: float = 1.0, location: tuple = (0, 0, 0)): bpy.ops.mesh.primitive_circle_add( radius=radius, enter_editmode=False, align="WORLD", location=location, ) return bpy.context.active_object
def uv_sphere(radius: float = 1.0, location: tuple = (0, 0, 0)): bpy.ops.mesh.primitive_uv_sphere_add( radius=radius, enter_editmode=False, align="WORLD", location=location, ) return bpy.context.active_object
def ico_sphere(radius: float = 1.0, location: tuple = (0, 0, 0)): bpy.ops.mesh.primitive_ico_sphere_add( radius=radius, enter_editmode=False, align="WORLD", location=location, ) return bpy.context.active_object
def cylinder(radius: float = 1.0, depth: float = 1.0, location: tuple = (0, 0, 0)): bpy.ops.mesh.primitive_cylinder_add( radius=radius, depth=depth, enter_editmode=False, align="WORLD", location=location, ) return bpy.context.active_object
def cone(radius: float = 1.0, depth: float = 1.0, location: tuple = (0, 0, 0)): bpy.ops.mesh.primitive_cone_add( radius1=radius, depth=depth, enter_editmode=False, align="WORLD", location=location, ) return bpy.context.active_object
def torus(radius: float = 1.0, depth: float = 1.0, location: tuple = (0, 0, 0)): bpy.ops.mesh.primitive_torus_add( major_radius=radius, minor_radius=depth, align="WORLD", location=location, ) return bpy.context.active_object
def monkey(radius: float = 1.0, location: tuple = (0, 0, 0)): bpy.ops.mesh.primitive_monkey_add( size=radius, enter_editmode=False, align="WORLD", location=location, ) return bpy.context.active_object
|