TGE/How to setup Blend Sequences in Milkshape3D
From TDN
Contents |
Introduction & Background
This article will demonstrate how I acheived .DSQ blend-type animation sequences from the modeling program, Milkshape3D. I have been utilizing Milkshape3D for TGE art content since I first downloaded the TGEv1.1 demo build and example package. I have been a licensee of Milkshpe3D since very early v1.5 builds for constructing my content for some Half-Life I MODs I'd been involved in. The animation systems were somewhat similar, in that there was a reference shape and separate sequences that are compiled into a single object during an Export Process. Milkshape, the workhorse that it is, was capable of exporting both that format[.MDL, along with a mulititude of others] and now the .DTS format of the Torque Engine.
Improvements to the toolset
It was great news the day the DTSPlus! exporter released, as it extended the core functionality of the exports issuing from Milkshape; namely the ability to generate .DSQ fileTypes to compile at runtime allowing for a common sharing of animation data spread across a number of similarly structured shapes. Then, this functionality was extended further to include Blend type animation sequences. As our design documents listed many pistol type weapons, which strayed from the default player rifle holding pose, I needed to be able to generate the blends necessary to accomplish different holding posture. I had a difficult time correctly setting up the shape and sequence for exporting, spending about 3 whole days always ending in various forms of undesireable results. That was until, while working on a side Milkfarm project, a respected Community Member at GG, gave me some insight into Blends in general and perhaps a way to setup the shape correctly. Needless to say, I jumped at the chance and quickly threw these steps into practice on the spot in my work Scene and was finally able to export it properly for the engine!Outlining the Process
This image shows my default "BoxyBoy" shape which has made appearances throughout my personal webpages; especially when dealing with the DTSPlus! default rig. This particular rig is my final copy with all 8 mountPoints included, but it does not vary at all in it's Scene Root pose[see other pages here on the site for details]. It is in the Scene Root, without being in Animation Mode. There are 4 frames in the Timeline. When the steps are completed, this Scene will export a .DSQ sequence setup correctly for the engine and default code. The new pose will be with the player holding a pistol weapon held at Eye level, as an original design requirement of mine was to include the weapons and hands in the player's FOV and appear on the HUD.
A Simple armThread:look Setup
1. After opening the developers' working Scene[this example uses my proto player shape file which is not included as a Resource], with the shape in the Root pose at the Scene Root, enter Animation Mode and record a keyframe for ALL of the Joints in the Scene at frame1. This not only establishes the Blend Reference Frame, but also allows the animator to begin utilizing the Operate On Selected Joints Only mode, which is helpful for the fine adjustments needed for smooth motions.2. Scrub the slider to frame3 of the Timeline and pose the rig in the new weapon's intended look* posture and record a keyframe for the 'middle' or default pose. This was upon suggestion, as I had been getting the Blend Reference pose here on earlier failures and not my intended pose. I'm not entirely sure this is needed, but it seemed to work for my example. It also put the weapon perfectly in the HUD, as my design requirements dictated, when the player is in the "Root" actionThread. 3. Scrub the slider to frame2 and pose the rig in the extreme UP pose of the look* sequence and record a keyframe for this position. This is the end position of looking up when inside the engine using this player. 4. Scrub the slider to frame4 and pose the rig in the extreme DOWN pose of the sequence and record a keyframe for this position, and this pose becomes the end of movement for looking down as the player. Exit Animation Mode and Save the file as desired.
It's now a matter of using the Sequence portion of the dialog to Add the sequence and it's parameters to the Scene,[which pops with a dedicated dialog and is included in the accompanying image]. Important to note is the Blend Animations portion of the dialog; as this is where the Reference Frame is recorded. Also note, that this reference frame[frame1] did NOT need to be included within the sequence range[2-4] at all! This was upon another suggestion and with the combination of the two, I was able to get the desired results of a proper blending sequence. My newly exported sequence blends ontop of the default actionThread animations; as both the Root poses are the same in both Source files.
Proofing inside the Engine
I included all the necessary assets in their proper repositories, edited the TSShapeConstructor script to include this new .dsq file into the playerShape, and ran the engine. Immediately upon spawning, my code base includes the intended pistol shapeImage mounted to the player, with some ammo for testing. My nearest target appears to be this attractive farm house[.MIS & .DIFF/.jpg's courtsey of Eric 'Esop' Johnson, 3D & Texture artist]. As you can see from the snapshot; with a default straight ahead Root pose and this weapon's armThread playing, the engine has blended the armThread sequence ontop of the actionThread sequence perfectly; aligning the weapon as I'd intended back in Milkshape3D. Entering freeLook, and operating the up/down values via the mouse, would show the player to be raising and lowering his weapon with his gaze. When I created the down position, I did not give the rotation as much value as up, due to some clipping on the player's body by the arms, but the player reacted as I'd intended in my animation. I was at last successful at producing blend-type .DSQ animation sequences with Milkshape3D and the DTSPlus! exporter. If this shape and sequence were examined inside the ShowTool Pro, there would be indicators of the sequence's Blend parameters being in place.Categories: Art | DTS | 3d | Tutorial




