Archive for ‘General’

February 6, 2012

Maya-Mudbox-Maya

When making my blendshapes I prefer working with Mudbox rather than ZBrush. The only reason is the ease of integration with Maya.
As Maya and Mudbox both are from Autodesk, and both have their free educational versions available to download and use, I just ended up working with Mudbox. I am sure a similar workflow can be established to work with ZBrush as well.

In this tutorial, I will be discussing:
– the most simplest workflow I know of between Maya and Mudbox
– basic tolls you will need to know in Mudbox to do your blendshapes.
– how to get mirrored shapes without using any fancy tools/scripts

1) Open maya scene file and duplicate the base head geometry. You will be making all your blendshapes to this duplicated head. Hide your original model by adding it into a layer if you want.
2) Make another duplicate of this head and name it mudboxHead. We will use this head to make all our blendshapes. I do this because, for whatever godOnlyKnows reason, if the workflow between mudbox and maya gets screwed up, I do not want it to affect my target head.
Remember! 3 heads are better than 1
Duplicating Heads

3) select the mudbox head and navigate in Maya to File-> send to Mudbox -> send as new scene. (I assume that you have mudbox installed)
4) When the file opens in mudbox, you will see it centered in the screen. Hit A on keyboard to frame it.
5) If you have not used mudbox before, fear not. It is a blend of Maya and Photoshop and really easy to pick up. To your right, you will see layers. We are going to use these layers to do all our shapes. I wont go into the details of mudbox basics. You can get that from other tutorials online. I will assume you have a decent knowledge of the interface of mudbox.
6) to your right, you will see the face as a base layer. Lets create a new layer and call it BrowNearDown. thats the shape we are going to create.

Creating the shape itself:
1) I use the freeze tool to freeze areas I know are not going to be affected by the shape. I like this tool as it gives me a clear visual representation of whats being affected and whats not. I can also get a gradient of the affect by freezing the area partially. So, as the first step, lets select the Freeze tool and from brush settings, choose Flood to freeze the entire face. And then lets hold down CTRL button or from brush settings choose InvertFunction and then paint out the area that we want to influence.
Select only required areas

2) Now create a later. We will use this layer to build our shape. Note that it is very important to first work on the lowest level of detail. You do not want to work on a high poly mesh right now.
3) Select the Grab tool. The grab tool effectively moves geometry around. It does not add/remove more volume. As such this is the perfect tool for making blendshapes. I tend to keep the brush size fairly large. The face is frozen to make sure only selected areas are affected. Also, we usually want to see a falloff while moving the face shapes. This falloff is built in when we made few areas of the face editable using the freeze tool. So, we can go really big with the brush size knowing that there will be a good falloff.
4) In the brush settings, select mirror by localXaxis (or localY/Z so that other side of the face is also affected). Now sculpt the basic brow down shape. notice that both sides of the face are being affected equally. We are effectively doing our Mirrored Blendshape too.
5) Just try and block out the shape. Do not get into too much detail at this point. Also keep sliding the opacity of the layer from 0 to 100 to see how the shape would work. You will be able to see the crunching of the lines/edge loops better this way.
blocking of the shape
6) You will notice it doesn’t look right. This is because, I have sculpted just the brow down shape now. In reality, we can never move our eyebrow ends just down. When we do it, the eyebrows also come forward and come nearer. So, we will end up doing all three blendshapes separately. None of them will look right by themselves. But when combined together will produce the perfect shape.

7) I always feel this stage of getting a shapes is probably more closer to a realistic character. Get it to shape how your eyebrows move. Now its time to create a new layer and increase the poly subdivision by 2 levels and start sculpting to exaggerate the expression. In the second layer we just created, just experiment with how much more you can push the shape. Do not go into finer details. Once satisfied, hit PageDwn twice to go back to subdivion 0 to see the changes.
exxagerate expression in Higher subDivision

notice that the change is not too great. But definitely more pronounced than earlier. Depending on the style of animation, this expression could be pushed even further.

8) time to make another layer and make the finer details. What happens when the eyebrow goes down… does it create a crease just above the eyelid? could you create some wrinkles? Depending on the amount of detail you need to add, you can bump up the subdivision and sculpt accordingly. In this stage, we are no ,longer looking to move geometry around. Instead we are looking to sculpt. i.e. add extra fat under the eyelids, or carve out some creases, etc. Its a good idea to switch to the sculpt brush now and periodically smooth your work by holding down SHIFT and using the same brush to see what you are doing.
My model is not very high poly and I dont plan on adding the wrinkles in the geometry. But, I can definitely add the wrinkles as a displacement map. I will do this if I think I need it in my film. For now, I will stop here and move onto the next shape.

