Week 8
Modular Pyramids Continued
Pyramid Class
Following on from last week I have moved all the pyramid functions into a class. This was easy I had already moved the code into functions.
The only other change that I made was to change the commands called by the window buttons. They now access the class methods instead of functions.
Modular Slider
Next I create a slider button which gives the user another option to input values.
This gives the user a slider and a new button to change the pyramid size.
Week 8 Activities
1. Cube Class
Following on from last week, create a Python class called Cube that can be used as a template to be able to create, move, rotate, freeze, modify and select Cube objects in Maya.
I moved the functions to a Cube class with this initialiser. The init function takes 5 parameters, some of which contain default values.
2. Built-in Functions
Insert comments explaining the given scripts functionality.
3. Custom UIs
Now, try using the script from the previous activity and perform a number of customised tasks as follows:
a) change the number of items displayed on the window;
b) change the message printed each time the user clicks on an item, so that the counting of items is bottom up rather than top-down;
c) implement two separate windows with different number of buttons each.
d) implement a number of separate windows as specified by asking the user.
Here is my modified script. The objects take an input parameter which corresponds to the number of buttons.
Programming for Animation Blog
Status | In development |
Category | Other |
Author | up2115462 |
Leave a comment
Log in with itch.io to leave a comment.