From b2db8f08e0e029d00b89e1e2ed18fbd3566e11ea Mon Sep 17 00:00:00 2001 From: CJSatnarine Date: Fri, 29 Dec 2023 21:11:30 -0500 Subject: [PATCH] Remove number of cubes variable and counter variable --- GenerateTerrain.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/GenerateTerrain.py b/GenerateTerrain.py index 7d51dc5..c9f36a1 100644 --- a/GenerateTerrain.py +++ b/GenerateTerrain.py @@ -1,5 +1,6 @@ #Imports. import bpy +import random # Size of each cube. size = 1 @@ -9,10 +10,6 @@ x = y = z = size / 2 xNum = 10 yNum = 10 zNum = 1 -# Setting the initial value for the number of cubes in each recursive call. -cubeCount = 0 -# Setting the maximum amount of cubes that is needed to be created. -numOfCubes = xNum * yNum * zNum #Function to clean the scene. This removes all of the objects, collections, materials, particles, textures, images, curves, meshes, actions, nodes, and worlds from the scene. def cleanScene(): @@ -46,7 +43,7 @@ def spawnGround(): activeObject = bpy.context.active_object # Create the material (if the material already exists, then skip) - groundMaterial = createMaterial(0, 0, 0.6, 1) #Colour input is: red, blue, green, alpha + groundMaterial = createMaterial(0.027325, 0.080214, 0.450766, 1) #Colour input is: red, blue, green, alpha assignMaterial(activeObject, groundMaterial) # Function to add a material to the selected object. @@ -62,9 +59,14 @@ def createMaterial(red, blue, green, alpha): material.node_tree.nodes["Principled BSDF"].inputs[0].default_value = (red, green, blue, alpha) return material +# Function to create the tree. +def buildTree(): + print("tree") + # Calling the functions: cleanScene() -spawnGround() +# spawnGround() +buildTree() # Shows that the code ran. -print("The code ran.") \ No newline at end of file +print("The code ran to the end successfully.") \ No newline at end of file