From c530a0fbc67252b4e15c5b63689d4dffb9140e40 Mon Sep 17 00:00:00 2001 From: CJSatnarine Date: Fri, 29 Dec 2023 12:46:29 -0500 Subject: [PATCH] Clean the code a bit --- GenerateTerrain.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/GenerateTerrain.py b/GenerateTerrain.py index c6f8a53..997f6d4 100644 --- a/GenerateTerrain.py +++ b/GenerateTerrain.py @@ -1,7 +1,6 @@ #Imports. import bpy; -# Variables: # Size of each cube. size = 1; # Setting the x, y, and z positions. @@ -55,6 +54,7 @@ def spawnGround(): # Change the base colour. materialNodes['Principled BSDF'].inputs['Base Color'].default_value = (0.056, 0.439, 0.059, 1.0); + # Function to spawn trees on the grass. def spawnTree(): print("Tree has spawned."); @@ -62,16 +62,12 @@ def spawnTree(): # Calling the functions: cleanScene(); spawnGround(); -spawnTree; +spawnTree(); # Shows that the code ran. print("The code ran."); # Notes: -# - For loop for the grid: -# - x is for creating cubes in the x axis. -# - y is for creating cubes in the y axis. -# - z is for creating cubes in the z axis. # - I need to add the materials to the cubes and somehow save it in the Blender program. # - I need to replace the nested for loop with a recursive function to spawn the ground. # - I need to add a function to create a tree in a random position. This function will create cubes and put them in a way to look like a tree. It will also assign the correct materials to their proper cubes.