Change the maximum height of tree trunk

This commit is contained in:
CJSatnarine
2023-12-31 13:45:21 -05:00
parent 2d145b6491
commit 62bdd2b431

View File

@@ -52,12 +52,12 @@ def buildTree():
treeXPos = random.randint(0, xNum - 1) treeXPos = random.randint(0, xNum - 1)
treeYPos = random.randint(0, yNum - 1) treeYPos = random.randint(0, yNum - 1)
treeZPos = z treeZPos = z
treeHeight = random.randint(3, 7) treeTrunkHeight = random.randint(3, 5)
# Add a single block as the location of the tree stump. # Add a single block as the location of the tree stump.
# Loop through the treeheight to add a new cube as a chunk of the trunk. Add colour to the trunk. # Loop through the treeheight to add a new cube as a chunk of the trunk. Add colour to the trunk.
counter = 1 counter = 1
while counter <= treeHeight: while counter <= treeTrunkHeight:
# Create the cube at that position. # Create the cube at that position.
bpy.ops.mesh.primitive_cube_add(size = size, location = (treeXPos, treeYPos, treeZPos), scale = (size, size, size)) bpy.ops.mesh.primitive_cube_add(size = size, location = (treeXPos, treeYPos, treeZPos), scale = (size, size, size))
# Save the active object # Save the active object