Added numOfCubes variables for each axis.
This commit is contained in:
21
Trial.py
21
Trial.py
@@ -2,23 +2,28 @@
|
||||
import bpy;
|
||||
|
||||
size = 1;
|
||||
numOfCubes = 15;
|
||||
xNumOfCubes = 3;
|
||||
yNumOfCubes = 2;
|
||||
zNumOfCubes = 0;
|
||||
|
||||
x = y = z = size / 2;
|
||||
|
||||
#Add starting cube.
|
||||
#Creating the inital cube.
|
||||
bpy.ops.mesh.primitive_cube_add(size = size, location = (x, y, z));
|
||||
|
||||
#Creating cubes in the X-Position.
|
||||
for i in range(numOfCubes):
|
||||
#I need to create an algorithm that will create the cubes in the shape of a block.
|
||||
|
||||
#Creating cubes in the X-Position.
|
||||
for i in range(xNumOfCubes):
|
||||
x += size;
|
||||
bpy.ops.mesh.primitive_cube_add(size = size, location = (x, y, z));
|
||||
|
||||
#Creating cubes in the Y-Position.
|
||||
for i in range(numOfCubes):
|
||||
#Creating cubes in the Y-Position.
|
||||
for i in range(yNumOfCubes):
|
||||
y += size;
|
||||
bpy.ops.mesh.primitive_cube_add(size = size, location = (x, y, z));
|
||||
|
||||
#Creating cubes in the Z-Position.
|
||||
for i in range(numOfCubes):
|
||||
for i in range(zNumOfCubes):
|
||||
z += size;
|
||||
bpy.ops.mesh.primitive_cube_add(size = size, location = (x, y, z));
|
||||
bpy.ops.mesh.primitive_cube_add(size = size, location = (x, y, z));
|
Reference in New Issue
Block a user