Change of shape:
The shape I am ultimately trying to get to is the brow scrunch down/squeeze. As I said, we need 3 shapes to add up to do this. We have just built the first of these shapes. We will now build the second, brow forward.
1) Make a new layer in the same scene file. As discussed in the sculpting steps above, sculpt out the brow fwd shape, while still keeping the visibility of the brow down shape ON.
Adding more shapes

2) I will make another layer for the brow Squeeze shape and do the exact same steps.
Adding more shapes
notice how to get the brows to squeeze together I selected my freeze brush and painted the center line of the brow flowing into the nose, That way, I preserved its position and using the grab tool moved one side of the brow closer to get the squeeze. I also added some details in a higher poly layer.

Extracting the shapes:
If you are still reading this, then you are pretty serious about learning this stuff 🙂
so lets move on. We have all the perfect eyebrow squeeze shape by the addition of the 3 shapes. Now to get them all into maya as separate shapes.
There are two ways to do this.

1)in mudbox, just hide the visibility of the browSqueeze and browFwd layers. We now only have the browDown shape.
method1: With the shape selected, navigate in mudbox File-> send to maya -> add to selected scene. This will add this shape as anew shape into maya.
method2: at the bottom right corner in mudbox, you will see a status message… “connected to maya.. update”. Click on the update button. This obviously requires that your Maya is still open. The mudbox head we had created initially will now take the shape of browDown. You can duplicate this head and rename it as the shape.

2) switch OFF all layer visibilities and switch ON only the browFWD layers. now send it to maya following either of the 2 techniques.

3) do the same for the other shape.

So, in very simple steps, we have isolated the shapes and sent them to maya. We still need to separate these out as Left and Right shapes.

NOTE:
it is good to make additional shapes here. Like if you want the squeeze shape with a greater emphasis to be used in a very powerful scene, then make that as a separate shape. You can always add that shape ON when needed.

more additive shapes

Once we have all the shapes in Maya, your scene file should look similar to this:
updated Maya scene file

Select all the new shapes created in mudbox, then the mudboxhead and create a blendshape. Test to see if all the shapes are working as needed. Its a good idea to test this in smooth mode. You will see problems with the shapes easily and mostly might have to go back and forth between mudbox and maya a little bit to get it right. If you do feel like a particular shape needs to be toned down, adjusting the layers opacity in mudbox will not work. This is because, when you send the model ot maya, it is sent with full opacity. So, you will have to sculpt down the layer manually. Thankfully, this is very easy to do. Select your erase tool in maya. and start painting. It basically erases the change you have done on that layer on parts that you are painting. To partially erase away, use the freeze brush first and paint with a faint opacity. That way you can get the erase brush to work in gradients.
Mine looks something like this when all this is done.
blendahpedFace

Separating into Left and Right shapes:
Its time to separate them out without using any scripts/tools.

Select the mudbox head that has the blendshapes on it. Select the Paint blendshapes weight tool. This tool basically allows you to select regions of the geometry that are being affected by the blendshape. We are just going to select one side of the face and say, Do not affect by any blendshape. then save all the resulting shapes as Left… do the same for the other side and save it as Right.

In more detail:
1)Select the mudboxHead and then go to paintblendShapeWeihts tool. If you did that right, your model will turn white. In the tool settings, you will see the name of the blendshape node and the blendshapes listed. Select the node. and in Value of brush, set to ZERO, and opacity to 100, click on Flood. the face turns black and will look like the default shape. No matter what you do with the slider, its not going to change shape.
flood Zero/Black

2) hit W or go into a component mode. In front view, select verts from only one side of the face. Do not select also the center line. Go back to PaintBlendShapeWeights tool. now change value to 1 and Flood again.

OneSide Shape Created

3) Test it out.

oneSideBlendshape

Thats it! Follow the exact same steps to get the other side. Very simple and uncomplicated technique. You could also do the other side with a script.

So, its good to know both the techniques. I prefer using the script to get the other side. just because I can take a break and let the computer do all the work. I can email you the script I wrote to get the blendshapes mirrored. Its in beta stage. It works perfectly, but I have not developed a GUI for it yet. You just need to select all shapes you need to mirror, then the base shape and run the script. Come back in about 15 minutes(depending on number of shapes to mirror) and all your 40 odd shapes will be mirrored with an offset and renamed accordingly.

Have fun. Let me know if you find any better techniques to do all this. Knowledge is more fun when shared.

January 31, 2012

Transferring Animation Keys

If you are an animator, you must have been in this position yourself. I have a scene that i animated a long time, but later on made a major change in the rig, and the new rig no longer could work with this animation. Before we go into the details of how I transferred all the animation keys to the new rig, let me tell you the change I did to the rig.

Things we will be discussing in this blog;
1) how to make a character hold an object and still be able to move the hand and object.
2) how to transfer animation keys quickly between 2 objects
3) discussing a few scripts to do the copying of keys for us.

Description of the problem:
Previous Rig :
I had a IK control for the arms. Now, in this particular scene I had to constrain the hand to a few objects. I animated it the bad way by constraining that Ik control to many objects and switching the weights. But I realised soon, I needed a work around as I was no longer able to move the hand or the object

With a little help from my peers and the internet, I decided to add a locator to the hand constraint. How does this help?
We need to understand the way an object is affected by constraints in world space and local space for this.

take an example:
1) create object A
2) create object B
3) constrain A to B.

Result: when B is moved, A follows. We cna key location of B and A will follow automatically.
Drawback?
The object A cannot be moved independent of B. no matter where you move object A in world space, it will always snap back to B
Explanation:
The constraint was created between Obj A and B in the world space. In this case, the world space and object space are the same for both objects. This means, while in world space A follows B, we do not have the ability to move A or B around in their local space.
So, we need to create local space for these 2 objects. We do this by grouping each object in a separate group.

Steps to follow:
1) create object A in world space.
2) CTRL+G will create a group and put this A inside that group. So, now we have GrpA in world space, and the objectA itself is in a local space within the GrpA
3) create object B.
4) out it in a group GrpB.
5) parent constraint GrpA to GrpB

So, now we have the GrpA following GrpB. We would key the location of GrpB which would move the GrpA in world space. But inside these groups, both our objects are free to be keyed and moved/rotated/scaled.
TIP: make sure the pivot points of the object and the grp are the same.

Using this same logic, I added a locator for the Hand IK and constrained the hand Ik to the locator. Then, Added an offset control for the prop inside the master control. now, I parent the Locator to the Master Ctrl of prop. I can now move the Hand Ik and the offsetCtrl of prop to get the desired animation.

That explains our first question for this blog.

Next:

2) how to transfer animation keys quickly between 2 objects

1) We need the two objects to be in the same scene.
2) open the scene that already has the animation.
3) reference in the rig that needs the keys to be copied over.
4) manually select each control from already animated rig, double-click the time line, right-click COPY. Select corresponding control on new rig and double-click timeline and right-click PASTE.
5) do this for every control

3) Discussing a few scripts to do the copying of keys for us.

Step 4 from above can be scripted. Maybe step 5 can be too. But I dint bother doing that. I was OK with selecting all the controls individually.

What the mcvCopyKey_v001.mel Script does:
1) You select 2 objects. First being the object with keys. Second the object that needs these keys pasted onto.
2) Run the script from shelf/by sourcing it.
DONE!!!

the script is super simple to use. It is scripted to do just this and is not very intelligent. If you select the left hand of source and accidentally select the head control of the destination, and run the script, there is a very good chance you will behead your character. This script is Fast and Dirty. So, use it with caution.
Suggestions to improve the script are always welcome. I will implement them later on. and will email you when a new version is available.

Hmm… WordPress does not allow me to upload non media files. So I am not going to be putting up my script files here. But, if you are interested in seeing them, then email me and I can send them to you.

Now in my case, since I had done a major change in the hand rig, even after copying the keys, the hand positions were off. So, A neat trick to get around this problem.
1) select original hand, select new hand control.
2) point constraint and orient constraint with offsets off.

now the new hand follows the old one exactly.
3) select both these controls so you can see the keys of the old hand in the time slider.
4) start hitting S for set key and the > button to go to next keyframe. By doing this we are keying both the old and the new hand. The old one already has the keys and will make no change to it. The new one is getting the exact translate and rotate information, thanks to our constraints and we are keying them.
5) delete the constraints. The keys will still have the values.
6) remove old reference/delete it.

simple. And with the scripts, it makes the task very very easy.

June 21, 2011

iPhone3GS has a new owner

