Lets say we want to do the following:
Lets say we want to do the following:
Some example code to quickly create a sample UI window in Maya.
It can be tedious running scripts from the script editor all the time, to make this easier we can add our scripts to the Maya shelf interface.
Remember running this from within Maya:
Functions within our python scripts are created using the ‘def’ command:
Output: I am a pug Note that the whatbreed() class has been added to the subclass Dog() but is not present in the base class…
Lets say we have a simple animal class:
‘self’ lets us refer to an instance of a class, Let’s modify our previous Animal class example:
Lets start again with our example Animal class:
We create instances of classes in python in the same way we create instances of any other types. Let’s take an example class: