Add colour to the tree trunk
This commit is contained in:
@@ -73,10 +73,13 @@ def buildTree():
|
|||||||
while counter <= treeHeight:
|
while counter <= treeHeight:
|
||||||
# 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
|
||||||
|
activeObject = bpy.context.active_object
|
||||||
# Increase the z position by 1 for the next iteration
|
# Increase the z position by 1 for the next iteration
|
||||||
treeZPos += 1
|
treeZPos += 1
|
||||||
# Set the colour.
|
# Set the colour.
|
||||||
|
treeTrunkColour = createMaterial(0.195465, 0.004988, 0.020193, 1)
|
||||||
|
assignMaterial(activeObject, treeTrunkColour)
|
||||||
# increase the counter
|
# increase the counter
|
||||||
counter += 1
|
counter += 1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user