From the day I landed in the US a couple of years ago, there has been a constant craze for iPhone with many people. to me the iPhone was just another phone and it was unusual for me to see so many people going crazy over a piece of gadget. I was not even impressed with the iPhone. Why? Let me take you back to India and explain how the cellular world works there.
Its heaven. The network service providers and the Cell phone providers are two separate worlds. There are no ‘buy a connection with us and stick to us for the next 2 years and keep the phone with you’ deals. Assuming you are in India and you are thinking of taking a mobile connection, you will first think of your needs.
1) Student – stay in same city as friends,
SMS – primary mode of communication
Network Coverage – not a big deal
in this class you would find atleast 3 service providers to choose from. One will have 1000 sms free per day, another will add some money as talktime to each sms you send, another will make texting and calling free within a group of friends.
I myself have taken a connection which let me talk to my girlfriend for 1paise a minute. That means, it works out to 1 rupee for around 1.5hrs of talking or 1 USD for 70hrs of talktime. BEAT THAT!!!

On top of that, I can recharge for any denomination I choose. As a student funds are limited. What if you have just 20 rupees? No problem. Recharge for 20 and you can pull along for atleast the next 10 days.

2) Corporate/Executive – probably wont be texting. Will be calling more
Would Like better roaming charges
Maybe a Dataplan
Again, the market is huge with each competitor trying to attract customers in their own way.

3) Hiker – Want to send SMS from top of Mt.Everst after scaling it?
Call for help when lost in the jungle or trapped between rocks for 127 hours

You got the service providers that aim for connectivity.

You get the idea. with such a competitive market, there is a plethora of service providers each with his own bag of treats. And these treats are extremely tasty.

So now that you have decided your service provider, you will now need a cell phone. Oh Boy! In my recent visit to India, I was shocked to see the number of models available. I am not kidding. I went into a store and said the following:
– price range = 3000 Rupees or 60 USD, Large keypads, Backlit keypads, No Touch, Good Voice Recording Feature, 1MP Camera, Preferably a sliding model, Large Color Screen, Basically a phone that my mom would be happy to use. In the next 10 minutes I had seen 13 different models, ALL meeting this criteria.

After looking around I realized that for every slab of 2000 rupees, there were atleast 30 different models I could choose from between 8 to 10 cell phone manufacturers, all in the same shop.

And the best part in all this is that I can choose the fanciest of phones with Internet capability just cos I like its looks and then take a student network connection and not pay for the data plan. Or, I could take the most basic phone cos I like big buttons and then choose a dataplan connection. The permutations and combinations are limitless.

And now I come to US and see a craze for this iPhone. its been 2 yrs with At&T and I am eligible for an upgrade. so why not go look at the iPhone and other models?

I walk into the AT&T store and see iPhone 3Gs, iPhone4 32GB and iPhone4 16GB standing proud in the center of the store. Somewhere close by are the other Android Smart phones. I counted 3 of them. I then look at the other basic models and see about 6 other models placed at farther corners of the store. It’s almost as if they want you to buy the iPhones. I walked up to the ATT rep and asked them for phones without dataplans as I am not interested in paying that extra 25$ a month. I see that the choice of basic phones that I have are so pathetic that I am forced to look for the Smart phones. I then see the cost on these phones. iPhone4 is way over the top for me. No way I am paying $200 for that. iPhone3GS is 50. All other smart phones are more expensive. So, if I am looking at the cheapest Smartphone it is the iPhone 3GS 8GB. if I am looking at the costliest smart phone, it is the iPhone 4G 32Gb. its iPhone all the way. The only reason I could see in buying an android phone was my hatred towards an iPhone. But then, my girlfriend and me bought her a HTC Aria for that same reason just a few months ago.
I walk up to the counter and ask the lady to show me the iPhone3GS. She picks one up saying how it is only $50 while I am thinking to myself this phone will actually cost me $650($50 for the phone and $25 for the dataplan for the next 24months when I don’t want it). I change my mind and choose the $20 Dataplan and thereby getting the cost down from $650 to $530. Even the dataplan is structured so that you end up taking the $25 plan. the $20 has a 200MB limit a month while the $25 has a 2GB limit.

I walkout of the store with an iPhone3GS in my hand and feeling miserable for having bought it. The only reason I bought it was I wanted a new phone. I should have bought one from India when I was there a week earlier. I was foolish to not have done so. So that’s how I am the not-so-proud-owner of an iPhone3GS. So, now that I do have it, I intend to explore it as much as I can and learn to put the phone to use to what it can be worth for. Not just play Angry birds on it.

