Monday, 30 April 2012

Rigging Melvin

We have named the cat Melvin and I have just finished rigging him.

It taught me some new techniques especially about using spline IK handles rather then normal IK handles.

One valuable lesson I did learn whilst rigging was to always freeze transformations as you go. I had a lot of trouble after I had finished the rig as I hadn't frozen any transformations. This meant I could not reset the position of my character properly. In the end, it was a case of carefully undoing parts of my work, freezing transformations and re-doing them again.

I think the rig can be improved and if I were to do this again, I would probably not use circles for every single handle as when you use them, especially for the neck, they can easily get lost within the body. When I was rigging the rat in the last project, I coloured the handles depending on which side of the body they were for. I did not do this with this rig but I would next time only for the fact that the pole vectors get lost amongst each other when moving the cat around and when legs start to cross over each other it can get confusing.

I have found it hard to paint weights which I did not do for my previous rigs but this cat had quite a lot of vertices and I would find that when I moved a handle one way (usually the chest), if I moved it the other way, it would distort and crease. The painting weights on this cat are a constant work in progress as the more I move the cat around and push poses, I find a weight that needs addressing so this will probably continue to happen and continue to be addressed.

This rig needed more movement than previous rigs so I got to use set driven keys to bend and stretch the toes and blend shapes so that the cat can shut it's eyes. The ears had to have movement as well which could have been done using blend shapes (that method was used with the previous cat rig) but it was not very successful so I used joints this time to give them more freedom. That meant they can go in any direction and fold over or go to the side without having to re-model and adjust cat models to create blend shapes.

Below is a video of the melvin cat rig:

Friday, 27 April 2012

Blend Shapes

The cat needs to be able to sleep and therefore shut it eyes. To do this I have been looking into blend shapes. I remember a brief lesson on blend shapes in the first year so I know that I had to create a separate model with the desired action on it (i.e a model of the cat with its eyes shut).

I used reference images and managed to model one eye shut that looked quite cat-like.


It did take me several attempts so rather than having to model the eye shut on the other side of the face too, I deleted half the face and mirrored the geometry so that they would be exactly the same. 

With this model with the shut eyes I tired to create a blend shape. This was the outcome:



Firstly I tried to delete the history and freeze transformations to see if that made any difference but it was still the same. I tried exporting the model with the shut eyes as a .obj file and then reimporting it to see if that would solve the problem but it was still the same.

In the end I turned to the internet and researched the issue. I came across a forum where someone mentioned that the topology and vertex order had to be the same or similar for the blend shape to work.

In a book I have been reading called "Mastering Autodesk Maya" by Eric Keller there is a small section about importing without any vertex order being disturbed by using the option box when importing. So I tried to reimport the model without disturbing the vertex order.

It wasn't until I had tried all of these methods that I realised that mirroring geometry would probably mess up the vertex order, especially when I was sewing vertices back together around the head and neck.

This mad me realise that I would have to start again so duplicate the original mesh (with the open eyes) and model each eye closed separately rather than using shortcuts and mirroring the geometry. This did take longer but it also allowed me to shut the eyes independently whereas before I was going to have only one control to shut both eyes. It has also meant that the topology and vertex order has stayed the same or similar to the original model.

I added attributes so that I could control the blend shapes in the channel box and created the blend shapes. This then worked straight away without any problems.





Tuesday, 24 April 2012

Set driven keys using MEL scripting

I have been rigging the cat again. For the cat we need for the new project, we need more control in the paws and ears.

After speaking with Dan about what I want to do in the future, he suggested I start looking into MEL scripting. I started to have a look at simple code like selecting things, de-selecting things, creating objects, moving objects etc. I thought it would be good to practice more advanced script so whilst rigging the cat, I have left the script editor open so I can see the script as I do things.

I have been keeping the script editor open and looking at the script every time I do something. This has given me an idea of how the script will look and has allowed me to deconstruct the script so when I write script, I know what to write to make it do certain things. It has meant learning script has become quite easy and fast so that I could create my own scripts shortly afterwards.

