Maya Forest Generator

Created on: 01/02/2024
Worked on by: Thomas Lower

This project was developed as a part of my university degree at Bournemouth University.

Purpose

The goal of this task was to create a python script for Maya that could automate a task. I chose to use this script to generate a tree, which was then expanded to generate an entire forest.

A failed attempt at generating trees where random values used were not clamped properly

A failed attempt at generating trees where random values used were not clamped properly

Development Process

To view the full design document and reflection click here.

Terrain

Terrain generation uses an extremely primitive method in which each point is randomly moved up or down by a random amount within a given amplitude (Parameter Terrain Amplitude). This terrain serves as the base parent of all other objects generated by the program.

Trees

Tree generation uses a form of recursion similar to the concept of an L-System but less abstract. It works from a system of recursion levels in which all objects are multiplied by an amount that decreases by a given amount. As this multiplier decreases, the chance of a branch generating leaves rather than further branches increases until the number of recursions reaches a pre-determined maximum level. At this point it is certain that leaves will be generated rather than branches (leaves act as a base case for the recursion as they do not create other items).

Grass

Grass also follows a similar sweeping method to trees however does not follow the recursion system used by the tree, rather a polynomial iterative method in which a single blade of grass is combined with 4 others about a circle to generate a ‘clump’. This clump is then placed at random points generated along the terrain.

Try it yourself

If you would like to run this code yourself, it can be accessed (along with the files it requires) here. Note: to run the program properly, run it inside of the tree.mb file.

#Solo #3D Art #3D Modelling #Procedural Modelling #Programming #Python #Maya #Environment #University Assignment #Nature