UDK Notes - Characters And Skeletal Meshes
http://udn.epicgames.com/Three/ContentHome.html http://udn.epicgames.com/Three/FBXPipeline.html http://udn.epicgames.com/Three/FBXSkeletalMeshPipeline.html Make a folder in content: yourname__skelmesh_box__udk src_udk skelmesh_box__maya (this is a maya project) Model a box, all one object, at a reasonable size (combine if not all one object) Move the pivot point to the origin Freeze transforms Delete History Go to animation mode (upper left of maya ui) Skeleton > Joint Tool hold x (snap to grid) zoom into the origin click once to make a joint push enter Name the joint: b_Root Change the bone radius to 10 (optional) In the side view, draw a lid bone name it b_Lid name the top b_LidTip select none select b_Lid shift select b_Root push p for parent select none select b_LidTip shift select b_Lid shift select b_Root Skeleton > Set Preferred Angle select none shift select box shift select b_Lid shift select b_Root Skin > Bind Skin > Smooth Bind Options Bind To: Selected Joints Max Influences: 2 (2 or 3 are usually recommended) Click Bind Skin Note: In game engine, every extra joint adds complexitity/cpu cost. Every influence per vertex add complexity as well. Have verts affected by as few bones as possible. select none select the box Skin > Edit Smooth Skin > Paint Skin Weights Notes about the tool: RMB over bone, use select influence painting only some verts go to select mode, select verts go back to paint mode to only affect those verts q for select face mode select only the lid (double click the lid) push ctrl-f9 (or use ctrl RMB to...) select bones export selection call it: box__opening__anim Creating A Skeletal Mesh For UDK (this will be an item container box, but the same process works for entire characters) Make a container of three boxes with extrudes, and default xforms Put a different looking blinn on each box Group the boxes, select all of them, hit control+g Name the group box__skelmesh Name the materials and shading groups bottom_box_mat_skin00 bottom_box_sg_skin00 top_box_mat_skin01 top_box_sg_skin01 side_box_mat_skin02 side_box_sg_skin02 Make a lid bone and a base bone (two clicks each) Name them, and the tips (you don't always have to name the tips, but it makes this example clearer) b_Lid b_LidTip b_Base b_BaseTip Duplicate base and call it b_All Go to top view draw skeleton tool hold down x for grid snap click far away from all other bones and drag to origin otherwise the bone will get connect to others You can change the radius if you like call the new bone b_Root Parent b_All to b_Root b_Root b_All b_Lid b_LidTip b_Base b_BaseTip If you want to, you can make additional mesh objects, such as elastic bands holding the lid down. Make sure mesh objects have pivot points at origin Make sure parent group is at origin and has pivot at origin Freeze Transforms on the group (just to be sure) (will do children) Delete the history on the group (will do children) Bind the skeleton to the meshes You can do it one mesh object at a time if you want to be careful. Edit > Reset Settings Change "joint hierarchy" to "selected joints" Most of the time you should turn off remove ununsed influences (you can do it yourself later) Paint bones weights for meshes To Export Select the mesh group Shift select the root bone Edit > Select Hierarchy this selects everything individually they'll go yellow in the hypershade File > Export Selection Options Chose "FBX Export" for the type of export Click export In the options on the right, turn on "Animation" save it in your src_udk as box__skelmesh save the maya scene save as, and save it as box__opening__anim.ma Animate box opening from 1 to 24 ensure your timeline goes to 25, UDK will not get the last frame save the maya file again export again as box__opening__anim.fbx In UDK: Import, choose the FBX you just expored box__skelmesh Enter the package name joecc__skelmesh_box__udk Turn off "import animation" After bringing in the model RMB > New Animset box__animset (use the same/correct package again) name it: box__animset In the anim set editor use file > import fbx animation choose your file box__opening__anim.fbx Animation Compression > Animation Compression Settings Least Destructive Apply to set About to compress (choose yes) This make UDK capable of playing the animation efficiently in game. Add Skeletal Mesh To Scene Add Trigger To Scene Select Trigger Open Kismet RMB > New Event Using Trigger > Used RMB > New Matinee Connect Trigger's "Used" to Matinee's "Play" Select the skeletal mesh (in your scene) Double click on the matinee RMB In the dark grey area on left New Skeletal Mesh Group Name it "Open" (name doesn't matter much) Click on the open track at the top in the properties find "group anim sets" and push the plus button with the animset selected in the content browser, push the little green arrow to attach the animation set to the matinee track. Click the "anim" track push enter on the keyboard choose the track you want and push ok (there's only one track right now) Anything that triggers the matinee's "play" input will cause the animation to start Remember that you might want to turn Max Trigger Count to zero (in the kismet trigger event properties) zero means no limit how many times to trigger