Actually made the code neater.
This commit is contained in:
23
Trial.py
23
Trial.py
@@ -1,23 +1,24 @@
|
|||||||
|
#Imports.
|
||||||
import bpy;
|
import bpy;
|
||||||
|
|
||||||
size = 1;
|
size = 1;
|
||||||
|
numOfCubes = 15;
|
||||||
x = y = z = size / 2;
|
x = y = z = size / 2;
|
||||||
|
|
||||||
|
#Add starting cube.
|
||||||
bpy.ops.mesh.primitive_cube_add(size = size, location = (x, y, z));
|
bpy.ops.mesh.primitive_cube_add(size = size, location = (x, y, z));
|
||||||
#z = 1.5;
|
|
||||||
#bpy.ops.mesh.primitive_cube_add(size = size, location = (x, y, z));
|
|
||||||
|
|
||||||
#x
|
#Creating cubes in the X-Position.
|
||||||
for i in range(15):
|
for i in range(numOfCubes):
|
||||||
x += size;
|
x += 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));
|
||||||
|
|
||||||
#Z
|
#Creating cubes in the Y-Position.
|
||||||
for i in range(15):
|
for i in range(numOfCubes):
|
||||||
z += size;
|
|
||||||
bpy.ops.mesh.primitive_cube_add(size = size, location = (x, y, z));
|
|
||||||
|
|
||||||
#y
|
|
||||||
for i in range(15):
|
|
||||||
y += size;
|
y += 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));
|
||||||
|
|
||||||
|
#Creating cubes in the Z-Position.
|
||||||
|
for i in range(numOfCubes):
|
||||||
|
z += size;
|
||||||
|
bpy.ops.mesh.primitive_cube_add(size = size, location = (x, y, z));
|
||||||
|
Reference in New Issue
Block a user