Week 5 - Activities


1. Retuning multiple values!

2. Populating Scenes with Assets!

The random module can be very useful when wanting to randomly create/disperse assets as the numbers it generates are obviously random:

3. Maya Commands!

The polyCube command can be used to create a new cube within a maya scene, and there are many modifications you can make to it, for example:


name - allows the user to name the cube to help differentiate it from any others.

height, width and depth - these are the 3 measurements used to change the dimensions of the cube. 


The circle command, similar to the polyCube command, can be used to add an object to the scene. However in this case it is a curves circle.

radius - a measurement used to determine the distance between the centre of the circle and its edge.


The setAttr command is used to change an objects attributes, for example, in this case it is changing the Circle01's x rotation to 90 degrees.


The move command is used to change an objects x,y,z translation.


The rotate command is used to change an objects x,y,z rotation.


The scale command is used to change an objects x,y,z scale.


The makeIdentity command is a quick way to reset the selected transform and all of its children down to the shape level by the identity transformation.

The select command is used to select an object in the scene, in this case "Box01"


The delete command is used to delete an object in the scene, in this case "Box01"


The parent command is used to parent one object to another in the object hierarchy, in this case "Circle01" becomes the child of "Box02"

5. Random Numbers!

Here I used a for loop to generate 100 random numbers:

Here I did the same procedure however this time using a while loop:

Here is a way I used to check how many times the code ran, this was to ensure I had exactly 100 random numbers:

6. User input!

This code:

(i) first declares an integer variable

(ii) set its initial value to 0

(iii) asks the user to enter a number

(iv) stores the entered number in the declared variable

(v) tells the user what their entered number was.


Leave a comment

Log in with itch.io to leave a comment.