This lead me to figure out how to create set driven keys for the cat's paws. I created script to key each toe to the driver that I selected. I had to then move the joints manually as I have not quite finessed that part yet but then could key each movement to the driver to create the desired effect.

This was the script, it is only for one foot at a time and one driven key at a time.


setDrivenKeyframe -currentDriver Rightbackfootcontrol.Bend Rightbackfirsttoe1.translateX;
setDrivenKeyframe -currentDriver Rightbackfootcontrol.Bend Rightbackfirsttoe1.rotateZ;
setDrivenKeyframe -currentDriver Rightbackfootcontrol.Bend Rightbacksecondtoe1.translateX;
setDrivenKeyframe -currentDriver Rightbackfootcontrol.Bend Rightbacksecondtoe1.rotateZ;
setDrivenKeyframe -currentDriver Rightbackfootcontrol.Bend Rightbackthirdtoe1.translateX;
setDrivenKeyframe -currentDriver Rightbackfootcontrol.Bend Rightbackthirdtoe1.rotateZ;
setDrivenKeyframe -currentDriver Rightbackfootcontrol.Bend Rightbackfourthtoe1.translateX;
setDrivenKeyframe -currentDriver Rightbackfootcontrol.Bend Rightbackfourthtoe1.rotateZ;

I had to change the attribute name for each foot and for each driver. For example this was to create set driven keys for the bend attribute but for the stretch attribute each section of script would be changed to:

setDrivenKeyframe -currentDriver Rightbackfootcontrol.Stretch Rightbackfirsttoe1.translateX;
setDrivenKeyframe -currentDriver Rightbackfootcontrol.Stretch Rightbackfirsttoe1.translateY;
setDrivenKeyframe -currentDriver Rightbackfootcontrol.Stretch Rightbackfirsttoe1.rotateZ;

The stretch effects more attributes so they have also been added. The name of the control would change with each foot too depending on what I have named them. After writing all the script, this was the final outcome.








Thursday, 19 April 2012

Cigarette Smoke

Russell Pointer has asked me to add cigarette smoke effect to his shot of a monkey picking up a smoking cigarette.

This was the video clip he has given me:



I have used Maya to create the smoke and exported each image as a .png so that the background will be see through. I will then use After Effects to layer the smoke over the video and move it accordingly when the cigarette moves.

I created a 2D container and fluid emitter. It has then been a case of changing the settings to create the smoke effect. Cigarette smoke is quite slow and curly. It disperses quite quickly and is a light grey colour. All this was what I had to make my cigarette smoke look like.

With the emitter, the smoke creates a ball shape as it comes out of the emitter. So it looked more realistic, and looks like it is coming out of the end of the cigarette, I made a cylinder cigarette shape and coloured it bright green so that it could be keyed out in After Effects afterwards.

This was the smoke test in Maya.



When I put it into After Effects, the cigarette shape was harder to key out that imagined because of the shadow on the cylinder. When I tried to key out the shadow, the cigarette was a similar colour so it keyed out some smoke as well. The way I got around this was to create a layer mask over the cigarette rather than key it out so it will definitely cover the whole cigarette.

This was the final outcome when added to the video Russell gave me.



The smoke curling at the top is quite hard to see but the video is only a couple of seconds long so it doesn't matter too much. The only other thing that could be improved was a red tip on the cigarette so it looks like it is still alight but that would mean Russell would have to reshoot the whole shot.

Tuesday, 17 April 2012

UV mapping the new cat/Fur test

Because I have changed the topology of the cat for the new idea, I have had UV map the cat. Sarah Strickland UV mapped the last cat so I offered to UV map the new cat.

It took me quite a long time to UV map but I eventually got quite a clean, clean map. I soon released a problem with it when I did a very quick fur test. This was the outcome:



Most of the sections of UVs are joined together (i.e the chest is attached to the main body, the legs were at strange angles). See below for UV map.


