Created
November 13, 2023 13:44
-
-
Save demohero101/7c513c22fe2fb7653600f53e5d1361ef to your computer and use it in GitHub Desktop.
ChatGPT Code 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
# Clear existing mesh objects in the scene | |
bpy.ops.object.select_all(action='DESELECT') | |
bpy.ops.object.select_by_type(type='MESH') | |
bpy.ops.object.delete() | |
# Add a cube | |
bpy.ops.mesh.primitive_cube_add(size=2, location=(0, 0, 0)) | |
# Add a sphere | |
bpy.ops.mesh.primitive_uv_sphere_add(radius=1, location=(3, 0, 0)) | |
# Add a torus | |
bpy.ops.mesh.primitive_torus_add(location=(6, 0, 0), align='WORLD', major_radius=1, minor_radius=0.3) | |
# Update the scene | |
bpy.context.view_layer.update() | |
# Print a message | |
print("Cube, sphere, and torus added to the scene.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment