Sunday, February 26, 2012

Blogpost 13: Final Project

This blogpost will be all about the final project for this subject, 3D Production and Foundation.
I am grouped together with another classmate to complete this project. My partner is Jing Hong, and we are tasked to choose a dialogue, be it from a movie clip or self directed script, and find  a rig to animate them out. There are also several requirements and bonus assignments that can be achieved through this project.

We are required to submit all our working files, a final animation, and a storyboard. The bonus  section will be submitting a playblast of the blocking of our animation.

Task 1: Choosing the Dialogue
Breaking down the assignments to different sections, our first task is to select a dialogue for our animation. From dialogues of fantasy movies such as Harry Potter, war battle-like movies of Lord of the Rings, to the famous animations of Toy Story. Looking through the scenes, especially Toy Story, I'm inspired by them and would try to learn the unique poses of the animations found in the movie to display different emotions.

Finally, we have decided to choose a dialogue found in Jackie Chan's movie, "Gorgeous". The dialogue and movie scene can be seen in the video below.


Jackie Chan's "Gorgeous".


Here, we can see that the camera is moving to and fro from the two characters at enough time intervals for us to animate out the entire scene. Looking through the short movie clip over and over again, I have already decided what poses I should make at which parts of the audio.

Then, I started to look around for online video references that would aid me in drawing the storyboard of the dialogue. Knowing that animations are normally slightly different from the reality world, just looking at the video wouldn't really bring me that far into creating a good animation. Hence, I found this video from Toy Story 3.



This video is a short clip from Toy Story 3. From here, I saw the different poses that the animators from Pixar animation has done to creating this famous movie.

With that, we started on doing our storyboards. We began by drawing storyboards for our individual characters before drawing a final group storyboard of the entire animation with more detailed camera views and movements.

Individual Storyboard Page 1

Individual Storyboard Page 2

These are the key poses of my character in the animation. Especially in box 6, this pose is also found in Toy Story, showing a very shocked emotion of the animation. From this, I've learnt that by going through different materials, and exploring more, I would be able to learn a lot about animation and eventually, improving my own animations.

Group Storyboard Page 1

Group Storyboard Page 2

Here is the group storyboard, that includes both characters, with the important key poses before starting to animate them in Maya 2012.

When creating the storyboard, we have created a story about the entire animation to help in our development of it. Creating characteristics of our character and having a background story of it gives us an idea on how the characters should be feeling.

Background Story (Page 1 - Mr Chan)
Background Story (Page 2 - Mr Allan)

Task 2: Blocking the Key Poses
In order to create an animation, by blocking in the key poses would be one of the first steps. By looking closely to the storyboard that has been drawn, I also looked online for any video references and tips in creating unique and good key poses so that the animation would look great.

Below is a video reference seen online about pose to pose animation. I think that this is a very good video reference as the body language of the animation can show how the character is feeling and should be feeling. These are all the different emotion poses that can be used in an animation. Called "Pose to Pose Animation".






Then, I looked further into different animation tips online and found this video rather useful as well.


In this video, there are some several exaggerations made to create a very good effect of the entire scene. Especially when the body of the animation is being enlarged when it burps.

Here is the playblast of my animation's key pose blocking.

Blocking key poses of my animation

Looking through the poses, I'm really satisfied with the shocked pose that I've made for my animation. I got this idea of its pose when I was thinking about all the cartoons that I've watched in the past. It makes a very funny pose, as well as showing how scared the character is in the current frame. The hand and facial movements are not made. Only the body key poses are done in this. They will be done further in the animating process.

Task 3: Animating
From the lessons that I've learnt, animating from the blocking files would be a good way in creating a good animation as all the key poses are already being key framed into Maya. With that, I started doing the arm movements, creating a smooth motion for different parts of the scene, and also sharp motions to create shocked emotions for the animation. To further improve, I looked online once again for different references in creating a good animation since I've already reached to this process.

Here is a video about a short animation clip called, "The Pigeon: Impossible". I think the animation is really great and the animator explained on two different ways of animating that people commonly use.



From the video, I have learnt that there are two different ways of creating an animation. The "Pose to Pose" method, and the "Layered" method. Pose to Pose is about starting off with the key poses of the animation. It's the crucial moments that represent the action. This is exactly what I have learnt in class, which is called, "Blocking", that has been done above. There is further explanation into this method, called, "Adding Breakdowns". This is to add poses into the in-between of each key poses to smooth out and refine the animation, preventing things such as arms going through body or moving in a very awkward manner.

The next method, "Layered", which is building up the entire animation from scratch by creating more and more controls for the entire character, slowly building up with different poses from the start. Layered animation tends to rely a lot on the graph editor, that can create really good effects and motions.

The animator further explains that his preference on these two different methods actually depend more on the shot. If the shot has more clear poses and pauses, then Pose to Pose is more preferred. As more shots that have more movements or in continuous motion of actions, Layered would be a better choice. This is because Pose to Pose allows the scene to show the key poses that would be noticed by the viewer, without much movements of the entire structure of the animation. Pose to Pose is more preferred for snappy cartoon motion. As for Layered, is more used in scenes that are more smoother and realistic in motion. Finally, try both methods to see what's most natural and better of the animation to you.

From this video, I have decided to use the two different methods together in my animation. First, the Pose to Pose is done by what I learnt, "Blocking". Then, when creating the in between poses of the step, "Adding Breakdowns", I would decide in using Layered method to help in creating smoother and more realistic motions of the animation.

Furthermore, since my character does have some shocked and scared scenes, I decided to research further in how to create these emotions through body languages. In the video below, it helped me refine my final animation for this project.



As you can see from the video above, the body is normally stretched when in a shocked emotion, including several shaking of different parts of the body which create a great effect of being scared/frightened.

Here is the video of the animation that I've made individually, before merging it together with my partner's work.


Taking notice about what has been taught in class, especially "Ease in Ease out" motions, "Anticipation", and "Follow Through Movements". These three principles out of the 12 Animation Principles are strongly weighted by our teacher when doing this project. Keeping in mind of this 3 principles, I was able to create the animation that looks more realistic than before adding these words of advice. Also, about Holding Poses, this was mentioned in class that: "There is no such thing as freezing moments, the animation is always moving." Even when the camera is not on you, your character should be at least doing something that being stationary there. Things such as breathing or movement of head when the opposite side is speaking, or even blinking of the eyes can be done to prevent the animation from coming to a freeze motion, which is really bad to be seen in an animation. Think of animation movies, the background always have its trees swaying to creating a windy effect even though the main focus is not on them. It helps to bring the animation more "lively".

Task 4: Camera Views and Effects
Though I have no knowledge or whatsoever about camera views, I started looking through materials to help in completing the project at our best.

First Person View is thought of when it comes to the movement so the camera. We thought that having some far shot throughout the entire animation would be quite boring, hence adding this camera effect to improve on our animation.

Zooming in Effect creates a very cool and fast motion of the camera to bring the viewer change its focus onto a particular object or person at a point. Below is an example of how zooming in effect can be done in my animation when it comes to production.



We both agreed on adding effect into the scene as we find the dialogue quite dull. Looking through online materials, I found that having lightning effects on the final scene would be perfect. Hence, below is a tutorial on how to create a lightning effect.



To further improve on the lightning effect, we decided to add more lights to create the glowing effect in between the eyes of our animation, creating a very fierce feeling when the two animations begins to fight.

Task 5: Production and Conclusion
By guessing that Windows may not be able to render a good video of our animation, we went to school to and rendered our animation by using Mac desktop. The results is seen below.

FINAL ANIMATION (WITHOUT AUDIO)

Yes, there is nothing wrong with your computer's audio. The rendered video does not have any audio in the first place. We didn't know this at first, but solved the problem by adding the audio into the video through iMovie and below is the final results of this project.

FINAL ANIMATION

Facial movements are looked into greatly to create different emotions, such as the movement of eyebrows, enlarged and fast motions of (OPEN and CLOSING) of the eyes to create shocked effects, blinking of the eyes to display character being in a state of shock, and  slanted mouths to create a funny animation effect. In parts of the animation, there are several reasons why the character is feeling sad at different moments, hence *NOTE: Do read the background story that is found under the section of "Storyboarding" at the top of this blogpost. This will help you further understand the animation that is made and why Mr Chan would try to resist the fight.

In conclusion, this project as really taught me the to place in the very fundamentals of animation, helping me to keep in mind of the 12 different Animation principles to create a more realistic production, and also different camera views and effects to make the animation more interesting and lively. Also, I've learnt a lot on using the graph editor to help refine the movements of my animation. Furthermore, I understood the an important process of working together with another animator to help completing the the entire animation. I enjoyed doing this project and I'm really satisfied with the production that I and my partner, Then Jing Hong, made.

Sunday, February 5, 2012

Blogpost 12: Week 4 - Exercise 5 - Scripting in Maya (Conclusion)

For the final exercise, Exercise 5, I was given three questions to answer as a conclusion of MEL Scripting.
Questions
1. Imagine you are creating a scene where a car drives along a straight road, but swerves around at random as if the driver is drunk. Do you think it would be useful to know how to program using MEL when creating this scene? Explain.