By moving the UVs around I discovered that the direction of the UVs have an effect on the direction of the fur. This meant that when I added the fur, the direction of the fur would be unnatural in some areas. For example, the fur on the back would go towards the tail but the fur on the chest would go towards the right. This was because of how the UVs were laid out. I tried to change the inclination and roll settings to make it all go the natural way but I could not get it to ALL be in a natural direction.

The only way I could see to resolve this was to change the UV map. I had to detach some areas like the chest and front of the thighs so that the UVs would then all go in the same direction and there fore the fur would appear more natural.

This was the final UV map which I passed onto Sarah so she could paint the texture.



Monday, 16 April 2012

Whiskey Bottle

As the Cat and Rat film was cut, I spoke to some groups to see if they needed any work doing. Russell Pointer asked if I could create whiskey in a bottle.

He sent me a file with an empty whiskey bottle and asked if I could make it look as though whiskey was inside. This a render of the file Russell sent me:


Firstly, I saw that the label did not look quite right and slightly squashed so I changed the UVs so that it looked more like a real label on Bell's whiskey. 

To add the liquid, I first duplicated the model, made it slightly smaller and deleted some faces to make it look like liquid was not quite to the top. I added a blinn shader, so it had some reflective and refractive properties, and then put it inside the bottle. After adjusting some settings and changing the colour as well as even changing the shader to a phong, this was the result.


The problems with this is that the material is not clear enough so it looks cloudy and unlike whiskey at all. 

I did some research into some mental ray materials which would give a better effect than a bling or phong. I ended up using dielectric materials for the glass and whiskey (changing the colour for the whiskey). These give better control over reflection and refraction and give a more fluid looking shader. 

Using these materials this was the end result.







Saturday, 14 April 2012

Changing the cat

For our new idea, I decided to change the cat slightly. This is because the old cat was quite cartoony with large ears and spikes at the side as tufts of fur which we didn't need anymore as we are going for a less cartoony feel. (Below is the previous model for the cat).



There were too many polygons around some areas which caused a lot more problems when it came to rigging and animating. 

By changing my model of the cat, I cut down the amount of polygons and got rid of the spike features as well as change the size of the ears. I can also re-rig the cat as we need the cat to have more control so it can do more things, such as stretch its toes and sniff, which we could not do with the last rig. By simplifying the model, it should make rigging and painting weights easier to.

This is the new cat model.


There are still quite a lot of polygons around the legs but that is due to the toes. They need to be quite rounded so have had to add more edges creating these extra polygons. The chest area, tail and face all have fewer polygons but still retaining the shape. 

This can now be re-rigged and I will create blend shapes which allow the cat to close it's eyes more realistically rather than have eyelids like the previous model did. 


Thursday, 12 April 2012

Cut the film - Future Plans

Today we had our presentations to see how we were getting on. After a meeting with the tutors, we agreed to cut our Cat and Rat film. We have all put a lot of effort into it but we keep coming across more and more issues. Currently we have not tried to get the animals to interact with the water and this could be a huge task that I don't think we would be able to handle with the deadline we have.

I think it is a good decision and means we can all focus on other projects and personal work to make better showreels but also use our skills to help other groups.

One of the options our tutors gave our group was to create a much shorter 30 second animation just show casing our best skills. On discussion with Sarah Strickland, we have decided to make a short animation of our cat (from the Cat and Rat film) in a different setting - a room with french windows. The cat will walk into the room, interact with the curtains around the doors and then jump onto the windowsill to look out into the garden.

We already have the cat model and would just need to model the room with french windows and curtains. We will probably use nCloth for the curtains to make it easier to interact with the cat.

This plan still needs to be finalised but in the mean time I have spoken to a few groups to see if they need any help with their films. So far Russell Pointer and Aaran Dummer have offered to let me help them with any work they need doing in the coming weeks.

I will also be working on my personal showreel so I can produce something for the degree show.


Monday, 9 April 2012

nCloth and Emperor

For the emperor's robes we all wanted to use nCloth. When I was trying it out though, there seemed to be many problems that I had to try to resolve.

Other people in the group had tried to use nCloth on the emperor too but it keeps slipping through him like it is just falling through the air:



I went a bit further with it and tried to constrain it but this time it would stay on the model but just pass through his skin like it wasn't there. I experimented with the different types of constraints to see which would create the best effect.

None of the constraints would keep the cloth from going through the skin so I looked at other methods to keep the cloth on the body. I decided that rather constrain it, I could make the emperor body a collision so that the robe would interact with the emperor and not fall through it.



This was making progress as at least it was not falling through the emperor completely. In previous projects I had to make an nCloth curtain so I knew about the different types of constraints. Now that the cloth is recognising that there is something in the way I just needed it to stay at the top. I added a constraint to some of the vertices at the back of the robe around the collar at the top and constrained it to the emperor body. This was the effect it gave me.



This was almost exactly what we were after and trying to achieve. To get to this stage it has taken me many hours to figure out and experiment and the next thing I needed to work out was to how to get the cloth to move when the body moves. I tried moving the arm but the cloth would not go with it. The cloth was still working but because the collision was not in the way, it fell to the emperor's side.



I've spent a long time trying to experiment with different constraints but none of the options will allow the cloth to move with the arm when repositioning the emperor. The closest I got was constraining the points of the cloth to the surface of the body but that still meant the cloth would not stay around the arm entirely, it would just stay near the arm which is no good.

After experimenting some more, I discovered that the nCloth would move with the arm but only if the arm's starting position was in the same position that the nCloth was created. If you moved the arm during the animation then it would move with the arm but if you position the arm first then the nCloth does not follow it.



This does make it slightly difficult because it means that the first pose has to always be the same for the nCloth to follow. We do not necessarily have to show the model moving into the first key position because that can be cut out later on but it would still have to be rendered for the simulation to work and the nCloth to follow properly.

As a group we still have a lot of work to do and trying to work out the nCloth has taken up much of it. Another consideration is the render times. Using nCloth will increase the render time of each shot massively. James came up with another method which was to use the wrap deformer to get the sleeves to follow the model. It works and does not effect the render times like nCoth does but it does have some problems. The main problem with it is that when the wrist rotates or bends, the sleeve rotates and bends with it, it does not stay pointing down like gravity would effect the sleeve.


It is not ideal but using the wrap deformer may be the only way we can animate the emperor's robe without wasting render time. If possible we will use the nCloth as it will react to the wind and behave as desired. 



Thursday, 5 April 2012

Problems with Cat rig

I have been looking more at the cat rig that James Waters originally rigged. Now that we are starting to do some animating with it there are some small bugs that are beginning to become a small problem.

This first video shows the problems with the rig. The ankle bends unnaturally so that the can cannot straighten it's foot. It always has a constant bend as the ankle joint is too high. The second problem which is shown in the video is that when the bottom is moved (like a sitting action), the underneath folds unnaturally and causes  creases.



To resolve the ankle joint issue I had to remove the bound skin, remove the IK handles from the foot and move the joint to a better position. There seemed to be an extra, unnecessary joint in the middle of the forearm so I also removed that so it gave the cat a more natural skeleton. I had to re-add the IK handle once the joints were moved into place and parent it to the controller again. Before re-skinning the cat, I made sure the movement was looking better. I also repeated these actions on the other front leg. Finally, I re-skinned the cat.

I did not want to have to repaint all the weights for most of the cat so before unbinding the skin before moving the joint, I exported the weights of the cat. When it came to re-skinning, I imported the painted weights onto the cat and then only had to adjust the front legs.

Whilst repainting the weights for the front legs, I looked at the weights for the bottom joint to smooth out the creases. It took quite some time to sort out the creases because in the end, I removed all the influences from the vertices around that area and then re-added them by slowly building up the weight and constantly switching between joints to make sure the influences were then correct.

This second video shows how the rig responds now. The ankles have a more natural bend and creasing no longer occurs on the underneath of the cat.

Wednesday, 4 April 2012

Texturing the Emperor

We are about to finish the emperor model, James Waters is just finishing the rig but before we paint the weights I need to texture him. The main colour that he has is on his robe and his hat. As it is oriental, the obvious main colours to use for his robe would be yellow, green and red. For his skin, I have tested a few flesh tones but it looks more natural he is a tanned colour. It also compliments the grey of his hair more. He does not have much hair but he has quite thick eyebrows and a large beard and moustache which are going to be a mid grey colour.

At the moment nothing in the scene is yellow so it would make him stand out more. If it was a golden yellow colour it would also make him look more royal and important. He is going to spend all of his time in the pavilion so this would contrast against the red which could work really well. This is what he looks like in yellow.


The next colour test was red. The red I used was the same red that I used for the pavilion because if I used a slightly different red it would have been obvious and looked like bad colour matching. I think the red would make him stand out against the environment but not against the pavilion which could be a problem in shots where he is far away as he would just merge into the pavilion. This is what he looks like in red.


The final colour is green. There is a lot of green in our scene because of the environment. It is a darker green so makes him look quite rich and does help to make him stand out from the background. He could easily get lost in the background and in one of the shots where the background moves behind him, it could look confusing. Here is what he looks like in green.


I have put all of these to the group to see which they prefer but personally I prefer the yellow as it stands out more and would not get lost in the scene. I think the group agree with me too so yellow is the most likely colour to get chosen.


Tuesday, 3 April 2012

VRay lines and the river

I have been working on a shot which is where the emperor says "you must cross the widest point of the river".

It is quite a simple shot because it is just a camera establishing the river so it goes from one bank to the other.

It did not take me long to create the camera and animate it. I did run into some rendering problems. Each frame takes about 5 minutes to render because of all the items and lights, textures etc in the scene. It has been a very slow process because I had to render the scene wife. Once in VRay for most of the scene and then mental ray for the river.

I had to composite them in After Effects and this was the outcome.



In the shot you can see a few problems. First of all you can see the edge of the scene. At the point where the camera crosses the river, there is no environment past the last mountain. Secondly, the VRay lines around the river do not match up in some places with the river itself. Thirdly, the camera is looking down too much so all you can see is the river and is not very interesting.

There are way to resolve two out of the three problems. The problem with the environment can be sorted by painting the rest of the environment in. There is a globe that covers the whole environment and it has the sky texture on. If one of the artists in the group (Sarah Strickland or Lily Blacknell) could paint some more environment, even if it was just a bend in the river, so it looks like the environment carries on for a while rather than stops dead. We could say there is a waterfall or drop there but the water would have to go in the other direction and there are usually rock at the top of waterfalls which would have to be modelled and placed in the scene. This would have to be discussed and then could be added to the sky texture onto the globe.

The problem with the camera can be easily sorted. I have made it so the trees and pavilion are visible for longer but so you can still see the water. This also allows the audience to see where the animals have to finish the race. It makes the shot a little more interesting for the viewer.



The last problem is the hardest to solve. The VRay lines do not exactly match to the river. The problem is, I cannot move the river layer around very much because it aligns with the stairs and edges of the banks. Even if I was able to move the layer around more, where some VRay lines do match, others do not.

After some research on the internet and autodesk and VRay help sections, I have found the reason for this. When I render the environment in VRay, it does not render the actual river itself but it creates a line around the plane which the ocean shader is assigned too. This would be fine and align perfectly except that the ocean shader, when rendered is not just a plane. The ocean shader has ripple and ebbs on the banks and against the sides so it is never just flat like a plane. Also, because the ocean shader interacts to settings like turbulence and objects, you could never render a black outline around it because it means the line would have to move as the waves move up and down.

The river and VRay lines will never match up completely but it is only a small difference and it could add character to the piece. It makes it a little bit more interesting for the audience.

Monday, 2 April 2012

Shot 3 - They ate together

