Skip to content

Instantly share code, notes, and snippets.

@openroomxyz
Created April 16, 2020 11:07
Show Gist options
  • Select an option

  • Save openroomxyz/4336ab87697fc1cbf0304a5b80d37b3b to your computer and use it in GitHub Desktop.

Select an option

Save openroomxyz/4336ab87697fc1cbf0304a5b80d37b3b to your computer and use it in GitHub Desktop.
Blender Python : How to create a cube at position rotation scale?
import bpy
def create_a_cube(name, position, set_rotation, scale):
# Create a simple cube.
bpy.ops.mesh.primitive_cube_add()
# Get the cube object and rename it.
cube = bpy.context.object
cube.name = name
cube.rotation_euler = set_rotation
cube.scale = scale
cube.location = position
return cube
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment