Thursday, February 14, 2019

Week Five of Genius Hour Two - Viva La Animation!

This week, I modeled a robot and had it walk!  I think I am ready for Pixar!  I learned more about animating meshes and how to use the dope sheet and sequence editor.  Because of the cel-shading I used, this was rendered in Blender Render, not Cycles.

See the source image

To start, I needed some inspiration.  I went online and looked at various giant robots.  Of course, I looked at the transformers.  I also got some ideas from the Power Rangers robot.  Alex told me a little fun fact about the Power Rangers.  Apparently, the TV show, or at least the original series, would use the Japanese footage of the robots fighting.  The scenes in between with the Rangers in high school would be re-shot with American actors.



I didn't really want to copy Optimus Prime, but I figured having him in the background would be invaluable in getting the proportions correct.  I had a front and side view, but only the front view was used.  The side view was slightly smaller, and I couldn't figure out how to resize it.  Speaking of the Transformers, they are some great examples of what good CGI looks like.  The robot was made from a cube.  I simply resized and extruded different parts of it.  So only one side needed to be made and to ensure symmetry, I used a mirror modifier.  Knife cuts were also very useful in dividing up the mesh and its faces.


The hands were incredibly difficult.  I had Optimus's hands to go off of, but I couldn't get something that looked good.  At first, I extruded a cube and added some ridges.  This was then arrayed to make four fingers.  However, the result was ugly, and so was my second attempt at it.


Finally, I simply took a cube, added three loop cuts, a bevel modifier, and resized it.  It gave the robot a really blocky hand with some ridges to represent fingers.  This was made separately and then attached with a boolean modifier.


I had planned from the beginning to keep the robot low-poly, but I decided to see what it looked like with a subsurface modifier.  I have to say, it has a nice six-pack.


Finally, it was time for the head.  Using knife cuts, a section was divided off and extruded for the neck.  This was extruded again and scaled out.  The ultimate shape of the head was hexagonal.  I also made a face and moved it inwards.  The horns were inspired by the Power Rangers robot above.  Like the head, they were made using knife cuts and extrusion.

Image result for cel shading

In my last blog, I mentioned that I was planning on using cel-shading on this model.  It gives CGI a cartoony-look.  I mentioned The Legend of Zelda: The Wind Waker as well.  The image above shows the Link you know but in all his cel-shaded glory.

Image result for star wars resistance disney xdImage result for the iron giant

Cel-shading is also used in movies and TV shows.  The left is from Star Wars Resistance and the right from The Iron Giant.   The left is simply trying to look stylish, but the right is trying to trick the viewer into believing the robot is 2D.  Cel-shading is sometimes used for scenes or actions that are hard to animate through traditional means.  In the case of The Iron Giant, the robot would have been incredibly difficult to animate for a full-length movie.

I can't help but think of this one episode of Spongebob when I mention this.  In one episode, Patrick's rock shatters, and it is obviously CGI.  It was done that way because it was easier to do in CGI than through hand-drawn animations.


I knew Cycles had a toon shader, so I tried it out first.  This tutorial goes into how to use it, but not very well.  I had played around with the toon shader before and never got it to work well.  As you can see, I am not getting the desired effect.  A smoother mesh with a higher poly-count might have worked better.


Since I was worried that toon shader might not work, I moved on to my second choice.  This tutorial showed how to make a toon shader.  The only problem was that is was for Blender Render, not Cycles.  The change in rendering engine only really affects the materials and the render settings, so it wasn't too big of a deal.  I got everything hooked up, and it didn't work.  Turns out one of the wrong node outputs was going into the input.  Once I fixed that, I got the above image.  the colors were flipped and then it worked.

It can't really be seen, but there are special nodes at work here.  Offscreen are two nodes being fed into a math node, which is on screen.  These two nodes combine to calculate where the light hits the mesh.  This information goes into a color ramp.  This determines how the mesh will be shaded.  The two handles on the ramp are brought right next to each, resulting in no shading in between the two colors.  Another node allows me to change the color.  It also will change the shading color automatically.  Eventually, these are all fed into one node that then feeds into the output.


Once some minor changes are made, I got this.  I also added a borderline to it.  Blender refers to this as freestyle, and it was a pain.  I should have taken a photo to show you what I mean.  The lines were not going where I wanted them; many were all over the inside of the robot.  This tutorial helped a bit.  Eventually, I realized what I wanted in the sea of settings was contours.  This set the freestyle line to the outer contours of the robot.  I also set it to material boundaries, which you can see below.  I could also change the color, but not for individual materials, so everything has that dark green line.  There is a way to change the color for different materials, but it simply didn't work for me.  These settings, although confusing, can be used to create some cool things, like blueprints and Asian watercolor.


I copied the original material and added it to certain parts.  From there, I could simply change the color of the one node.  Since the different parts have different materials, the freestyle line outlined them.  I also added a blaster to replace his left arm.


The robot is nothing more than a sad sack of metal right now, so I added some bones.  This wasn't too difficult.  Once I had one side made, I was able to mirror it across.  The arm bones and leg bones had to be parented to the upper chest and lower chest bones respectively.  They were not connected at all, so when a chest bone moved, the arms or legs would be left behind.


The bones were added, and now it was time to weight paint.  The bones affect the mesh, and although the computer can set up this weight automatically, it can get it wrong.  In the left pic, I have the upper left leg selected.  Red is the highest and blue is the lowest amount of weight.  When the leg moves, the paint shows you what moves with it and by how much.  This needed to be fixed as some of the bones were affecting the chest or other limbs.  In the left, you can see what this can look like.  I rotated all the bones around to see how they looked and what needed to be changed.  The spine and head were fine.  It was mostly the limbs that needed fixing.  Apparently, weights can be mirrored, but I mirrored it a different way than how the tutorial did it.  This meant it wouldn't work and that I needed to do all the limbs by hand, which was tedious.


It bends!  Fun fact, this is the only time you get to see the end of the blaster.


Unfortunately, I didn't take too many screenshots of the animating process.  To animate it, I selected a bone, rotated it, and then inserted a keyframe.  I did this four more times to get the movement of one leg.  Thankfully, the animation for that leg could be copied and mirrored to the other side.  This was pretty difficult, and it still looks a little weird in the final product.  The arms were done the same way, which is shown above.  They also look a little funny.  I think I may have not rotated a bone far enough, so there is a weird little jump.  Although I had to pose it for the keyframes, the computer completed the in-between frames.  These in-between frames can be edited so the movement is slightly different, but I didn't do that.  You don't have to do every frame by hand like with hand-drawn animation, but it still isn't as easy as you might think.  This tutorial was of great help.


Originally, I wanted the robot to walk, trip, and then fall down and out of the screen.  The tutorial above had the character follow a path in a circle.  I did the same, but the robot started floating in the air.  I had to delete the path and add a new one.  Even still, it wasn't working very well.  The point it was following was way too far in front of the robot.  This meant that it would follow the line and then stop halfway through it.  Resizing the line a lot fixed it, but the scene still needed to be changed.  An easier thing to do would have probably been to animate the central robot bone.  I could have inserted a keyframe on the other side of the camera about two hundred frames later.


Video time!  These are a bunch of videos I took.  They mainly showcase a few of the things I talked about above.  This one shows me using the knife tool.  I show it snapping to the midpoints and how it can be used to cut up a face.  I used it to divide up n-gons and divide off sections for extrusion.


Seizure warning!  I was playing around with the world background colors.  After setting it to a magic texture, I was greeted with this psychedelic performance.


Here, I move some of the bones around.


Although I am lacking some photos on this process, I do have a video of me animating the robot.  You can see that weird jump at about where the animation repeats.


This video shows a more polished walk cycle.  I accidentally forgot to stop recording, so two-thirds of the video consists of me watching a tutorial.


Here is a still I rendered of the robot.  Blender Render is extremely fast; this photo only took a second to render, and there is no noise.  I really like the sort of cartoony look I was able to get.  Although I will probably not do something like this again for my blog, I might make some stuff on my own time.  I will like to keep learning a new part of Blender each week, but there isn't really too many big ideas left to learn.  Since we are going to have a two week period, I will probably save a big, unique scene for that.


Here is the final animation!  It only took about ten minutes to render in Blender Render, and I am pretty proud of it, even though is only seven seconds long.  There still is something off going on with the walk.  I tried to fix it, but I couldn't get back into the armature's dope sheet.  I also think the robot walks a little too fast, but at least its feet aren't sliding along the ground.  I have seen that before, and it looks sloppy.  Fortunately, the one complete walk cycle I made could be duplicated and repeated.  I will email this to Pixar soon.  Hopefully, they recognize my talent and hire me.

This was pretty difficult and had me mess around with a lot of new things.  A lot of it was purely trial and error.  I also rendered the animation as a PNG sequence that then had to be combined in the sequencer, a simple video editing program that comes with Blender.  As such, I have about two hundred frames of animation.  Name which frame you want, and I'll give it to you!  Similar to cel-shading, I don't think I will mess around with animation any more on my blog.  I may continue with it on my own time.  Truthfully, I think it could make a Genius Hour of its own.  As such, I might just do that.

Again, I haven't been following my planner.  I should have started the Blender Guru Anvil Tutorial this week, but I obviously didn't.  I want to do my own scenes instead of a paint-by-numbers tutorial that gives me a result that looks like everyone else's final render.  Also, independence was one of the factors I was going to use to determine my success.  For this animation, I needed a lot of tutorials for everything.  I, however, didn't use one for the pizza or the rose.  I did get the bezier circle thing from a tutorial that wasn't about roses, though.

I am not exactly sure what I will do next week, but by the time you read this, I should have an idea.  I think I will do a room in a house, like a bathroom or a kitchen.

1 comment:

  1. Very impressive Brandon! It seems like you are getting the hang of blender. I can't wait to see what you make next week.

    ReplyDelete