Created
April 16, 2020 11:07
-
-
Save openroomxyz/4336ab87697fc1cbf0304a5b80d37b3b to your computer and use it in GitHub Desktop.
Blender Python : How to create a cube at position rotation scale?
This file contains hidden or 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 | |
| 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