From 1c17b1722d801d4e8ba72c1ca0ebd3a17a6634e3 Mon Sep 17 00:00:00 2001 From: CJ Satnarine <117758228+CJSatnarine@users.noreply.github.com> Date: Wed, 22 Feb 2023 13:02:46 -0500 Subject: [PATCH] Added numOfCubes variables for each axis. --- Trial.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Trial.py b/Trial.py index 2be1628..6c68d1b 100644 --- a/Trial.py +++ b/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)); \ No newline at end of file