Friday, 23 November 2012

so now i have a good amount of controls for my car i need a way to select my entire car through one click, this is done by adding a master controller that has priority above everything in the group hierarchy

this is a simple process first create a suitable controller that surrounds your entire car


I've moved the vertices a bit to fit around my car nicely but this is'nt necessarily a requirement it just looks nicer 

next up we're going back to constraints except this time we're using a point constraint unlike orient constraint it only affects one point to the other whereas orient affects axis moved



point constrain on all the axis the entire car including controllers to the nurb circle (group select in the outliner and make sure the controller is outside the hierarchy before constraining.



so now suspension as a whole is complete next up i think im going to do the doors so that i can open and close them again this is done through the use of expressions

so following similar guidelines before make the controller and place in the desired area ideally near the object you want to influence

then depending on how you've named you groups add the expression so that when you move your controller along one axis the object transforms on another axis in my case:

Lft_door_grp.rotateY = -Lft_door_ctrl.translateX*15

notice the "*15" at the end this is because i dont want the controller to go further then when my door rotation is complete (again fortifying this in the limit info editor from attribute editor

so now ideally your door should go from this...

to this....


and there you have it a moving door


so we have our wheels and our main suspension sorted but now its time to add our front and back suspension, the reason for the other types of suspension is for the different types of animation like i said before the previous main suspension is for rough roads or possibly sharp turns where as this part of the rig could be used to show acceleration or possibly hydraulics use (think snoop dog and his low riders ;)

so in order to make this type of suspension work for the front and the back this is going to need the use of expressions.

expressions are like scripts of code that make a cause and effect like manner on two individual objects i'll demonstrate this through showing the front suspension

so first of make a controller without a deformer (or with depends on how your doing your control layout) and this is where grouping each body part and naming them comes in handy because you'll be using specific parts of the car to operate in certain ways desired.

once the controller is made you go into the expressions editor (window>animation editor>expression editor)



so here we have the expression editor here you would select the object and its transformation value (also here is where the outliner and you will become very best friends) so right now i want to have my front suspension be affected by the use of my controller this is done through the following expresion

Frnt_Susp_grp.rotateX = -Frnt_Susp_Ctrl.translateY

so this expression is telling maya that when my front suspension controller moves along the Y axis the front of the car will rotate ever so slightly on the X axis 

Note: remember to move you pivot point on the body group so that maya knows where the pivot is to rotate

so the desired effect is that the car goes from this.....

to this...

the same is done to the back using a similar expression

Bck_susp_grp.rotateX = Bck_Susp_Ctrl.translateY


OK so next up is the suspension in my case I've made three different types of suspension; front, back and main suspension to start i'm gonna go through the main suspension seeing as the process is very similar to making the wheel rotation.


repeating the same process as earlier with the arrows except changing the curve so that it bend deformer goes down instead of a circle like so....



and again using an orient constraint except this time adding all axis to the constraint so that it affects all the axis (remember its the object to the controller not the other way round)

next up i need to limit the information of any transformations or rotations made (this also goes for the wheels previously)

to do so go into the attribute editor and scroll down to limit information this allows to in effect make it idiot proof (as my lecturer adequately puts it)


the idea here is to add restrictions on the controller as to how much you can move the controller so ideally you would want to move the controller (in effect moving its influence too) to the minimum amount of how much you want to move it check the box and then set its maximum to its opposite, in my case ive set the suspension to move as little as possible on all axis and then checked the box so that the value of the transformation will not go further then the value that's been locked in.


now that ive done that my body of my car will only rotate around all axis a slight amount in effect giving it body suspension that you would use if you were say animating the car going over a bumpy road.


Here is my blog to show my a 3D rig of my car (not actually my car but y'know)

Note: make sure that the different parts of the car need to be assigned to their own groups doors, individual wheels, windows, wing mirrors etc. whatever you want to animate put it in its own group!!!

First up wheels I need to add a controller to my wheels that will control the rotation of the wheel through the animation

so first I make an arrow using the EP curve tool, once the arrow was created i made a copy of it and parented one arrow to the other. once the arrows are parented they become one movable object

next up i added a deformer to the arrows to make them curl around each other indicating the direction of the wheel rotation, now that my controller is set up and ready to go i need to connect the controller so that the roatation of the controller influences the rotation of the wheel.

To do this I use and orient constraint and check the y and z axis this means that it can only rotate on the x axis (the wheel is constrained to the controller)

as a result here is the desired effect now to do this for all four wheels :)