Answer: Of course it'll be useful in using MEL to create this kind of scene. As stated above, we are supposed to create a scene where by a drunkard is driving in a car. With the knowledge of this, we know that we should be creating a function in MEL to control the movement of the car when swerving from Left to Right. By doing so, we set variables to contain a randomize number generated by Maya. Using this number, we can enter it into the rotation of the car, to show that it is moving in inconsistently and randomize angles of direction. This is quite similar to the exercise in Exercise 2 where by the zombies that are created in the scene are moving in randomized angles so that they look like they are just walking around in the graveyard scene.


2 For the drunken car scene, give TWO advantages and disadvantages (pros and cons) of using scripting to create the swerving car animation.


Answer: One of the advantages would be the randomize direction where the car is heading, which could be created using Maya's built-in command called the rand command. Another advantage would be, using MEL Scripting can help in creating a User Interface for the user to control the movement of the car, the amount of turnings that the user wants the car to do throughout the straight road. By creating a User Interface, the user will not need to be manually coding in the different MEL codes, they could be set through the UI which will easily help in changing the different angles desired by the user. 
As for the disadvantages, MEL Scripting does not allow the car to move in terms of working with the timeline. An example, if you want the car to move faster and swerve harder from frames 48 - 56, it is better to move the car to different positions and blocking them, then adjusting it into the graph editor, making it more realistic. Another disadvantage found in MEL Scripting, when the car turns, in reality the entire car moves to the side in the opposite direction of where its turning. By using the timeline and graph editors again, a realistic movement of the car could be produced. However by doing so, the car will not be able to randomize its turning angles on its own anymore.


3You might think that programming using MEL is similar to using ALICE (in Year 1). It is actually very different. Explain TWO of the main differences, as far as you can tell.


Answer: In Alice, the tools are fairly clear and objects could be easily pulled into the world which you are animating in it. However, it could not specifically change or state how the object should be, such as attributes. In MEL scripting, we are allowed to change the attributes of the objects that we are working on by using codes such as getAttr or setAttr. Though MEL scripting is more complex, it allows us to learn the very basics and change anything specifically as much as we want. 
Furthermore, we have just learnt that we could install menus into Maya in Exercise 4. This could not be done in Alice. MEL allows us to install in menus that are already entered with its own script. We just have to Source Script and install the scripts into Maya for us to use the menus, hence making Maya a more flexible choice. Additionally, MEL allows us to create User Interface windows which I think is really useful, as we wouldn't need to head back to the script and manually type in the codes. We just have to set variables for the buttons to allow them to contain the values that we enter in and allow the script to run according to the values set for them in the UI.


Conclusion
After the entire series of exercise about MEL Scripting, I've really understood how powerful Maya can be in the 3D animation world. At first, I was really irritated and not interested when I found out that in Week 4 onward, I will be learning about scripting. All I thought was programming, programming and non stop errors. At the end of it, I was wrong. MEL Scripting is really powerful, being able to create things that will never be done easily through the tools given in the interface of Maya. As explained by Mr. Douglas, learning MEL would be a step ahead of other animators and scripting in MEL is a rare skill that animators these days have. Hence, being able to learn it is helping me to stand out from the crowd, and show that I'm capable of doing something that others are not familiar with. What I really enjoyed the most in MEL Scripting is, MEL actually made the rigid Maya, into such a flexible program. With the help of commands that are already built in into Maya, I was surprised that MEL could do such things, such as creating random numbers for random movements or positions, and creating User Interface windows that would really save time and allow the user to change the scene accordingly to the values they input in the text boxes provided in the User Interface. At the end of it, I would say, "Yes, learning MEL is useful, so useful!".

Blogpost 11: Week 4 - Exercise 4 - Scripting in Maya (Creating Curves with a Installed Menu)

For Exercise 4, I was tasked to go through the instructions given by the website,"http://www.comet-cartoons.com/maya.html", in installing a menu that could be downloaded from their site. Going through the instructions, by placing the files into the "scripts" file of Maya Projects folder, is an important step as Maya will have to look through its own folders to search the scripts. Then, follow the following procedure: Script Editor > File > Source Code. Enter the following code,"cometMenu();". Execute the code. By doing these procedures will help to install the downloaded files and scripts into the menu that can be found at the top of Maya's window, named comet. Below are the five different curves/shapes that I've made using the installed menu, "Comet".

Arrow Shape

Bulb Shape

Circle Y Shape

Cross Shape
Orient Shape

After this exercise, it actually showed me that Maya can not only just allow users to use tools that are already built inside the program. Maya allows us to install downloaded menus that were already script loaded to create different shapes/curves that are already provided for the user to use when installed.

Blogpost 10: Week 4 - Exercise 3 - Scripting in Maya (Zombie Apocalypse User Interface)

In this exercise, I'm tasked to learn how to create a user interface (learnt in Exercise 1) and also creating zombies randomly (learnt in Exercise 2), by using the user interface, instead of using hard codes added into the Script Editor.

I have 3 task, to complete in this exercise.
1) A textbox to indicate the zombies
2) A button labelled "Random" to create random number of zombies (from 1-50 zombies), also showing a textbox to display the random number generated by Maya.
3) A button labelled "Create" to create the zombies onto the scene.

With the help of previous exercise, I've learnt how to create a user interface with the window named, "Zombiemaker". When doing this exercise, I had to go to a few number of websites to learn other codes that are not taught in the exercises. I've placed some website references below to show how I completed this exercise successfully.

Website References (Creating User Interface)
1. http://accad.osu.edu/~aprice/courses/694/controls.html
2. http://www.polyextrude.com/tutorials/MelScripting/chapter9/buttons.html
3. http://www.3dtrue.com/maya/4.html
4. http://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/mel/GUI_controls.html

Website References (Generating Random Numbers in Maya)
1. http://download.autodesk.com/us/maya/2010help/Commands/rand.html
2. http://download.autodesk.com/global/docs/maya2012/en_us/index.html

Here is the documentation of the codes that allowed my Zombiemaker User Interface to work successfully with the scene.

Documentation of Zombiemaker User Interface

//Checking if the UI window has already been created in Maya.
if (`window -ex Zombiemaker`) deleteUI Zombiemaker;

//Creating the UI called Zombiemaker with sizes 400 in height and 100 in width.
window -wh 400 100 -t "Zombiemaker" Zombiemaker;

columnLayout -adj true;

//Adding sliders and limiting with the minimum and maximum values.
intSliderGrp -l "Number of Humans" -f true -v 10 -min 1 -max 20 slider_humans;
intSliderGrp -l "Number of Zombies" -f true -v 3 -min 1 -max 5 slider_zombies;

//Creating buttons "Create" and "Generate", and assigning actions when they are clicked.
button -l "Create" -c "generate_characters()";
button -l "Random" -c "generate_random_characters()";

//Showing the created window Zombiemaker.
showWindow Zombiemaker;

//Creating a function "generate_characters()". Proc = Procedure.
//This function is called when the "Create" button is pressed.
//It will create different number of Humans and Zombies stated in the textfield or slider.
proc generate_characters(){
 
    string $all_characters[] = `ls -tr "human*" "zombie*"`;
    if (size($all_characters)) delete $all_characters;
 
    int $num_humans =`intSliderGrp -q -v slider_humans`;
    int $num_zombies =`intSliderGrp -q -v slider_zombies`;
 

    for ($i = 0; $i < $num_humans; $i++)
    {
        string $new_human[] = `duplicate -rr -un -n "human#" original_human_GRP`;
        setAttr ($new_human[0] + ".v") true;
 
        float $randx = rand(0,1120);
        float $randz = rand(0,1120);
     
        move $randx 0 $randz $new_human[0];
    }
     
    for ($i = 0; $i < $num_zombies; $i++)
    {
        string $new_zombie[] = `duplicate -rr -un -n "zombie#" original_zombie_GRP`;
        setAttr ($new_zombie[0] + ".v") true;
     
        float $randx = rand(-1120,0);
        float $randz = rand(-1120,0);
     
        move $randx 0 $randz $new_zombie[0];
    }
 
}

//Creating the function "generate_random_characters".
//This function is called when the button, "Random" is clicked.
//The random number generated will be displayed and create the same number of zombies on the field.
proc generate_random_characters()
{
    //$random_number is a variable used to store the random number.
    //$random_number_text is used to store the text and random number, that would be displayed when the
    //button, "Random" is clicked.

    int $random_number = rand(1, 50);
    int $num_zombies = $random_number;
    string $random_number_text = "Number of zombies randomly created: " + $random_number;
    text -label $random_number_text;
 
    for ($i = 0; $i < $num_zombies; $i++)
    {
        string $new_zombie[] = `duplicate -rr -un -n "zombie#" original_zombie_GRP`;
        setAttr ($new_zombie[0] + ".v") true;
     
        float $randx = rand(-1120,0);
        float $randz = rand(-1120,0);
     
        move $randx 0 $randz $new_zombie[0];
    }
}


End of Zombiemaker User Interface


With the documentation done correctly, I was able to create and meet the requirements, creating zombies onto the scene with the UI and creating a random number amount of zombies onto the scene. The images below would show how the UI looks like and how it will help in creating the zombies.

The User Interface of Zombiemaker. Here shows the result of creating 5 zombies and 10 humans onto the scene.

This shows the result of creating a random number of zombies when the "Random" button is clicked, and also displaying the number of zombies being created onto the scene in the Zombiemaker User Interface.

Through this exercise, I find MEL Scripting really helpful in doing many different things, making Maya to be a very flexible program. Coming with a little knowledge from ActionScript, I find that MEL Scripting helps in doing things that can be done also in ActionScript. Tools such as the above one, creating a random number and telling Maya to create the random amount of zombies onto the field is possible throough MEL Scripting. This hence proved that MEL Scripting is a really powerful tool and also an essential knowledge for animators to have. Doing things such as creating random number of objects onto the scene would not be possible if I was merely exposed to just using the tools provided by Maya. This has been a really fruitful exercise.

Thursday, February 2, 2012

Blogpost 9: Week 4 - Exercise 2 - Scripting in Maya (Zombie Apocalypse)

In this exercise, I'm given the link to a Autodesk Maya Learning Channel on YouTube, the link is,"http://www.youtube.com/user/MayaHowTos". There are a total of six videos that are required to be uploaded for my online journal here by following through the tutorial videos provided there.

This video above show the tutorial about how scripting will allow a animation to move in a random direction, and also turning back when it hits the boundaries of the walls. This video is my attempt on this tutorial.


In this video, it shows how the use of adding attributes for different expressions could help in adjusting the speed and agility of the characters.

For the video above, learnt from the tutorial, I'm able to create a loop for the script to run over and over again until the conditions stated are met. This saves us to allow us to apply codes for a number of characters instead of coding for every single one of them, which will be extremely time consuming. when there are over 200 characters.

In this following video, I have learnt how to use script in order to create different effects seen in Maya. Not visual effects, but replacing objects when conditions are met using if-else statements which is learnt in programming lessons. It is an excellent way of telling Maya what and when to do things that are expected and thought of just simply by coding "instructions" for Maya.

Further into the tutorial, I'm given the instructions and codes to be entered into both the Expression Editor and the Script Editor to create a running human when the zombie is near with the units of 270. This makes it really realistic as the human should be running away when the zombie is nearby. Furthermore, the human's speed is increased when running, adding more realism into the environment.

User Interface for easy use of creating zombies and humans instead of typing in codes in Maya.
In the very last of whole video tutorial, I'm taught with the codes on how to create a User Interface window in creating the zombies and humans. In the above image will show how is my attempt with it. Using the User Interface, it helped a lot as there's no need to be viewing through the hard coded values and replacing them. I just have to use the User Interface Window and everything will be created as instructed in Maya.

In conclusion for Exercise 2, I feel that going through these video tutorials allow us to learn more by looking clearly at what the person is talking about and clearly of where the tools should be found in the Maya interface. Through this exercise, I found that through scripting, it is really easy and fun to do things in Maya, especially creating a User Interface window easily for me to use eg. creating humans and zombies in this exercise. I would definitely use the scripting in creating User Interface windows to help ease my progress in Maya.

Monday, January 30, 2012

Blogpost 8: Week 4 - Exercise 1 - Scripting in Maya

Scripting in Maya allows the user to use scripts to do different functions and tasks in Maya. The functions could be seen on this site: "http://download.autodesk.com/us/maya/Maya2012_Getting_Started/index.html". There are two different scripting languages used in Maya. MEL (Maya Embedded Language) and Python. Python is a new scripting language that has just been introduced into Maya, which means that the majority of the scripts are still accessed through MEL. To know more of Python, the website reference is, "http://www.python.org/about/gettingstarted/".

In Lesson 1 of the entire chapter, I was introduced to the basics of MEL scripting, eg. MEL command lines and script editors. By using MEL scripting, I was able to create polygons onto the stage without needing to use the interface provided by Maya. With the help of the script editor, I was able to enter in codes and creating polygons with different heights and positioning them into different x,y,z axis of the stage. Even renaming the polygons' name could be done through the script.

Adding different polygons onto the stage by using script editors.



I found out that the Script Editor is a really useful tool especially when I want to have a look at the entire history of tools and changes that I've made in my animation. All the values and positions could be seen as long as I know how to read the MEL scripts. 

Not just positioning the polygons, the polygons could be moved by using codes in MEL scripting such as, "move -r -5 0 0;". As well as removing objects from the stage by the command, "delete;". This would sum up Lesson 1.

Lesson 2
In lesson 2, I'm tasked to screenshot a lit and rendered cube with the properties of, Width = 2, Height = 2, Depth = 3. First, creating a polycube by using codes. "polyCube;" is the code to creating a cube in the stage. Then editing the different properties by the following three commands, "polyCube -edit - height 2;", "polyCube -edit -width 2;", and "polyCube -edit -depth 2;"

Next, I'm tasked to insert a directional light using codes, and through that, renaming it to main_light, setting attributes for it as well. All these could be achieved simply by scripting, hence, with the knowledge of scripting, an animator could execute fast commands through the script editor.


Adding in directional lights and setting its resolution through scripting
Re-positioning of the directional lights and controlling its intensity with the following codes
This is the rendered image for Lesson 2. By the use of directional lights and shadows using the MEL scripting language, such images could be modeled and made in Maya.
In the Lesson 3, I will be handling with a barrel, learning how to make use of the script to show a rolling barrel animation. Through Autodesk Maya tutorials, I will learning how to use codes to rotate anything that could be found the stage, learning that MEL Script Editor could recognize most programming languages.

First, rotating the barrel with the following codes, "rotate -r 0 0 90;". This allows the barrel to be rotated in 90 degrees of its z-axis. Further into the tutorials, I found out that MEL also supports other data types that are common to most other programming languages. A testing can be made to show this.

Rotating the barrel to 90 degrees in the z axis
The Script Editor could recognize most of the programming languages
In the above image, the output of the Script Editor shows, "this is a test" at the bottom right of the screen. Also, variables can be declared and assigned a value in the same statement.

To declare an int variable, type in the following codes of, "int $testInt = 5; print ($testInt/2);". The output should display the number of, "2", as seen in the image below.

Declaring an integer variable in the Script Editor and an output of ,"2" can be seen in the output portion.

With the knowledge of this, we are ready to start with animating the rolling barrel. With the codes given,"duplicate; move -r 0 0 $diameter_barrel;", the barrels will be duplicated and aligned side by side with each other. The variable of $diameter_barrel is declared previously in the starting of the tutorial, allowing the scripting to recognize it and re-position the barrels side by side to each diameter of the barrel being duplicated. This can be seen in the image shown below:

Duplicating the barrels in the first row with the used of the declared variable previously made in the starting part of the tutorial, known  as $diameter_barrel.

With that, the first row of barrel is completed. To stack the barrels in a triangular arrangement by duplicating the existing row in both X and Y, a little part of trigonometry is needed. The following is the reference provided by Autodesk Maya from the website: http://download.autodesk.com/us/maya/Maya2012_Getting_Started/index.html.

Explanation of triangles given by Autodesk Maya through basic trigonometry.

This diagram aids in the stacking and positioning of the barrels using basic mathematical functions and degree to radian conversions that could be executed in MEL scripting.

With reference to the above images, we could declare a new variable to store the value of the Y offset by typing the following: "float $Y_offset;". Also, by using some mathematical functions, with the following sentence: "$Y_offset = $diameter_barrel * (sin(deg_to_rad(60)));" Extracted from the website:"The assignment operator evaluates the right and side of the expression and assigns it to the left hand side. The degree to radian conversion function is the first to be evaluated, as it is within the most interior set of brackets. The sine function calculates the sine of the angle given in radians. The sine value is multiplied by the diameter to calculate the Y offset. The variable is assigned the calculated value." A notice that has been given from Autodesk Maya would help deeper understand with the following functions, "The variable $diameter_barrel does not change in value. Only the variable on the left side of an assignment operator changes in value."

Conversion done through MEL scripting from degree to radians. The result is being highlighted in the image above.

To Stack the rows of barrels
When stacking the barrels, the using of the $Y_offset would really help a lot since the values were already placed into the variable, done in the previous step.

With the help of the variable $Y_offset, the barrels could be positioned easily.

To Add Rigid Body Nodes to the Barrels using MEL 
In this step, we will be adding "weight" to the barrels through the use of MEL. Furthermore, the gravity of the stage could be declared with the dynamics of the animation being created.

With the following codes, dynamics of gravity will be added into the animation.
To Create a Plane for the Barrels to stimulate against
To allow the barrels to be stimulated, we have to create a plane to allow them to stimulate against. Then selecting the plane to add rigid body nodes to it as well.

Adding a plane and rigid body nodes to it to allow the barrels to stimulate against it.

As result for the whole of Lesson 3, the following could be stimulated and seen in the playblast shown in the video below:




In the video shown above, we could see that the barrels falling against each other and took awhile before slowing down until a complete stop, something that's really interesting done through MEL Scripting.

Through Lesson 3, I've learnt the importance of MEL Scripting even more, knowing that it could help adding dynamics such as gravity, as well as declaring variables and the calculation of mathematical functions to be used in animations. They are really important and I've learnt so much in just through the whole of Lesson 3.


For Lesson 4, I'll learning the basic codes to create windows and user interfaces in Maya through a built-in Maya procedure. In the first exercise, I'm given the codes to enter into the Script Editor, creating a window, showing it too at the same time. The example can be seen below.

Creating a window in Maya
Next, with the following codes of, "window -resizeToFitChildren 1 testWindow; columnLayout;" , a window with the title, "testwindow", can be created and shown after entering them.

Creating a window with the title: "testwindow". 

Further into the exercise, I'm taught with the codes of creating windows but not showing it out in the user interface. And also creating windows to delete away the previous window. In reference with the image below,  2 concepts are taught by Maya (extracted from http://download.autodesk.com/us/maya/Maya2012_Getting_Started/index.html):
1) The if statement allows a certain part of code to execute depending on a condition. The section of code within the curly braces only executes if the statement inside the parentheses evaluates to true.

2) The paired back-ticks within the parentheses (' ') indicate that the commands within them are evaluated first. This is a useful part of writing MEL code: you can make certain commands (here, the conditional statement) dependent on other commands (here, the evaluation of whether the window exists), which execute and evaluate first.

"if" statement used in MEL to delete away existing windows. Explanation of the codes can be seen above and below the image.
Together, the if statement and the evaluation mean that only if the result of the window existence query is "1" (the window exists) is the window deleted. Otherwise, the section of code within the curly braces is skipped.
These concepts are really important and as of creating windows, I have to continuously keep track of the windows that are created and which ones should be deleted as Maya will not inform if the window does no exists or such, due to Maya skipping that section of code that does not "exist".

Buttons to store variables can be created too through MEL Scripting. The following shows the codes and how they are able to create a window with buttons.

Creating windows with buttons to store variables

Procedures are a set of instructions that allows the user to separate a section of the script and reuse whenever needed. The following example shows how the makeroll procedure can be made with the help of a polyCube. A makeroll procedure can be made by typing in the following: "makeRoll roll_Cube 0 1 1 0;"

makeRoll procedure being executed to the polyCube, making the cube roll when being moved and when the frame is set more than 2

Time to time we'll see files called Maya Script files. Problem is, we have to learn how to actually load them into Maya. To do this, go to File > Load Script in the Script Editor. When loaded, you should be able to see the script in the Script Editor in the MEL bottom column. The use of this helps to load User Interface windows saved in a script. You can see the example below:

Script loaded into the Script Editor
When the script is loaded, this window will appear, which has been created by the script.

These created buttons does not do anything even when clicked or slid. In the following examples, would show how the user interface would be linked to the buttons so that they can be used, and also saving the interface for future use.

This is the user interface created after going through Lesson 4, really tedious process and requires lots of understanding.

This line of code will help to save the user interface for future use.

After going through Lesson 4, I felt that Autodesk Maya is a very flexible program that allows the animator to create user interface windows and change every detail and parts of Maya just by the use of MEL Scripting. With the help of MEL Scripting, I find Autodesk Maya being a very customizable, allowing it to change to the liking of how the animator wants it to be. Learning this really do help and gives me deeper understanding of Autodesk Maya.

Wednesday, January 18, 2012

Blogpost 7: Week 2 - Exercise 1B & 2 - Blocking with Sound Files and Animation

For exercise 1B, I was assigned to choose a sound file from several given ones to act as a video reference, and blocking them out as well. Similar to the previous exercise, a full body video was taken to show the entire body movement, including the facial expressions. Exaggerating the actions to make it as detailed as possible to be seen in the video, I took a few retakes before finally confirming on one video to work on with. I chose the sound of "Harry Potter: You Dare", with the sound of one of the characters in the movie, Snape. I'm tasked to act out the audio file as Severus Snape in Harry Potter the movie. The video is shown below:

Video on acting out Severus Snape saying, "You dare use my own spells against me, Potter?", to Harry Potter (camera).

There are some errors that I have to admit that I've committed. My lip sync wasn't really in sync together with the given sound file and my last action was a bit to exaggerated. Still, the overall idea was there and the poses were detailed enough for me to use them as a video reference for my blocking exercise. The sentence that was heard in the audio file was by the famous Severus Snape talking to Harry Potter, saying," You dare use my own spells against me, Potter?" With that, I tried many different ways to show the emotions and weights in this sentence, also according to the real acting seen in Harry Potter the movie.

Similar to the previous exercise, I've taken screen shots of the entire video, blocking my actions that can be used in animation. This is the starting position.

 My arms started to move as I turned, as if looking at Harry Potter saying, "You ...". Body is slightly slanted as well as the script went on.

 As my body continued to turn, my arms raised higher, directing at the camera as if Harry Potter was standing there. At this point, the audio file reached, "You dare ... ".

 Secondary actions could be seen here as my legs moved together with my body as I turned face to face with the camera. The audio file had reached, "You dare use ...".

Using my arms to help in the acting of the audio file, I was having the mindset of Severus Snape's slow and evil talking style, with his movements always swaying, and fast at times when he's agitated. My leg lifts off the ground as I started walking towards the camera. Body leaning towards the stationary foot. Audio file: "You dare use my ...".

At this point, my entire body is facing straight up with the camera, as my hand continued to move but slowly moving downwards, together with my leg stepping forward towards the camera. Audio File, "You dare use my own ...".

In this block, my head is facing up in the air, but my eyes still locked at the camera, giving some anticipation in the sentence/words that are going to be said after. Audio File: "You dare use my own spells ..."

In this image, my face slants sideways while talking to show a questioning tone as the Snape asks the question. My leg came to a complete stop, having my body still moving forward towards the camera. My other feet is preparing to leave the ground as well. Audio File: "You dare use my own spells against ...".

Over in this scene, my hands are placed on my chest, indicating and stressing on the word "me" as the audio file continues to play on. Audio File: "You dare use my own spells against me ...". 

Audio File: "You dare use my own spells against me, Potter?"
This is the very last scene of the entire audio file. Hands are opened wide, anticipating an answer from Harry Potter, and head tilted sideways as I asked the question, providing the mood to be there. My face is kept serious to show the coldness in the voice of Severus Snape. Body leaning to one side as Secondary Action is seen. I found out another mistake that I actually made in this blocking exercise. My right arm didn't really move much throughout the entire acting, except this last scene. It would better blocking if more body movements were made when videoing this, but I kept having the mindset of the movie itself, that Severus Snape isn't someone that moves much and talks with swaying body postures in a very weird and slow way.

After completing this exercise, I was assigned to continue on with Exercise 2. Exercise 2 is like a continuation of the blocking exercise in 1B. Given with all the blocking images of the audio file, "You dare use my own spells against me, Potter?", I was tasked to block in all the key poses in Maya using a full body rig. Recommended by my friends, I decided to use the Norman Rig that could be obtained from this website: "http://www.11secondclub.com/resources". Norman Rig is a remarkable piece of model that has many controls, to the point that I had to search online and ask help on controlling the different parts of him. The guide to Norman Rig could be seen on this site: "https://sites.google.com/site/normanrig/". Really appreciate the creators of Norman Rig to actually provide a full detailed information about the rig so that all the parts of Norman could be utilized effectively for my given assignment. After a few days of working in Maya, I completed the assignment that could be seen below:


Animation for Severus Snape saying,"You dare use my own spells against me, Potter?" to Harry Potter.


Although the task was to just block in the different key poses by using the video reference and image that I've acted in the previous exercise, I decided to take one step further by animating the entire video with the imported audio file.

At first, it was really difficult as Norman Rig is quite a complex one to understand. There are so many controls that I spent quite awhile to understand and learn them. I began by looking at the images of me acting out the audio file, and slowly animating the model, body part by body part. After that, I shifted the poses to different keyframes so that the poses were aligned together with the audio file. Then, I started doing the tedious movement of his lips and jaw, lip syncing together with the audio file. I must admit, Norman Rig has really great controls for his mouth, that really display a good amount of different kinds of effects that I want to have. Then, the eyes and facial expressions were put into consideration, such as frowning faces and surprised moods that the audio file delivered. With the given great controls, I was quite pleased with my final result of my animation. Included tongue movements to match together with the words that ended with a L and eye blinks to make the animation more realistic. Though I must admit that I didn't really do much in the graph editor, just some minor changes here and there, I'll try to edit the animation as soon as time was on my side.

In conclusion for these exercises, I really enjoyed doing something that stacks on to help the other following assignment. It's like taking one step at a time and I'm actually completing something that I'm quite pleased about. Honestly, if it wasn't with the help of the video reference of myself acting, the animation would have been a dull and unsatisfied one. In the website of, "http://www.11secondclub.com/resources", there is a section where by people upload different videos of their animation, using the exact same rig, "Norman Rig". I was inspired by the animations that could be done with the exact same rig that I'm using. The different poses and how they match together with the sound, together with different camera views seen in Maya, their animation was plain awesome. Furthermore, with the knowledge of past exercises, I didn't really have much trouble with the animation except about understanding the controls found on the rig at first. This actually thought me a lesson as well, that I have to really understand my rig before I start animating it. Or else, I'll really miss out some important controls that I can utilize to make my animation into a much better one. Though really satisfied with it, I know there are still tons of room for improvement to go, and I'm willing to try and be better each and every time.