Fot his shot I had to model some extra objects which were an apple and a dead fish. Originally, the apple was going to be some cheese but then I thought about where the cheese would have come from in our scene. An apple could easily fall from one of the trees and could also be used in our "they played together" shot.

The objects are quite basic but here are what they look like:



The animals do not have mouths so I had to animate them so it looked like they were eating without opening their mouths. I did this by just adding the movement to their heads. For secondary animation, I added a swing to the cat's tail. The rat's tail is static because he was on his hind legs so his tail was on the ground which would not move a great amount. The cat's tail was up in the air because she was bending down to eat. I thought it would look unnatural if her tail was staid too. 

This shot is not crucial to the storyline and is sort of a flashback to what they do together, so we decided to show it is different, to add some curvy animated lines around the action. When this was layered over the shot, this was my first attempt.



I did not realise how slow the movement of them eating was until I had put the scene together. I realised that I should have used play blasts within Maya to help with the timing. With this noticed, I went back to Maya to speed up the movement of their eating. 



The play blast goes on for longer than the shot but this will be edited afterwards. The movement of eating has better timing and works well with the speed of the tail swinging. When I was happy with this, I put this into the final edit of the shot.



The background of this shot was just a still image of a small area of our environment scene. The animation was rendered as .png so it would not have a background and was easily layered over the image in After Effects. The swills were created in Photoshop and then layered over and animated within After Effects so they moved as well. The music and narration still has to be added to this shot.


Sunday, 1 April 2012

Lighting

I have been working on the shot where the emperor says "You must cross the river at it's widest point".

The camera pans across the river and both sides of the environment are shown. In the scene there was basic lighting set up so that the sky would be illuminated and also the environment. This is how the scene looks with basic lighting:


The environment in the foreground does look quite dark and the texture looks like there are lots of shadows. I did not anticipate that when the camera is facing the other side, the lighting is a lot darker.


Not only is it a lot darker but you can see the light cutting across the sky making an obvious shadow. I soon realised that I would have to re-light the whole scene. It also meant that any scenes we had rendered earlier had to be re-rendered for the lighting to match. It seems obvious to me now that we should have checked the scene's lighting before we had begun creating shots but at the time I just didn't think about it and presumed because it was fine on one side, it would be fine on the other side too. 

The first thing I tried to do in order to fix the lighting was to create another light but have it pointing to wards the other side of the scene. To do this I just mirrored the existing light. I kept the light that was illuminating the sky because it had no effect on the mesh of the environment, it only shone of the sky. 

The results of the mirroring were disastrous.


The lighting was better on this side now but the sky had completely whited out so you could not see it at all. I can still see the shadow of one of the lights in the top left corner, where only one reaches. I changed the settings of the lights so that the intensity was halved for each of them. 


This looked better but there were still some dark areas, like on the stairs, which I knew we would need to be lit properly for scenes later on in the film. The lights still cast shadows which were visible in the sky but as long as the camera did not go any further round than in the image above, then they would not be visible. 

I was not happy with this lighting still because a lot of the scenes would have to be cleverly positioned to cover some mistakes with the lighting and that was something I did not want to worry about. 

Last year, I created a tutorial about HDRI lighting so picked up some tips and tricks about surface shaders and reflected and refracted light. I used these techniques to try a different method of lighting the scene. 

I turned the globe with the sky texture that surrounded the environment into a surface shader and allowed reflections off of it. This would help bounce the light around the scene but keep the texture of the sky visible. I deleted some of the extra lights that were now not needed so that it would stop the scene from whiting out.  The last thing to do was change the render settings in VRay and the indirect illumination tab, I turned all the top three options on which were reflective caustics and refractive caustics. I rendered out the scene:



It had made the scene a lot brighter and the colours appear more vibrant. The scene if anything was a little bit too bright but in most of the scenes the camera is close up to a character and the lighting looks perfect. It also means there are no dark areas to shy away from from so no one will need to worry about hiding unwanted shadows.