{"id":127,"date":"2012-02-24T21:50:21","date_gmt":"2012-02-24T21:50:21","guid":{"rendered":"http:\/\/blog.daft-ideas.co.uk\/?p=127"},"modified":"2012-02-24T22:06:10","modified_gmt":"2012-02-24T22:06:10","slug":"making-of-clear-skies-3-animation-perspective-part-2","status":"publish","type":"post","link":"https:\/\/blog.daft-ideas.co.uk\/2012\/02\/24\/making-of-clear-skies-3-animation-perspective-part-2\/","title":{"rendered":"Making of Clear Skies 3: Animation Perspective Part 2."},"content":{"rendered":"

This post is going to quickly go over the two methods I used to actually get the animations into Source.<\/p>\n

Method 1: BVH<\/h2>\n

Ipisoft exports to the BVH format, which is one of the standard motion capture formats. It stands for Biovision\u00a0Hierarchy, and it was developed by Biovision, who went bust a while ago. This is the best format in my opinion, because it is very easy to read and parse.<\/p>\n

A BVH file has two parts:<\/p>\n

    \n
  1. the\u00a0hierarchy\u00a0itself, which describes the skeleton and initial pose.<\/li>\n
  2. The transformations that the skeleton goes through to animate it.<\/li>\n<\/ol>\n

    The\u00a0hierarchy\u00a0starts with the ROOT node, which for humans is usually the centre of gravity. The hierarchy\u00a0itself is recursive: each node contains data relevant to it (like position, rotation), and further subnodes.<\/p>\n

    The position of the node is defined by it’s offset from it’s parent, not an absolute position in the world. If it was absolute, it wouldn’t move when it’s parent moved. You’d move your arm, but your hand would remain on the desk.<\/p>\n

    The rotation of the node is defined as the rotation relative to it’s parent.<\/p>\n

    There exist a massive amount of tools for reading and manipulating this data, so I didn’t really need to write another one. It was a good job too – I was struggling with the XSI Mod tool.<\/p>\n

    XSI Softimage is the suite that Valve origianlly used for modelling & animating Half-Life 2. In 2004, when Half-Life 2 was released, XSI had a free, cut down version of the tool for Modders. It was called the XSI Mod Tool.<\/p>\n

    Valve also created a whole bunch of addons for it, to export stuff to the Source Engine.<\/p>\n

    Since Softimage got bought out by Autodesk, the free versions are less and less useful, the tools are out of date and features get locked off. You can find the old versions around, but it’s difficult and they are not supported much.<\/p>\n

    I’ll do a quick tutorial on it here anyway.<\/p>\n

    Autodesk Softimage Mod tool 7.5<\/h3>\n

    You’ll need to find the ValveSource addons for Softimage, which are either on the net, or in the Source SDK folder.<\/p>\n

    Open the XSI Scene file “SDK_Male_reference.scn” which can be found in “C:\\Program Files (x86)\\Steam\\steamapps\\USERNAME\\sourcesdk_content\\hl2\\modelsrc\\humans_sdk\\XSI_scn_files” or similiar.<\/p>\n

    You should get this chap:<\/p>\n

     <\/p>\n

    \"\"<\/a><\/p>\n

    He’s very low in IQ and poly count, but he’s lovable just the same, because he’s ideal for testing stuff out.<\/p>\n

    Press “8” on the keyboard to bring up the scene expolere, and middle click on the “Valve Biped” node.<\/p>\n

    \"\"<\/a><\/p>\n

    Middle clicking recursivley selects everything inside the node.<\/p>\n

    Go to Animate->MOTOR->Tag Rig<\/p>\n

    This will bring up the tag rig dialogue. It defaults to a human biped, and has \u00a0entries for all the major bones.<\/p>\n

    \"\"<\/a><\/p>\n

    You need to go through each diagloue, click the bone name button, eg “cog”, and select the corresponding bone on the human skeleton.<\/p>\n

    Here is an example:<\/p>\n

    \"\"<\/a><\/p>\n

    I’ve chosen centre of gravity (cog) as\u00a0Bip01_Pelvis. Most of them are easy enough to work out, but get it wrong and the animation will be….funky.<\/p>\n

    Once you’ve finished tagging the rig, SAVE it…it will save you a vast amount of time.<\/p>\n

    You then need your BVH.<\/p>\n

    There is a large library of free ones here.<\/a><\/p>\n

    Tagging the BVH rig<\/h3>\n

    Go to Animate->MOTOR->Mocap to Rig<\/p>\n

    You’ll get this dialgoue:<\/p>\n

    \"\"<\/a><\/p>\n

    You need to<\/p>\n

      \n
    1. \u00a0Select BVH as the format<\/strong><\/li>\n
    2. \u00a0Select a BVH file<\/strong><\/li>\n
    3. \u00a0Create a tag template<\/strong> This will launch the same window as previosuly. This time, you want to tag the BVH you’ve just loaded. Once done, save this one too.<\/li>\n
    4. \u00a0Select Target Model<\/strong> This should already be the ValveBiped, if not, select it from the Scene Explorer.<\/li>\n
    5. Apply.<\/li>\n<\/ol>\n

      I’ve uploaded my Valve Biped tag file and by BVH tag file here, as well as a mocap file I took from the site mentioned earlier. Link:\u00a0http:\/\/daft-ideas.co.uk\/rnd\/Clear%20Skies\/mocapeg\/<\/a><\/span><\/span><\/p>\n

      Now, by the power of greyskull<\/strong>, you’ll animate the Valve Biped:<\/span><\/h1>\n