How to rig a car for animation along a motion path Organizing the Hypergraph for Animation 1) Select all the pieces of the front driver’s side tire and Ctrl+g to group them. Name it FDS_geo_grp. Center the pivot of this group. -repeat this for the other tires and name them: BDS_geo_grp FPS_geo_grp BPS_geo_grp 2) Select the FDS_geo_grp and Ctrl+g to group it to itself. Name this new group FDS_Spin_grp. Center the pivot on this group. 3) Then select the FDS_Spin_grp and Ctrl+g to group it to itself. Center the pivot on this group. Name this new group FDS_Steer_grp. 4) Repeat for the FPS_geo_grp. 5) Select the BDS_geo_grp and Ctrl+g to group it to itself. Name this new group BDS_Spin_grp. 6) Repeat for the BPS_geo_grp. 7) Select all the pieces of the car (except the tires) and Ctrl+g to group them. Name this group car_body_grp. Center Pivot on the group. 8) Group the FDS_Steer_grp and the FPS_Steer_grp together and name it Front_tires_grp. Center the pivot of the group. 9) Now group the BDS_Spin_grp and the BPS_Spin_grp together and name it Back_tires_grp. Center the pivot of the group. 10) select the car_body_grp, the Back_tires_grp, and the Front_tires_grp and Ctrl+g to group them. Name this group Main_car_geo_grp. Creating controls that will be used for the car body rotation, the car steering, and the wheels' axel rotation (Use the rig101wireControllers script to create controls more quickly) 1) Copy the rig101wireControllers script into your maya scripts folder (C:\Documents and Settings\username\My Documents\maya\scripts) 2) In Maya, open up the script editor © Copyright 2009 BU CDIA 1 3) In the script editor, go to File → Load Script. Browse for the rig101wireControllers script and Open 4) Click the Play button to execute the script (or you can press Ctrl+Enter). This will load the script into Maya. 5) In the MEL script command line, type rig101wireControllers; 6) Highlight this text and MMB drag it onto your shelf and save it as a MEL. When you click on it, a control box will open. These are pre-made controls for your use. 7) Create a control for the car's body rotation. A good one is the “Arrows on ball” from the Special tab in rig101wireControllers. Move and scale this control to above the car and name it Car_Rot_ctrl. Once you have it placed, center pivot (CP) and freeze transformations (FT) © Copyright 2009 BU CDIA 2 8) Go to Window → General Editors → Connection Editor. Load the Car_Rot_ctrl on the left and the car_body_grp on the right. Connect the rotate x to the rotate x, and the rotate z to the rotate z. NOTE: your axis of rotation may differ depending on the car's axis of creation and your rotate tool settings. Select the appropriate attributes for your model 8) Now the Car_Rot_ctrl will rotate the car body. You can also put limit information on the control so that you do not over rotate the car body. Select the Car_Rot_ctrl and click Ctrl+A to get to the Attribute Editor © Copyright 2009 BU CDIA 3 9) Click on the tab called Car_Rot_ctrl and the attribute “Limit Information.” You will see a box that says “Rotate” 10) Check the box in the Rot Limit X and Rot Limit Z for Min and Max and set those values. If you rotate the control, you will see the current rotation value, and use that to determine your min and max. © Copyright 2009 BU CDIA 4 11) Since you are only using the rotate x and z on this control, you can lock and hide the rest of the attributes. In the channel box, select all the attributes except the ones used for the control, then right click and hold, and go to Lock and Hide Selected. 12) Create a control for the front wheels' axel rotation. A good one to use in rig101wireControllers is the 180 Arc in the Flat Shapes tab 13) Move, scale, and rotate this control and place it in front of the front of the tires and a little off the ground. Then name this control Front_Axel_ctrl. CP and FT © Copyright 2009 BU CDIA 5 14) In the Connection Editor, load the Front_Axel_ctrl on the left and the Front_Tires_grp on the right. Connect the rotate z to the rotate z (or the appropriate axis for your model) 15) You can now give this control limit information in the same way you did for the Car_Rot_ctrl. You can also lock and hide all attributes except for the one you need. © Copyright 2009 BU CDIA 6 16) Repeat steps 12-15 and make a control for back tires called Back_Axel_ctrl 17) Now create a control for the steering. A good one to use in the rig101wireControllers is the 180 Thin/Normal/Fat from the Rotational Arrows tab. Move, scale, and rotate this control and place it in front of the car. Name this control Car_Steer_ctrl. CP and FT © Copyright 2009 BU CDIA 7 18) We can put set driven keys on this control for the steering. In your Animation menu set, go to Animate → Set Driven Key → Set. 19) Select the Car_Steer_ctrl and click Load Driver. Then both the FDS_Steer_grp and the FPS_Steer_grp in your hypergraph, and click Load Driven 20) In the Set Driven Key window, click the Car_Steer_ctrl, then Rotate Y and make sure the Rotate Y is at 0. Then click the FDS_Steer_grp and the FPS_Steer_grp, then Rotate Y and make sure the Rotate Ys are at 0. Then click Key. © Copyright 2009 BU CDIA 8 21) Next, click the Car_Steer_ctrl, then Rotate Y, and rotate the control some degree in the Y (for © Copyright 2009 BU CDIA 9 example, 30). Then click the FDS_Steer_grp and the FPS_Steer_grp, then Rotate Y and change the rotate to the maximum value for how much you want the wheels to turn (for example, 50). Then click Key. © Copyright 2009 BU CDIA 10 22) Repeat step 21 for the opposite direction. Now the Car_Steer_ctrl will control the wheel steering. You can also set your limit information for the control using the max and min you set in the set driven key. In this case, the min and max for the Rot Y Limit is -30 and 30. © Copyright 2009 BU CDIA 11 NOTE: This process is very similar to using the connection editor. The advantage to a set driven key is © Copyright 2009 BU CDIA 12 that you are not limited to a 1 to 1 connection like in the connection editor. 23) Now we need a main car control. Go to Create → NURBS Primitives → Circle 24) Move and scale this control around the base of the car model. You can reshape it too with the control vertices. Name this control Main_car_ctrl. Delete History, CP and FT © Copyright 2009 BU CDIA 13 25) Now you want to place the pivot point of the Main_car_ctrl from where the car would pivot from when turning- generally between the back 2 tires. Select the control and click Insert and move the pivot point to where you want it. Click Insert again to set it © Copyright 2009 BU CDIA 14 26) select the Main_car_geo_grp, then the Main_Car_ctrl and click “p” to parent. Now the car will move with the main control 27) Now select the Car_Rot_ctrl, the Car_Steer_ctrl, the Front_Axel_ctrl and the Back Axel_ctrl, then the Main_Car_ctrl, and click “p” to parent. Now the rest of the controls will move with the Main_Car_ctrl. Adding a Drift attribute 1) Select the Main_Car_ctrl, and in the channel box go to Edit → Add Attribute 2) In the Long name type Drift. Put -10 for the Minimum, 10 for the Maximum, and 0 for the Default Then click OK © Copyright 2009 BU CDIA 15 3) Select the Main_car_geo_grp and set the pivot point on the ground towards the front of the car (or where you want it to drift from). Click Insert to move the pivot then Insert again once it is in place 4) Use set driven keys to set up this attribute. In your animation menu set, go to Animate → Set Driven Key → Set © Copyright 2009 BU CDIA 16 5) Select the Main_car_ctrl and Load Driver, then select the Main_car_geo_grp and Load Driven. 6) When the Main_car_ctrl Drift is at 0, the Main_car_geo_grp Rotate Y is at 0. 7) When the Main_car_ctrl Drift is at -10, set the Main_car_geo_grp Rotate Y to the maximum you want the car to drift in one direction. 8) When the Main_car_ctrl Drift is at 10, set the Main_car_geo_grp Rotate Y to the maximum you want the car to drift in the opposite direction. Now you have the ability to keyframe the drift of the car in animation. © Copyright 2009 BU CDIA 17
© Copyright 2024