December 21, 2010

7th Dec to 21st Dec

These days have just slipped by. I attended my brothers wedding. It was a blast. All the moving around and helping in the wedding meant I had to sleep two days to get back the energy to start dong anything. so I am still contemplating what I did from 17th to 21st. I had some other assignments to finish and I spent 3 days on them. What sis I do the other day???  Aaah…  I had to go with my family to a temple, and that took us the entire day. So, I am sitting looking at my timetable and wondering if I will ever finish this movie as planned.

PROBABLY NOT…

that calls for modification in the story. In my past experience I tried doing more than I could in the time limit I had and paid the price for it by not finishing my work on time. This time round, I dont want that to be the case. So, I am looking to see how I can change my story without still losing the essence of it. That will mean new storyboards(really rough ones…) and a new timeline. My sound designer is not going to be happy with this news… but hey… thats life…

Signing off…

December 10, 2010

India… what I see after a year

I have seen many friends and family return for holidays to India. I always wondered how they felt about India after these many years at another country. For the first time, I was able to experience the changes for myself this time. I document them with mixed feelings.

1) The first change I noticed was even before I reached India. It was in London, Heathrow. I was to take the Heathrow to Bangalore flight. Not surprisingly, the entire crowd was only Indians.  I was waiting with my brother near the gate to board my flight when the first announcement came through-“At this time we would request people with special needs or those traveling with young children to board.” As I sat there looking at the boarding pass in my hand waiting for my turn, I noticed that EVERY ONE stood up and went near the gate. I mean every single person. No one seemed to bother that they did not have any special needs nor did they have kids with them.

2)I started to think quick. I was remembering the times when I used to plan my entry into the local buses so that I could get that one empty seat in the bus that the 50 others were also vying for. I planned out the entire course of action in my mind like sherlock holmes does in the 2009 movie. (Use my right elbow to stop the guy with the red shirt. Use the bag on my back to block those behind me, the left elbow and hand needed to be free to hold onto something. The head was still free. i could use it to plow through the crowd incase the others got there before me). This memory caused a mental shift inside me and I knew I had to get up and stand in the queue myself. I did not have any special needs or children. But I had one of the last seats in the tail section of the flight. I knew the flight was traveling full capacity. If I let this mob pass through before me, I might not find enough place to store my luggage. I stood like the others in the ‘queue’ feeling guilty that behind me there really were some old people who might need the special attention.

3) The problems did not stop there. There was no queue at the gate. I could see atleast 4 different lines each trying to outrun the other… I could not understand why? Weren’t the seats already booked? It wasn’t like if you rushed in, you would get the business class seats. There were people ducking under the queue manager to break the lines. In front of me, there was a lady who was accompanied by her parents. As our wait time was going to be atleast 3-4 minutes, she ushered them to the business class line as that line was empty. They clearly had only the economy class tickets as they were standing in that line until now. her parents were reluctant to break the line by stepping over the barricades. she stepped forward, removed the barriaced, ushered her parents through that and followed them and went to the business class line.

4) that brings me to point 4. Usually there are multiple announcements at the gate. First for kids and special needs, then for elite class members and business class. Then for the first class, followed by economy seating starting from the rear end. But what struck me as odd was that, there was just this one announcement made at the start with no further announcements being made to ask the people to wait till their turns were called. If economy class people were being allowed to board from a business class line, it only shows that the staff at Heathrow must be used to this behaviour. They know that the crowd is just going to walk and announcements are futile.

This for me was the most disappointing fact. Especially, i had seen a few of these people in my flight from PHL to Heathrow. They were following all the rules, and were well behaved. So what caused them to change? Was it because there were Americans along with them and they wanted to look good and well behaved in front of them? Thats the only reason I can think of. This time they knew there were only Indians among them. So why bother looking good? Why bother being well behaved? It is said that if dogs are not mentored or tamed for 3 generations, then even the most well behaved purebred dogs can turn savage. With the Indians at Heathrow, this happened within a matter of hours.

Bangalore, is also pretty much the software capital of india. The people here are supposed to have more polished behaviour. But to see such a  conduct from grownups at Heathrow was very disspointing.

On the bright side, I was able to fit my luggage overhead. Just in time at that. The guy sitting next to me arrived 3 minutes after me and he had to keep his cabin bag by his leg for the next 9 hours. India… I still love my country. I am hoping I can change my opinion about the people by the time I leave.