Download presentation
Presentation is loading. Please wait.
Published byAmelia Grace Haynes Modified over 6 years ago
1
Quake 2 to Heretic II Model Conversion Tutorial
by Gwynhala, 2/15/2000
2
Gwynhala's GwynFlex Tutorial
About The Tutorial This tutorial teaches you how to use the GwynFlex animation tool to convert a Quake 2 player model for use in Heretic II This is a work in progress. Lessons included so far: Introduction Tools You Will Need Lesson 1: The Skin Lesson 2: The Skeleton Lesson 3: Do The Twist Lesson 4: Strike A Pose Lesson 5: I Bind Thee! Lesson 6: Weaponry Lesson 7: Skin Patchwork Lesson 8: The Final Model Watch for more lessons soon! 11/17/2018 Gwynhala's GwynFlex Tutorial
3
Introduction In this tutorial we will convert the classic Quake 2 female space marine into a Heretic II player model. As you probably know, Quake 2 was developed by ID Software. Heretic II was developed by Raven Software, using software licensed from ID Software. Please respect everybody’s copyright! The Quake 2 female space marine (let’s call her Q2Gal) will start out looking like Figure 1, and end up looking like Figure 2. During the conversion Q2Gal will more than triple her count of animation frames, learn many new moves, and acquire some really cool elvin weaponry. The techniques used to convert Q2Gal can be used on most other Quake 2 models as well. And that is the point of this tutorial: to teach you how to convert any Quake 2 model so that it can be used in Heretic II. Figure 1: Original Quake 2 Model Figure 2: Converted Q2Gal Model for Heretic II NOTE: Artists spend a lot of time and creative energy making Quake 2 models. Before you convert a model, it’s best to contact the original author and ask if it’s OK. Usually they are flattered and give permission as long as you give them credit for the original when you distribute the conversion. If the original artist does not give permission, please respect his/her copyright and find a different model to use. 11/17/2018 Gwynhala's GwynFlex Tutorial
4
Gwynhala's GwynFlex Tutorial
Tools You Will Need Essential tools: A computer running Windows 95 / 98 / 2000 and a color display (Linux or Amiga users…you are welcome to follow along but the details of the tutorial are for Windows) An installed version of Heretic II with Enhancement Pack (EP1.06 available at and the Heretic II CD A full or demo version of Quake 2 (to get the female space marine model used in tutorial– baseq2\players\female\tris.md2) Version B10 or newer of the GwynFlex model animation tools that I wrote ( A paint program like PaintShow Plus, Photoshop or VideoStudio Image Editor The MIPMaker Heretic II skin conversion tool ( Some other really helpful tools: The QMView model viewing tool for Heretic II (get the modified version at it fixes several bugs related to skin viewing) The convert.exe program written by Green Elf, available at this allows you to make a quick (but non-usable) conversion of a Quake 2 model to a subset of the Heretic II format for viewing with QMView. A Quake 2 model editor such as Q2 Modeler, Shadow Realm Model Animator, or QME 11/17/2018 Gwynhala's GwynFlex Tutorial
5
Lesson 1 - The Skin
6
Gwynhala's GwynFlex Tutorial
The Skin The ‘skin’ is the artwork that gets painted onto the 3D model to color its face, clothes, and weapons. Quake 2 skins differ from Heretic II skins in several ways. Quake 2 skins are of various sizes, while Heretic II player model skins are always 256x256 Most Quake 2 skins use a standard Quake 2 palette of 256 pre-selected colors; Heretic II skins may use any palette of 256 colors Quake 2 skins are stored in a common format known as .PCX; Heretic II skins are stored in a special format known as .M8 Quake 2 models have one skin; Heretic II models have two skins - a “normal” skin and a “damaged” skin. In this tutorial we will overcome each of these differences. We’ll be using the VOODOO.PCX skin that comes with Quake 2 as an example. The steps we’ll go through include: Import the skin into a paint program Give the skin a standard 256 color Quake 2 palette Re-size the skin to 256x256 pixels Save the skin as a Windows .BMP file We won’t convert the skin to .M8 format for a while yet. You’ll understand why, when we add Heretic II weaponry to the model in Lesson 6 and Lesson 7. In the tutorial I use ULead’s VideoStudio Image Editor, an old Windows 3.1 program that I happen to be comfortable with, but any decent paint program will do. Here goes… 11/17/2018 Gwynhala's GwynFlex Tutorial
7
Gwynhala's GwynFlex Tutorial
Importing the Skin Begin by opening up your paint program and selecting File->Open from the menu bar. Then navigate to the Quake 2 folder where the female space marine model is stored (usually quake2\baseq2\players\female), and open the file VOODOO.PCX. You should see something like this: Ewwww…that’s icky. Why is it all black and white, you might ask? Well that has to do with the palette. Since most Quake 2 skins use the same palette, there’s no reason to store the palette in the skin. When VideoStudio Image Editor opens a file without a palette, it shows the image as grayscale. To get the colors right, we have to add a Quake 2 palette to the image. One such palette, q2.pal, comes with the convert.exe program described above under Tools You Will Need. NOTE: Your paint program might behave differently. But it almost certainly won’t show the correct colors for the VOODOO.PCX skin until we go to the next step. Some Quake 2 skins include a palette and the colors will look correct – in that case you can skip this part. 11/17/2018 Gwynhala's GwynFlex Tutorial
8
Gwynhala's GwynFlex Tutorial
Fixing the Palette To get the colors right, we have to add a Quake 2 palette to the image. One such palette, q2.pal, comes with the convert.exe program described above under Tools You Will Need. The way to import a palette is different for each paint program; here is how it is done in VideoStudio Image Editor. First we tell the paint program that this is a 256 color image, not a grayscale image (left) Then we tell the paint program to load a palette from the q2.pal file (right) 11/17/2018 Gwynhala's GwynFlex Tutorial
9
Gwynhala's GwynFlex Tutorial
Resizing the Skin I Once the new palette is loaded, the skin image looks a lot better (below) We mentioned previously that all Heretic II player model skins are 256x256. The VOODOO.PCX skin is pretty clearly not 256x256 – in fact, it isn’t even square What we need to do next depends on whether the skin is larger, or smaller than 256x256. If the skin is smaller than 256x256, GwynFlex will assume a 256x256 size and will not scale the model’s texture coordinates. In this case, we need to create a new 256x256 skin and copy the VOODOO.PCX skin to its upper left corner. If either dimension of the skin is larger than 256, GwynFlex will assume that dimension is whichever of the following is closest, but larger: 256, 320, 480, 512. During import of the Quake 2 model, GwynFlex will automatically scale the model’s texture coordinates along that axis to fit them into the range In this case we have to scale our skin accordingly – for example, if the skin is 320x200, we have to re-scale it to 256x200 by shrinking the X axis, before copying the result over to a new 256x256 skin. Dimensions smaller than 256 are treated by GwynFlex as 256 and the skin is not scaled along those dimensions. 11/17/2018 Gwynhala's GwynFlex Tutorial
10
Resizing the Skin II According to VideoStudio Image Editor the VOODOO.PCX skin is 252 x 195. That means that GwynFlex will treat it as a 256x256 skin. All we have to do is drop the current image onto a new 256x256 image that also uses the q2.pal palette, and position it in the upper left corner. The resulting 256x256 skin image looks like this (right) That’s it for converting the skin – for now. Save your work (a catchy name like Q2Gal.bmp will do), and go make a nice chocolate sundae to celebrate completing your first step in Quake 2 model conversion. NOTE: I like to put solid blue in areas of a skin that are not used. You don’t have to do this. I created a 256x256 skin with the standard Quake color Palette and then copied the colored VOODOO.PCX into the upper left corner. Another way to do it is to create a new true color (24 bit color) image, then copy and paste the colored VOODOO.PCX image. At this point it doesn’t matter whether we end up with an 8-bit (palette) or a 24-bit (true color) image. Do whichever is easiest for you. 11/17/2018 Gwynhala's GwynFlex Tutorial
11
Lesson 2 - The Skeleton
12
Figure 3: The GwynFlex Skeleton
The Skeleton The term skeleton has a specific meaning for Heretic II models, also known as flexmodels. In a flexmodel, the skeleton is information stored in the tris.fm file that tells Heretic II the location of the neck, chest, and waist in every animation frame. It allows Heretic II player characters to turn from side to side at the waist, without pivoting the feet of the model. It also lets Heretic II create new animation sequences by combining the upper body position from one sequence (like Hellstaff strafing) with the lower body position from another sequence (like crouching) GwynFlex uses the term skeleton in a different way, as shown in Figure 3 (right) In GwynFlex, the skeleton is a stick figure that defines the pose of the player model. Each sphere in the skeleton represents a joint where the player model can be bent. Each rod in the skeleton represents a bone that can be changed in length and that parts of the player model can be attached to. Figure 3: The GwynFlex Skeleton 11/17/2018 Gwynhala's GwynFlex Tutorial
13
Gwynhala's GwynFlex Tutorial
Moving Skeleton Parts To reposition a joint in the GwynFlex skeleton, you click on it and drag it with the mouse. This automatically moves all of the bones connected to the joint. For example, if you left click on the knee joint and move it, you can bend the knee of the skeleton. The lower leg bone, ankle joint, and foot bone will also move, tracking the motion of the knee joint. Repositioning a joint can also change the length of a bone, to make it match the proportions of a player model that you are working with. For fine positioning, you can also use the keyboard to position a joint slightly up, down, left, right, forward, or back. Shift-clicking on a bone and dragging sets the twist of the bone in the GwynFlex skeleton The idea behind twist is pretty simple: hold your hand in front of you, palm toward your face. Now look at the back of your hand. To get from palm to backhand, you likely just twisted the bone in your forearm instead of moving your arm or hand. Twist means the same thing in GwynFlex: it tells GwynFlex how much a given bone has been twisted. To be able to see bone twists, make sure the View->Selection Box menu is checked. To twist a bone, control left click on it and drag the mouse. The bone will be outlined in bold and a small green arrow will appear pointing out of its middle. This arrow indicates the twist of the bone, which will change as you drag the mouse. NOTE: The position of a bone is determined by the positions of the joints at each end. You cannot change the position of a bone by selecting and dragging it. Only the twist of the bone can be set in this way. To change the position of a bone, move one or both of the joints at its ends. 11/17/2018 Gwynhala's GwynFlex Tutorial
14
Gwynhala's GwynFlex Tutorial
The Skeleton Menu Figure 3 shows the menus of GwynFlex, including a Skeleton menu. This menu allows you to do perform certain operations on the skeleton that are hard to describe using just the mouse. Mesh Nodes: Controls which parts of the body (such as right arm or left leg) GwynFlex manipulates Rigid Bones: Prevents changing the length of any bone when moving a joint; instead, the bone swivels around the joint keeping its current length Normalize Poses: Allows GwynFlex to import and export poses based on standard Corvus bone lengths, automatically adjusting for the actual bone lengths of your model Scale To Ground: During animation, scales the model based on the length of the legs, so that the model’s feet touch the ground Arm / Leg Beef: Future; Does nothing Guess Bindings: Tells GwynFlex to automatically determine what parts of the model to move with each bone Bind to Bone: Manually tells GwynFlex what parts of the model to move with each bone Unbind Bone: Separates mesh from a bone Unbind All Bones: Separates mesh from all bones Hips To Origin: Moves the skeleton so that the hips are at (0,0,0) Restore Defaults: Restores default pose 11/17/2018 Gwynhala's GwynFlex Tutorial
15
Bones, Poses, and Animation
There are more than 30 joints and 30 bones in the GwynFlex skeleton. The set of lengths of all of the bones in the skeleton is called the bones. GwynFlex has the bone lengths of the standard Corvus player model built-in. You can define new sets of bone lengths for other player models, but you can’t change the connections between bones and joints Poses The set of positions of all of the joints, and twists of all the bones, in the skeleton is called a pose. GwynFlex includes a database of more than 1400 poses that have been recorded from the animation of the standard Heretic II Corvus player model. GwynFlex allows you to define your own poses to create new animations. Each pose has a name, such as conjure11 or asscrtch7. The first part of the name tells Heretic II which animation sequence the pose is part of, while the number at the end tells Heretic II which frame in the animation. For example, the name conjure11 indicates the 11th frame of the conjure animation – the animation used when Corvus casts the Sphere of Anihilation spell. Animation To animate your player model, GwynFlex reads data files to find the locations of all of the joints, the lengths of all of the bones, and the assignments of points on the 3D structure of your player model to various bones. This provides enough information for GwynFlex to bend and twist the 3D statue of your player model into the more than 1400 positions needed to create a Heretic II flexmodel. 11/17/2018 Gwynhala's GwynFlex Tutorial
16
Gwynhala's GwynFlex Tutorial
Skin - Mesh - Bones I Figure 4 (next page, left) shows the skeleton of Figure 3, with a wireframe outline of Corvus superimposed. Because the pose of the skeleton and the model are identical in Figure 4, the bone lengths and joint positions line up perfectly inside the mesh. Figure 5 (next page, right) shows the wireframe of Figure 4 with a standard Corvus skin. The skin – the same skin discussed in Lesson 1 - is what makes the model look solid and detailed. GwynFlex is a tool for manipulating the skeleton of the model, not the skin. Heretic II automatically applies the skin to the player model wireframe during gameplay. GwynFlex only saves information about how the skin fits the wireframe, in the flexmodel. Now you know just enough about skins, skeletons, bones, joints, poses, and animations to be truly dangerous. That’s it for Lesson 2. Go do something you enjoy for a while, then come back and take a look at Lesson 3: Do The Twist where we’ll put all this knowledge to good use in the next step of our Quake 2 female space marine conversion. 11/17/2018 Gwynhala's GwynFlex Tutorial
17
Skin - Mesh - Bones II 11/17/2018 Gwynhala's GwynFlex Tutorial
Figure 4: Skeleton and Corvus Player Model Wireframe - asscrtch7 Pose Figure 5: Fully-Skinned Corvus Model – asscrtch7 Pose Note: Even though GwynFlex knows exactly how the skin is applied to the model, it’s not fancy enough to display skins. The image in Figure 5 was made using the QMView utility that comes on the Heretic II CD. 11/17/2018 Gwynhala's GwynFlex Tutorial
18
Lesson 3: Do The Twist
19
Gwynhala's GwynFlex Tutorial
Bone Twist Overview Bone twist is tricky to get just right in GwynFlex, and it’s one of the most common causes of problems in the final animated model. In this lesson we’ll lay the bone twist issue to rest once and for all, so that you can be confident of having the right bone twists when converting your Quake 2 model. We’ll begin by taking a brief look describing some common mistakes related to bone twist and bone binding, and what kinds of distortion they cause in the model. The two most common mistakes you can make using GwynFlex are: Incorrect twist settings on one or more bones, and Assignment of part of the mesh to the incorrect bone The shocking images that follow reveal the cruel distortions your model will experience when you make these mistakes. Don’t let this happen to you… Once we’ve viewed some horror stories, I’ll show you exactly how the bone twists should be set. Make sure that View->Selection Box is checked, or you won’t be able to see bone twists. 11/17/2018 Gwynhala's GwynFlex Tutorial
20
Wrong Bone Twists Figure 6a shows our Quake 2 female space marine, Q2Gal, in a Heretic II pose called 180turn8. From Lesson 2, you will recognize this as the 8th frame of the 180turn animation sequence, which is used when the player turns around. I picked it for this example only because it looks a bit like she’s dancing the twist. Figure 6b shows the exact same model, generated using the exact same mesh and settings of GwynFlex, but with incorrect bone twist settings. Note the distortions in the chest, legs and arms. Not a pretty sight, is it? Figure 6a: Q2Gal As She Should Be Figure 6b: Q2Gal Distorted By Wrong Bone Twists 11/17/2018 Gwynhala's GwynFlex Tutorial
21
Gwynhala's GwynFlex Tutorial
What Happened? The left upper leg in Figure 6b was set up with incorrect bone twists, while the left hip and left calf bone twist were correct. When the model in Figure 6b was animated, GwynFlex had incorrect information about what part of the upper leg normally faces “up”. It turned the upper leg 90 degrees from where it should have been, but it still had to connect the upper leg to the hip and lower leg using specific vertices in the 3D mesh. The result is like twisting a balloon – the sides of the balloon stretch, but the balloon pinches in the middle. You can see a similar pinch clearly in Figure 6b when you compare it to the left leg of Figure 6a. There’s a similar problem in the right breast, leading to grotesque distortion. And the right arm of Figure 6b, as you can see, looks withered and twisted compared to Figure 6a. 11/17/2018 Gwynhala's GwynFlex Tutorial
22
Wrong Bone Bindings Figure 7a (same as Figure 6a) shows our Quake 2 female space marine, Q2Gal as she should be. Figure 7b shows the result of assigning part of the mesh to the wrong bone of the skeleton. Eeek! She’s got a club foot! Figure 7a: Q2Gal As She Should Be Figure 7b: Q2Gal Distorted By Wrong Bindings 11/17/2018 Gwynhala's GwynFlex Tutorial
23
Gwynhala's GwynFlex Tutorial
What Happened? The base pose was taken from the salute08 frame of the original Quake 2 female space marine model. One triangle in the right foot was mistakenly bound to the left foot bone, instead of to the right foot bone. Each triangle bound to a given bone moves during animation to keep a constant distance and orientation with respect to that bone. When GwynFlex changed the pose from the Quake 2 pose salute08, to the Heretic II pose 180turn8, that one triangle in the right foot tried to keep a constant distance from the left foot bone, while the other triangles moved correctly with the right foot bone. The feet are farther apart in the 180turn8 pose, causing the foot to distort where the incorrectly bound triangle joined with other triangles in the right foot 11/17/2018 Gwynhala's GwynFlex Tutorial
24
Getting the Twist Right
In Lesson 4 we are going to work on the base pose, but not the bindings that link the base pose to the 3D mesh of your player model. This means that in Lesson 4 we need to be careful about our bone twists, but don’t need to worry about our triangle bindings (that’s for Lesson 5). You can avoid most bone twist problems by thinking carefully about the pose of your 3D mesh while creating the base pose, and following a few simple rules. The reason bone twists are so important is that the motion capture data used by GwynFlex to animate your player model (the mocap.spz file) is really a set of rotation angles for each bone in each frame. The rotation angles are all stored relative to a default angle for each bone. For example, the default angle for the head would point the head straight ahead; a rotation angle of 90 degrees in the motion capture data would indicate that, for the current animation frame, the head should be turned 90 degrees relative to straight ahead (that is, the head should point to the left, instead of straight). When you create your base pose in GwynFlex, the twist that you set for each bone is used as the default angle for that bone when animating it. If you set a bone twist that doesn’t match the twist used for that bone in the motion capture data, that particular bone (and all the triangles bound to it) will be animated incorrectly in every animation frame. 11/17/2018 Gwynhala's GwynFlex Tutorial
25
Figure 8: Bone Twists (Default Angles) for All GwynFlex Bones
You might have guessed that if you know the default angles used in the motion capture data, you can set your bone twists to match them and then the animations will look great. Figure 8 shows what the default angles look like for the spread-eagle pose, a green arrow indicating each default angle. Note that: Both arms are outstretched to the side, with the palms facing forward and the arrow for each hand pointing through the edge of the hand; The clenched fists are positioned in a straight line with the arms, as if the fist was formed by bending the fingers and thumb (but not the wrist) starting from the palms facing forward. The bone twist arrow for the bladestaff points away from the edge of the blade The arrow for the hellstaff points through the cranium of the skull at the end of the hellstaff The arrow for the bow points straight out the front of the bow; this is true for both the stored bow and the drawn bow (this is why no arrow is visible for the stored bow in Figure 8 – the arrow points into the page since that is the direction the stored bow faces) Figure 8: Bone Twists (Default Angles) for All GwynFlex Bones 11/17/2018 Gwynhala's GwynFlex Tutorial
26
Figure 9: GwynFlex Bone Twist Arrows Pierce the Corvus Model
Piercing the Flesh I If Corvus’ body were superimposed on the skeleton of Figure 8, each green arrow would pierce Corvus’ “flesh” in a specific place. For example, the arrow for the left lower leg bone would pierce the outer left side of Ccorvus’ calf. There’s a great tip in this observation: pointing through the outer left side of the calf is the correct positioning of the left lower leg’s “twist” arrow for any pose of Corvus. This holds true for all of the bones. By remembering where the green arrow pierces the “flesh” for each bone, and always setting your bone twist to get that same piercing, you will always set your bone twists correctly. To help visualize where the green arrows pierce Corvus’ flesh, Figure 9 shows a wire frame of Corvus and his weapons superimposed on the skeleton. Figure 9: GwynFlex Bone Twist Arrows Pierce the Corvus Model 11/17/2018 Gwynhala's GwynFlex Tutorial
27
Figure 10: Corvus In The Pose Of Figure 8 and Figure 9
Piercing the Flesh II Figure 10 shows a fully-skinned Corvus model in the same pose as Figure 8 and Figure 9. Comparing Figures 8, 9, and 10 might help you visualize the “flesh piercing” rule for determining correct bone twist. “OK, I get it, when can I start converting my model?” Right now! I expect that you’ve studied Lesson 3 well enough that your bone twists will all be perfect as we continue into Lesson 4: Strike A Pose. Note: The default angles used by GwynFlex were created by pivoting each bone around the hip joint to the 3 o’clock position; in this position, all of the default angles point upward. You don’t really need to know this to use GwynFlex effectively, but it could help you to visualize the correct bone twists. Figure 10: Corvus In The Pose Of Figure 8 and Figure 9 11/17/2018 Gwynhala's GwynFlex Tutorial
28
Lesson 4 - Strike a Pose
29
Gwynhala's GwynFlex Tutorial
Strike a Pose Model animation using GwynFlex depends almost completely on getting a single pose of your player model set up correctly. More than 1400 Heretic II animation frames will be generated from just one pose that you set up, and any problem in that pose will be multiplied more than 1400 times. As we saw in Lesson 3, even things that look correct in the one pose you choose to set up – called the base pose – could end up going terribly wrong when the model is animated. In this lesson, we’ll select a base pose of the Quake 2 model to import into GwynFlex. Then we’ll align the GwynFlex skeleton to our base pose, to prepare the model for animation. 11/17/2018 Gwynhala's GwynFlex Tutorial
30
Gwynhala's GwynFlex Tutorial
Selecting a Base Pose Quake 2 player models have about 400 frames of animation. Each animation frame includes a complete 3D description of the model in a specific pose, such as part of animations used for running, salute, pain reaction, or strafing. You can use any one of these frames as the base frame that GwynFlex will animate. No matter which Quake 2 animation frame you pick as your base frame, internally GwynFlex will re-pose it into a standard position, and then automatically create the poses that a Heretic II player model needs. While any base pose will work, some base poses will provide better results than others. There are two basic ways to find a base pose you like: Preview the poses with a Quake 2 modeling tool Use trial and error 11/17/2018 Gwynhala's GwynFlex Tutorial
31
Base Pose Selection Rules
Choose a pose where the character is not distorted (for example, where hair or clothing is in a strange position). Otherwise, the distortion will be copied to all of the frames of the Heretic II model. The standard position that GwynFlex uses internally has all limbs of the character straight (similar to Figure 10 in Lesson 3). It’s best to choose a base pose that is as close as possible to the standard position, to minimize distortion that GwynFlex might cause when trying to straighten out or twist the limbs Avoid poses where some part of the mesh goes inside another part (for example, a hand disappears inside a weapon or the torso due to twisting of the model). These poses, usually unintended mistakes made by the original artist, can confuse the automatic binding feature of GwynFlex, and also make manual binding of the hidden parts of the mesh more difficult. Choose a pose that is similar to one of the Heretic II poses in the Corvus model. This will cut down on the time it takes to reposition the GwynFlex skeleton to match your base pose, since you can use the File->Load Pose menu to pre-position most of the bones and joints. 11/17/2018 Gwynhala's GwynFlex Tutorial
32
Figure 11: Previewing Poses With Q2Modeler
Quake 2 tools like Q2Modeler, QME (modeling tools), and NST (a skinning tool) will import a Quake 2 model and let you view individual animation frames in 3D. Browse through the frames until you find one that would make a good base pose. Note the name of the pose you want, and select that name from the list of poses GwynFlex displays when you bring up the File->Open menu. Figure 11 shows a screenshot of Q2Modeler being used to preview poses of the Quake 2 female space marine model. Figure 11: Previewing Poses With Q2Modeler 11/17/2018 Gwynhala's GwynFlex Tutorial
33
Gwynhala's GwynFlex Tutorial
Trial and Error The name of a Quake 2 pose often gives some hint of what the pose looks like. For example, the pose run1 probably shows the character running. The pose stand40 probably shows the character standing. GwynFlex shows you a list of all of the poses in a Quake 2 model when you bring up the File->Open menu. Highlight the name of a pose and click OK to import it into GwynFlex. Try importing different poses until you see one that would make a good base pose 11/17/2018 Gwynhala's GwynFlex Tutorial
34
Importing the Base Pose
I’ve decided to use the salute08 pose from the Quake 2 female space marine as the base pose for Q2Gal. I’ve also decided that I’m going to start my skeleton in the conjure11 pose from Heretic II and use the File->Load Pose menu to import some starting joint and bone positions that I think are close to what I’ll need for salute08. Since I know where the Quake 2 model is located on my hard drive, and I’ve selected my base pose, and I’ve installed GwynFlex, I’m ready to start the model conversion. Here’s how I import the skeletal pose: I start up GwynFlex and select the File->Load Pose menu. A dialog box appears, and asks me for the name of the file to load a skeleton pose from. Since I am using a standard Corvus pose, conjure11, and all of the standard Corvus poses are in the mocap.spz data file that comes with GwynFlex, I navigate to the mocap.spz file and click OK. A dialog box then appears asking which pose I want to load. I select conjure11, and again click OK. The skeleton then rearranges itself into the conjure11 pose. 11/17/2018 Gwynhala's GwynFlex Tutorial
35
Gwynhala's GwynFlex Tutorial
Mesh Nodes The Quake 2 model I’m working with doesn’t have any weapons or armor that I want to re-use in Heretic II. For now, I need to tell GwynFlex to disable the mesh nodes of the skeleton that represent weapons and armor. I go to the Skeleton->Mesh Nodes menu, and set up the dialog box as shown to the right. All of the boxes without check marks will be disabled for now. I click OK, the dialog box disappears, and weapon-related and armor-related parts of the skeleton disappear to indicate that they are disabled. What’s left of the skeleton still has the conjure11 pose, even though some of the mesh nodes are disabled. 11/17/2018 Gwynhala's GwynFlex Tutorial
36
Gwynhala's GwynFlex Tutorial
Importing the Mesh I Next, I use the File->Open menu to import my base pose. A dialog box appears. Since I’m importing from a Quake 2 model, I tell GwynFlex to look for .md2 files (all Quake 2 models have this suffix), and navigate to the folder where the Quake 2 female space marine is stored. Two files in this model’s folder have the .md2 suffix: tris.md2, and weapon.md2. Some models have even more files with the .md2 suffix. The only file that matters right now – for any Quake 2 model – is the tris.md2 file. This file contains the character; the other files contain Quake 2 specific weapons or other character add-ons. 11/17/2018 Gwynhala's GwynFlex Tutorial
37
Gwynhala's GwynFlex Tutorial
Importing the Mesh II I select tris.md2, and click Open. Another dialog box appears asking which frame I want to load, and I select salute08. A warning box appears (this might or might not happen for your model). This warning box gives me the chance to have GwynFlex divide the mesh into groups of connected triangles, and give each group a unique name. This can be very useful during manual bone binding, so I click Yes. GwynFlex imports the salute08 frame, and displays it along with a bounding box and the default skeleton in the conjure11 pose (with weapons and armor disabled). It’s pretty clear the skeleton and base pose don’t line up. In fact, Q2Gal is facing the wrong direction – she faces into the screen, while the skeleton faces out of the screen! 11/17/2018 Gwynhala's GwynFlex Tutorial
38
Gwynhala's GwynFlex Tutorial
Aligning the Hips I Q2Gal is facing the wrong direction. I need to spin her around 180 degrees to get her pointing the same way as my default pose. Then I need to line up the base of her spine with the hip anchor joint of the GwynFlex skeleton, since all measurements and posing calculations in GwynFlex are made relative to the hip anchor. To spin the model, I use the Model->Rotate Z menu, twice. Each time rotates the model 90 degrees. When I’m done, the model looks as show at the right. Note that the model has turned 180 degrees, and also that the green directional arrow on the model now points to the left rather than to the right (indicating the rotation of the model). Note: The imported model is also flipped horizontally compared to the standard Quake 2 “right handed” orientation – a minor bug in GwynFlex Version B10. For this tutorial I’ll ignore the problem 11/17/2018 Gwynhala's GwynFlex Tutorial
39
Gwynhala's GwynFlex Tutorial
Aligning the Hips II The hip alignment looks pretty good – just need to scoot her down a little bit. I will do this with the keyboard - I find the keyboard easier to use than the mouse for fine positioning. To enable keyboard positioning I select Edit->Control Device, click the Keyboard button, and click OK. I verify that there is no check mark next to Model->Solid (selectable). I want the model to be a wireframe so I can see the relative position of the skeleton and the model. Then I use the up and down arrow keys to position the model. I get good alignment, with the hip anchor joint of the skeleton now positioned between, and a little below, Q2Gal’s hips. I am tempted to think that I am done. Instead, I check the GwynFlex left camera view (Camera->Left View) and find that... (see image to right) 11/17/2018 Gwynhala's GwynFlex Tutorial
40
Gwynhala's GwynFlex Tutorial
Aligning the Hips III Yikes! She is completely in front of the skeleton! I need the hip anchor joint to be right in the middle of her hips. From this camera view, I can use the left and right arrow keys to line her up they way I want. I try some of the other camera views, and continue to reposition the model using the arrow keys until I am satisfied with the hip joint position. The final hip alignment looks like this (from the front) This is a milestone, and it deserves to be committed to posterity! Since I do not plan to move the model any more, I make sure the Model->Lock Position menu item is checked; that way I won’t move the model by mistake when trying to position a bone or joint. To save the current position of the model, I use the File->Save Orientation menu. When prompted, I enter the name q2gal.ori and click Save. This way, if I ever need to re-load the base pose I can instantly return it to this position using the File->Load Orientation menu. 11/17/2018 Gwynhala's GwynFlex Tutorial
41
Gwynhala's GwynFlex Tutorial
Posing the Skeleton I The next step will be to reposition the other joints and bones of the skeleton to line up with the locations of the model’s joints, and the lengths of the model’s bones. I can see right away that Q2Gal’s arms are shorter than Corvus’ and also that her back is shorter. The legs look about the same length, but are also probably shorter than the Corvus model my starting skeleton pose is based on. Since I need to change bone lengths, I make sure that The Skeleton->Rigid Bones menu item is not checked. This option would prevent me from changing the length of any bone – I don’t want that. The Skeleton->Normalize Poses menu item has a check mark. This option will adjust any pose I load in the future, to whatever bone lengths I set up for Q2Gal. It will also adjust any Q2Gal pose I save, storing it using standard Corvus bone lengths so that it can be used to pose any model, not just Q2Gal. I begin by moving joints of the skeleton to line up with where the joints appear to be in the imported Q2Gal base pose. All joint positioning work begins at the hip anchor joint and works outward, since moving a joint repositions all of the joints that are connected to it by bones, but farther from the hip. To select a joint for movement, I click on its sphere as discussed in Lesson 2. To move the joint, I drag it into position using either the keyboard or the mouse while checking my work from various camera angles. 11/17/2018 Gwynhala's GwynFlex Tutorial
42
Gwynhala's GwynFlex Tutorial
Example: The Right Leg As I move each joint into position, the bone length is adjusted as needed. Just as for positioning the base pose over the hip anchor joint, I switch between camera views frequently when moving joints to make sure that the joint is centered in the desired location. For example, to arrange the right leg: I position the right hip joint at the seam between the right leg and the torso. Then I position the right knee joint inside the right knee of the base pose. Next, the right ankle joint is positioned. Finally, I place joint indicating the end of the right foot. At this point my skeleton, with the right leg posed, looks like this: The red dot in this image represents the location of the end of the right foot; I just happened to have that joint selected when I took the screenshot. Compare this image to the previous one to see how the joints along the right leg of the skeleton have been lined up with the base pose. I repeat this sequence to pose the left leg. 11/17/2018 Gwynhala's GwynFlex Tutorial
43
Gwynhala's GwynFlex Tutorial
What About The Twist? When I animate the model, it will be very important that the bone twists are correct. Every time I move a joint away from its conjure11 starting position, and toward its salute08 ending position, the twist of the bones immediately connected to the joint is left unchanged. It is probably not the correct twist for the new position. I will have to correct these twists before I animate the model. I am not worried a lot about bone twist right now; first, I’m concentrating on getting the bone lengths and joint positions right. All of the bone twists are, by definition, correct in any pose imported from mocap.spz. Since I imported my starting skeleton pose, conjure11, from mocap.spz, and since I chose the salute08 base pose for the Quake 2 model because of its similarity to conjure11, I expect most of my bone twists to be close to correct when I’m done. Once all of the bone lengths and joint positions are in place, I will go back and verify all of the bone twists. 11/17/2018 Gwynhala's GwynFlex Tutorial
44
Gwynhala's GwynFlex Tutorial
Saving My Work Since I might not want to position the whole skeleton at one sitting, I save my work often using the File->Save Pose menu. When prompted, I enter salute08 as the name of the pose, and q2gal.spz as the name of the file. Each time I save, I overwrite the q2gal.spz file. That way, q2gal.spz always has my latest pose and I can reload it quickly using the File->Load Pose menu. I like to save every time I have a small success, like posing a complete arm, leg, or torso. Saving the pose saves the joint positions and the bone twists, but not the bone lengths. I have Skeleton->Normalize Poses turned on, which means that GwynFlex automatically “normalizes” any pose I save so that it could be applied to any model regardless of bone length I have Skeleton->Rigid Bones turned off, which means that I change the bone lengths every time I move a joint. To save the bone lengths, I use the File->Save Bones menu item and the file name q2gal.bnz. Once all the joints are in position, I will make sure that Skeleton->Rigid Bones is checked so I don’t accidentally change the length of a bone. In GwynFlex, once the bone lengths have been set up, the same lengths are used in all animation frames of a given model. 11/17/2018 Gwynhala's GwynFlex Tutorial
45
Posing Torso & Spine Joints
The spine of the GwynFlex skeleton includes several joints placed close together near the hip anchor joint. This roughly matches how human vertebrae bend in the lower part of the spine, but are more rigid in the chest area. Think about bending your own body forward – most of the bending happens in the lower part of your spine You can reposition these joints any way you like in GwynFlex, but for humanoid models best results are obtained by keeping the proportions roughly as you see in Figure 12. Figure 12: Spine and Torso Proportions Note: If you’re using the keyboard to move joints, here’s a trick you can use to help figure out whether an extremity joint is where you want it. After selecting the joint you want to move, select Model->Solid (selectable) to make the model solid. Then you can easily tell using different camera views whether the joint is positioned just inside, or just outside, the model. This also works well when placing wrist and knee joints. 11/17/2018 Gwynhala's GwynFlex Tutorial
46
Torso Joint Placement Rules
Place the Hip Anchor just below the waist of the model, the Lower Back just above the waist, and the Upper Back just above the Lower Back (roughly at the bottom rear of the rib cage). The Collar joint goes at the bottom of the neck; think of where the character’s neck would begin to bend, and place the Collar there. The Neck joint, not shown in Figure 12, goes at the base of the model’s skull. All of these joints – Hip Anchor, Lower Back, Upper Back, Collar, and Neck – should be placed toward the rear of the model, just like a human spinal cord is at the back, not the front, of the body. The Right Shoulder and Left Shoulder are placed as if they were the shoulder joints of the model, typically at the seam between the arm and the torso, and a little lower than the Collar joint. The Left Hip and Right Hip are placed as if they were the hip joints of the model, typically at the seam between the leg and torso, and a little higher than the model’s crotch. 11/17/2018 Gwynhala's GwynFlex Tutorial
47
Posing the Extremities
The extremities are extra joints added by GwynFlex to mark the ends of the hands, feet, head, and other parts of the skeleton that have only one bone attached. The extremities should be placed as follows: Right Fingertips – If your base pose has a fist for the right hand, place the joint inside the hand mesh at the outermost point, which is probably where the fingers curl back inward (not the knuckles or fingertips). If your base pose has an open right hand, place the joint inside the hand mesh at the fingertips. Left Fingertips – Same as for Right Fingertips Right Toes – Inside the foot mesh at the toes or tip of the boot Left Toes – Same as for Right Toes Top of Head – Place at the top of the head, slightly to the rear to line up better with the Neck joint Top of Stored Staff – This goes just outside the mesh, at the right hip – it is where the tubular stored staff will hang from your model’s belt when no staff weapon is in use (we’ll add weapons later). Armor Mid-Back – This goes just outside the mesh, at the rear of the model, between the shoulder blades – it is where any armor your model wears will attach to the skeleton Middle of Stored Bow – This goes just outside the mesh, at the rear of the model, around the center of the back – it is where the bow will attach to the back of the model when not in use If your skeleton has any other extremities showing, such as Right Grip or Left Shoulder Armor Tip, shame on you. Go back and read Mesh Nodes, where I told you about enabling and disabling mesh nodes. All of the weapon and armor-related bones and joints (including the Left Grip and Right Grip, which create a second pair of hands to hold weapons) should be off – OFF, I say – OFF – right now. 11/17/2018 Gwynhala's GwynFlex Tutorial
48
NOW, Lets Talk About Twist...
I’ve posed all of the joints of the GwynFlex skeleton to line them up with the salute08 base pose. Since the joints determine the bone lengths of my model, that part is done too. I’ve saved the final bone lengths and current skeletal pose using the File->Save Bones and File->Save Pose menus. Now, to make sure that the model will animate correctly, I need to check the bone twists. I know that I had to move the left arm joints a lot, in order to match the conjure11 skeleton to the salute08 base pose. I also had to move one leg forward, and the other leg back. Since all the bone twists were correct in the original conjure11 skeleton, the areas that have been moved a lot are the most likely to have bone twist problems now. I’ll check the legs and left arm carefully. Checking the bone twists amounts to making sure that, when I select each bone, the green directional arrow pierces the “flesh” (mesh) of the model at the right spot. Make sure that View->Selection Box is checked, or you won’t be able to see the green directional arrows that indicate bone twist. 11/17/2018 Gwynhala's GwynFlex Tutorial
49
Checking Q2Gals Twists For twist-checking, it helps to have an image of the skinned model in the base pose, since the skin will help me see how the arms and legs are supposed to be rotated. Figure 13a is a screenshot from NPherno’s Skin Tool (NST), a Quake 2 model painting tool, showing Q2Gal in the salute08 pose I selected as my base pose. As you can see: In this pose the model has just finished saluting. The right hand is outstretched with the inside of the arm and the curled fingers facing forward. The left hand is held curled at the side, also with the inside of the arm facing forward. Figure 13b shows the skeleton posed inside the salute08 wireframe, at roughly the same scale. Figure 13a: Skinned Quake 2 Model Showing Desired Arm Rotations Figure 13b: Current Pose In GwynFlex, Left Upper Arm Selected Note: Because we’re going to use the left upper arm as an example, that bone is selected in figure 13b, showing its bone twist. 11/17/2018 Gwynhala's GwynFlex Tutorial
50
Example: Left Upper Arm
It’s hard to see in Figure 13b due to low image resolution, but on an actual GwynFlex display you would see that the green arrow indicating the bone twist of the left upper arm points more or less toward the upper right corner of the border around the image (see right) Is this bone twist correct? To decide, I compare Figure 13a and Figure 13b against Figure 9 and Figure 10 (from Lesson 3). Figure 9 and 10 indicate that the correct arrow position for the left upper arm is through the “front” of the arm (what would be the front, if the arm were held at the side) Figure 13a shows that, using this same definition of “front” of the arm, the arrow in Figure 13b is pointing out the “front” as desired. The left upper arm bone twist appears to be OK. 11/17/2018 Gwynhala's GwynFlex Tutorial
51
Example: Left Hand The only bone that seems amiss in the left arm is the hand. Figure 14a shows where the hand twist arrow points after my first round of posing the skeleton. Comparing to Figure 13a, it appears that the arrow points diagonally out halfway between the edge of the palm and the closed fist. Compare this to Figure 9 and Figure 10, which suggest that the arrow should point straight out through the edge of the palm. The error is also evident when we compare the direction of the arrow with the Quake 2 model’s mesh – the mesh presents a flat surface representing the top edge of the fist, and the arrow needs to pass straight through that surface. To correct the bone twist, I shift-click on the bone and drag the mouse to rotate the directional arrow around the bone’s axis. Figure 14b shows the corrected bone twist for the left hand. Figure 14a: Left Hand, Incorrect Bone Twist Figure 14b: Left Hand, After Correcting Bone Twist 11/17/2018 Gwynhala's GwynFlex Tutorial
52
Example: Right Lower Leg
I also notice a potential problem in the right lower leg. According to Figure 9 and Figure 10, the twist for this bone should point straight out through the inner calf. The arrow currently points kind of half-way between the inner calf and the back of the calf (see Figure 15a and Figure 15b). The position in Figure 15a seems incorrect, but turns out to be a false alarm. The original conjure11 skeletal pose (and all poses in the mocap.spz file distributed with GwynFlex B10) have similar incorrect-looking bone twists for the left and right lower legs. The consistent degree offset in bone twist for these two bones is caused by an error in the GwynFlex motion capture data. To compensate for the error, the bone twist for the right lower leg should be set to point half-way between the inner calf and the back of the calf. The bone twist for the left lower leg should be set to point half-way between the outer calf and the back of the calf. The bone twist in Figure 15a is correct for the right lower leg. Note: I also make a slight adjustment to the twist of the left foot; it points slightly up, but should be horizontal (not shown) Figure 15a/15b: Right Lower Leg Before Adjustment, and As It Should Be (or so I Thought) 11/17/2018 Gwynhala's GwynFlex Tutorial
53
Gwynhala's GwynFlex Tutorial
Wrapping Up Lesson 4 The rest of my search for bad bone twists is uneventful – the benefit of choosing a starting skeletal pose (Corvus conjure11) that was well matched to the base pose (Q2Gal salute08). I’ve finished posing the GwynFlex skeleton to line it up with my chosen salute08 base pose, and corrected the bone twists. The Figures show what the posed skeleton looks like from front, right, and top camera angles. I’ve saved this pose and my bone lengths using the File->Save Pose and File->Save Bones menus, so that I can take a break and come back fresh to begin assigning (binding) parts of the model’s mesh to the skeleton. I hope you’ve met with similar success. Meet me back here when you’re ready for Lesson 5: I Bind Thee! 11/17/2018 Gwynhala's GwynFlex Tutorial
54
Lesson 5 - I Bind Thee!
55
Gwynhala's GwynFlex Tutorial
I Bind Thee! Now that the GwynFlex skeleton is posed correctly inside the Q2Gal mesh, it’s time to bind parts of the mesh to individual bones so that the model can be animated automatically. In this lesson, I’ll describe how bindings work in GwynFlex, how to have GwynFlex automatically guess what bindings to use, how to create bindings manually, and how to manipulate groups of triangles. Then I’ll create the bindings for the Q2Gal model, and create a test model to check them out. 11/17/2018 Gwynhala's GwynFlex Tutorial
56
Gwynhala's GwynFlex Tutorial
How Bindings Work The base pose of the 3D model that GwynFlex is animating consists of a set of vertex definitions, a set of triangle definitions, and a set of texture definitions. Vertex definitions give the position of the points in 3D space that define the shape of the model. Triangle definitions tell which points to connect together to create the surface of the model. Texture definitions tell how to paint the surface of the model to create a face, clothing, and other effects. Until now, none of these parts of the model have been related in any way to the GwynFlex skeleton. True, in Lesson 4 we posed the skeleton inside the mesh, but as far as GwynFlex is concerned, both the skeleton and the mesh are just data inside a computer program. We haven’t done anything to connect the skeleton to the mesh. Bindings tell GwynFlex which triangles in the base pose to treat as the “flesh” around each skeleton bone. This is important, because GwynFlex animates models by moving the bones and joints of the skeleton into new positions. The triangles bound to each bone are moved and twisted along with that bone to pose the model. For example, to bend left the arm at the elbow, the triangles bound to the left arm, left hand, and any weapon held in the left hand are moved (mathematically) while the rest of the triangles stay in place. Before animating the model, you must tell GwynFlex which triangles to bind to each bone. Some bones have no triangles bound– this just means that no part of the mesh moves with that bone. For example, GwynFlex defines separate bones for the top and bottom half of the blade staff. Most of the time you can bind the entire blade staff to the bone for the top half and leave nothing bound to the bottom half. More on this when we discuss weaponry in Lesson 6. No two bones are allowed to have the same triangle in their bindings 11/17/2018 Gwynhala's GwynFlex Tutorial
57
Gwynhala's GwynFlex Tutorial
Automatic Bindings Once the skeleton is posed inside of your mesh, GwynFlex can make educated guesses about which parts of the mesh to bind to each bone. It does this using – what a surprise – geometry. To tell GwynFlex to guess the bone bindings for all of the enabled mesh nodes (remember the Skeleton->Mesh Nodes menu), you must first select a group of triangles using the Group menu (more on this below). GwynFlex works only with the triangles in the selected group, and assigns them only to the bones of the enabled mesh nodes. To tell GwynFlex to guess the bindings, use the Skeleton->Guess Bindings menu. Automatic bindings are only about 70% accurate. The accuracy of automatic bindings decreases if any joints are bent sharply in the base pose. For example, if your base pose has the arms at the sides, the angle between the left upper arm and the left chest is small and could confuse GwynFlex during automatic binding. Confusion is less likely if the arm is outstretched, because the angle is closer to 180 degrees. We’ll look at some examples of automatic binding later. 11/17/2018 Gwynhala's GwynFlex Tutorial
58
Gwynhala's GwynFlex Tutorial
Manual Bindings You can tell GwynFlex what triangles to bind to a bone by selecting the bone, then making the model solid (Model->Solid menu) and clicking on triangles. Each triangle you click turns blue. When you’ve clicked all of the triangles you want bound to the bone, use the Skeleton->Bind To Bone menu to bind them to the most recently selected bone. If triangles are already bound to the bone, GwynFlex will prompt you to make sure you want to overwrite the bindings. There is no “undo” function. If you make a mistake, use the Skeleton->Unbind Bone menu to assign no triangles to the most recently selected bone so you can start over. The Skeleton->Unbind All Bones menu item assigns no triangles to all bones, in case you need to start over for all bones. You can also mix and match predefined groups of triangles for binding to bones using the Groups menu item, described below. To see what triangles are currently bound to a bone, make sure there is a check next to the View->Bone Bindings menu item. Then select the bone, and the triangles bound to that bone will turn blue. You can then use the TAB key to move up and down the skeleton, examining the triangles bound to any bone. 11/17/2018 Gwynhala's GwynFlex Tutorial
59
Automatic Bindings - How?
Understanding a little of how automatic binding is done, might help you correct errors. GwynFlex calculates automatic bindings using three techniques: Ray tracing Looking for adjacent triangles Examining bone-joint-bone combinations in the skeleton Ray tracing tells GwynFlex which triangles in the model immediately surround a given bone, by calculating the order in which a laser beam would pass through each triangle of the mesh when traveling outward from the bone at various angles. Two triangles are adjacent if they share an edge. Adjacent triangles are more likely to belong to the same bone than two triangles that do not share an edge. By using a mathematical plane to bisect the angle formed by a bone-joint-bone combination GwynFlex can assign triangles on each side of the plane to a different bone. For example, the left upper arm – left elbow – left lower arm are a bone-joint-bone combination in the GwynFlex skeleton. The dividing plane is positioned through the elbow joint. Triangles on one side of the plane are assigned to the lower arm. Triangles on the other side of the plane are assigned to the upper arm. 11/17/2018 Gwynhala's GwynFlex Tutorial
60
Automatic Binding Errors 1
The most common inaccuracy in automatic binding is that a triangle near a joint gets assigned to the wrong bone. This can happen if, for example, two points of the triangle are near the joint on one side of the bisecting plane, and the third point of the triangle is far from the joint on the other side of the bisecting plane, during bone-joint-bone analysis. It can also happen if part of the mesh overhangs the joint – that is, it is connected to mesh on one side of the joint, but is physically located on the other side of the joint, as shown in Figure 16a and Figure 16b. Each figure shows part of the mesh – the part bound to the head bone – outlined in blue. The rest of the mesh outlined in black. Note that two bones in the back are also blue; this has nothing to do with the head mesh or bindings, so ignore it for now. Figure 16a shows how the automatic bindings missed both the mesh around the chin and the pony-tail when calculating the head bindings. Note the positions of the neck joint and top-of-head joint. Only mesh above the neck joint was assigned to the head. The pony-tail was not assigned to the head because (it turns out) it is not connected to the head – no adjacent triangles. Uncorrected, a binding like this would probably cause the head to twist or distort strangely in some poses, due to slightly different twists for the neck and head. The manually corrected bindings are shown in Figure 16b. Figure 16a / 16b: Automatic Binding of Head Mesh to Head Bone, and Corrected Bindings (blue) 11/17/2018 Gwynhala's GwynFlex Tutorial
61
Automatic Binding Errors II
Another common inaccuracy in automatic binding happens when the 3D mesh of the model is not completely closed. In this case a “leak” can occur during ray tracing, causing GwynFlex to assign a triangle far away from a bone to that bone simply because it is the first triangle that a laser beam passing through the open part of the mesh would intersect. The third kind of common inaccuracy happens when GwynFlex cannot figure out which bone to bind a triangle to. Usually this happens when the triangle’s vertex coordinates are very close, but not identical, to the coordinates of its neighbors. In this case GwynFlex does not treat the triangle as adjacent to its neighbors, and the automatic binding method is confused. Another time this can happen is when each vertex of the triangle belongs to triangles bound to a different bone; this occurs at or near the intersection of three or more bones (such as at the hip anchor). When GwynFlex generate bindings automatically, you can edit the bindings to correct any problems. Usually the automatic bindings are close enough, that it is a great time-saver to have GwynFlex automatically generate your bindings and then manually edit them to correct any problems. 11/17/2018 Gwynhala's GwynFlex Tutorial
62
Gwynhala's GwynFlex Tutorial
The Group Menu Any set of triangles in the model that you decide are related, can be made into a triangle group. Named triangle groups each have a name, and a set of triangles. GwynFlex keeps track of a nameless working group of triangles, and shows them in blue on the screen. Clicking on a triangle with the model solid adds / subtracts that triangle to the working group. The name of a triangle group comes from one of three sources: Stored in an imported mesh Invented internally by GwynFlex Typed in by the user The Group menu in GwynFlex provides several tools used to manipulate triangle groups. New: Sets the working group to no triangles. Save: Makes a named group from the working group using a name that you specify. Add: menu adds a named group of triangles to the working group. Subtract: Removes a named group of triangles from the working group. Split: Uses the GwynFlex dividing plane (see below) to divide the working group into one, two, or three named groups. Flood Add Triangles: Adds the most recently selected triangle and all triangles adjacent to it, and all triangles adjacent to those, etc, to the working group. Flood Subtract Triangles: Subtracts the most recently selected triangle, and adjacent triangles, etc, from the working group. 11/17/2018 Gwynhala's GwynFlex Tutorial
63
Gwynhala's GwynFlex Tutorial
Groups vs. Bindings Triangle groups are collections of triangles that have names and can be manipulated to form a desired working group of triangles. Bindings are former working groups that have been associated with (bound to) a bone in the GwynFlex skeleton. GwynFlex B10 does not allow you to save groups, but it does allow you to save bindings (using the File->Save Bindings menu). The following GwynFlex features relate triangle groups to bindings: The Skeleton->Bind To Bone menu copies the working group to the bindings for the most recently selected bone; any previous bindings for that bone are erased. The TAB key shows the triangles bound to a bone, and copies the list of bound triangles for that bone to the working group; any previous working group is erased. When GwynFlex detects an error in bindings when animating the model, it reports the triangles that caused the error by placing them in the working group; any previous working group is erased. 11/17/2018 Gwynhala's GwynFlex Tutorial
64
Gwynhala's GwynFlex Tutorial
Group Names Some 3D model file formats, like WaveFront .OBJ, include triangle group names. When importing a mesh, GwynFlex creates triangle groups based on group names found in the file. The set of triangles in each of these groups was determined in advance by the program that created the mesh. For example, if you use the fm2obj.exe utility program to export an animation frame from a Heretic II flexmodel to a .OBJ file, the fm2obj.exe utility stores separate groups for each mesh node of the model and gives them names like “Left_Upper_Arm”. If there isn’t any group in the file that includes all triangles of the mesh, GwynFlex creates a group named “mesh” that includes all of the triangles in the mesh. GwynFlex also optionally creates a unique group for each set of adjacent triangles in the mesh, and gives each group a made-up name like “meshAA”. The Group->Save, Group->Split, and Group->Rename menus allow you to enter your own names for groups. Each group must have a unique name. If you enter a name that is being used by another group, the new group replaces the old one. The name of a group has no direct connection to any bindings. For example, it is possible to create a group called Left Lower Leg, that is not related in any way to the bindings for the left lower leg bone of the GwynFlex skeleton. When a group with a name like Left Lower Leg is imported, it is NOT automatically bound to any bone 11/17/2018 Gwynhala's GwynFlex Tutorial
65
Correcting Binding Errors 1
The group manipulation features of GwynFlex can be used to correct binding errors. Remember Figure 16a, showing the unsatisfactory results of automatic bone binding for Q2Gal’s head? The binding was corrected to produce Figure 16b using the working group, the Group menu, and the following sequence of steps: Check View->Bone Bindings so I can see bindings Select the Head bone; GwynFlex sets the working group to the list of triangles bound to the head Check Model->Solid so I can click on parts of the 3D mesh Click on a triangle in the pony-tail Select Group->Flood Add Triangles; GwynFlex adds all of the triangles in the pony-tail to the working group, since they are all connected (adjacent, adjacent to adjacent, etc.) to the triangle I clicked. Manually click on triangles in the lower half of the face to add them to the working group Check and correct my work from various camera angles using the Camera menu Select Skeleton->Bind To Bone to overwrite the bindings for the head bone with the working group Since the triangles in the lower part of the face that I selected to create the new head binding were probably assigned to the neck bone during automatic binding, I also have to update the neck bone bindings. 11/17/2018 Gwynhala's GwynFlex Tutorial
66
Correcting Binding Errors II
To correct the neck bindings after assigning some of the original neck triangles to the head, I: Click on the Head – not the Neck, the Head – bone so GwynFlex sets the working group to my corrected head bindings Select Group->Save to save the current group using the group name, Head Use the TAB key to select the neck bone; GwynFlex sets the working group to the current neck bindings Select Group->Subtract to subtract the Head group I created above, from the working group; this assures that none of the triangles assigned to the head are in the working group Select Skeleton->Bind To Bone to overwrite the bindings for the neck bone with the working group; the new bindings are the same as the automatic bindings, except that the triangles now assigned to the head have been deleted from the neck. 11/17/2018 Gwynhala's GwynFlex Tutorial
67
Gwynhala's GwynFlex Tutorial
The Dividing Plane The View->Dividing Plane menu controls a flat surface that can be moved around in 3D space. This surface, called the dividing plane, is used to split up triangle groups. When View->Dividing Plane is checked, the dividing plane appears. You can then click on the dividing plane and move it around using the mouse or keyboard, in the same way that you move the imported base pose of your model Although the dividing plane appears to have edges, it is treated as an infinite plane during GwynFlex calculations. To split a triangle group using the dividing plane: First move the plane into position, then set up the working group that you want to split, either by clicking on triangles or by using TAB or by using the Group menu. Then select Group->Split. The working group will be split as follows: Triangles in the working group that have all vertices on one side of the dividing plane, are placed in a new group that you get to name Triangles in the working group that have all vertices on the other side of the dividing plane, are placed in a new group that you get to name Triangles that intersect the dividing plane are placed in a new group that you get to name. Depending on the position of the dividing plane and the working group, the Group->Split menu can create one, two, or three new groups. You can use these groups like any other named group, to build a working group to bind to a bone. 11/17/2018 Gwynhala's GwynFlex Tutorial
68
Using the Dividing Plane
One use of the dividing plane is to correct automatic binding problems where a triangle far away from a bone is assigned to that bone, but the triangle itself is hard to access using the mouse (due to other triangles in front of the triangle from all camera angles). In this case, positioning the dividing plane between the bone and the problem triangle(s) and using Group->Split can create a new named group that does not include the problem triangle(s). Then the Group menu, Skeleton->Unbind Bone, and Skeleton->Bind To Bone can be used to correct the binding. 11/17/2018 Gwynhala's GwynFlex Tutorial
69
Gwynhala's GwynFlex Tutorial
Q2Gal Bindings I I’ve decided to start with the bindings that GwynFlex generates automatically, and then modify them, to get my final bindings. I begin by setting the working group to all of the triangles in the mesh I select the Group->Add menu The Select a group dialog box appears I highlight the group named mesh and click OK The entire model turns blue, indicating that all triangles are part of the working group. Now I have GwynFlex create initial bindings for all the enabled bones I select the Skeleton->Guess Bindings menu. GwynFlex becomes unresponsive for a few minutes to calculate the bindings for each bone. The status line at the bottom of the GwynFlex window displays Ready when finished. 11/17/2018 Gwynhala's GwynFlex Tutorial
70
Reviewing the Bindings
Now I review the bindings that GwynFlex generated, since I know that the automatic bindings are only about 70% accurate. To review the bindings, I uncheck Model->Solid (selectable), check View->Bone Bindings, and click on the Left Foot bone. The triangles bound to the Left Foot bone are shown in blue. I examine these using different camera views to see it they match what I want GwynFlex to animate as the model’s left foot. The construction of the model limits what I can do - I can can’t change the triangle shapes. This model was designed with “peg legs”. The main part of the lower leg extends all the way down to the heel, and the toe section is separate. I decide to change the bindings a little, by adding the heel section to the foot bindings. 11/17/2018 Gwynhala's GwynFlex Tutorial
71
Changing Left Foot Bindings
The working group already includes all of the triangles currently bound to the left foot. To add the heel section of the left leg to to the left foot, I: Check Model->Solid (selectable) so I can select triangles using the mouse Check Model->Lock Position so I don’t move the model by mistake Using various camera views, highlight all of the heel triangles I want added to the foot; this adds those triangles to the working group Use the Group->Save menu to save this group with the name left_foot (this will be handy later) Use the Skeleton->Bind to Bone menu to update the bindings for the Left Foot bone; the menu updates the most recently selected bone; when prompted whether it’s OK to overwrite the current bindings, I click OK. The revised Left Foot bone bindings look like this (wireframe, above; solid, below) 11/17/2018 Gwynhala's GwynFlex Tutorial
72
Changing Left Calf Bindings
When GwynFlex guessed the bone bindings, it bound the triangles I added to the Left Foot bone, to the Left Calf (lower leg) bone instead. GwynFlex needs each triangle bound to only one bone. I have to fix the Left Calf bindings by removing the triangles that are now part of the Left Foot bone. To do this I: Press Shift-TAB to select the previous bone in the skeleton, which happens to be the Left Calf bone (I could just click on that bone, but if the model is solid, Shift-TAB is easier) This copies the Left Calf bone triangles to the working group and shoes them in blue on the screen. Select the Group->Subtract menu, enter the name left_foot, and click OK. This subtracts all of the triangles that I saved as part of the left foot from the working group. The results look like this (before, above; after, below) 11/17/2018 Gwynhala's GwynFlex Tutorial
73
More Left Calf Bindings
Checking the Left Calf from other camera angles, I see some triangles near the knee, that should be part of the left calf. To do this, I: Add those to the working group, in the same way I added triangles when updating the left foot. Save the working group as left_calf. Bind the new group to the Left Calf bone. The results look like this (before, above; after, below) Note: Now I will have to fix the Left Thigh (upper leg) bone, since the knee triangles I added are probably bound to it. And so on, and so on, and so on…until each bone has the bindings I want. 11/17/2018 Gwynhala's GwynFlex Tutorial
74
Gwynhala's GwynFlex Tutorial
Left Thigh Bindings The Left Thigh bindings must be updated to remove triangles near the knee that I decided to bind to the Left Calf. The bindings GwynFlex generated for the Left Thigh bone include some triangles in Q2Gal’s buttocks. I think this will cause distortions when I animate the model, so I decide to unbind these triangles from the Left Thigh bone and re-bind them later to one of the pelvis or torso bones. To do this I: Click on blue triangles that I want to remove from the working group; these triangles turn white. Save the working group as left_thigh. Bind the new group to the Left Thigh bone. The results look like this (above, before; below, after) 11/17/2018 Gwynhala's GwynFlex Tutorial
75
Gwynhala's GwynFlex Tutorial
Left Pelvis Bindings The Left Pelvis bone bindings must be adjusted to account for triangles I bound to the Left Thigh instead. I do this the same way as for the previous bone bindings, saving a left_pelvis group. One triangle at the top of the left pelvis bindings (using the Rear View camera setting) looks like it could be assigned to either the right pelvis or the left pelvis or the center pelvis. I could choose one of the pelvic bones, or I could bind the triangle to the lower back. I decided to leave it bound to the left pelvis. When I animate the model, if I see distortion in the lower back or hips, I will re-bind this triangle to the lower back instead of the left pelvis. The result looks like this (rear view, above; front view, below) 11/17/2018 Gwynhala's GwynFlex Tutorial
76
Right Leg & Pelvis Bindings
Once the entire left leg has been checked for desired bone bindings, the right leg bindings can be done similarly. The left_foot, left_calf, left_thigh, and left_pelvis groups that I saved while working on the left leg are useful for helping me make similar binding decisions on the right side of the model. For example, to make the right pelvis bindings similar to the left pelvis bindings, I: Select the Right Pelvis bone to transfer its triangles to the working group Use the Group->Add menu to add the left_pelvis group to the working group. Now, I can use the mouse to add and remove triangles on the right side of the model from the working group, to cover an area similar to that of the left pelvis. (Here, the area is not identical due to differences in the geometry of the left and right sides of the Q2Gal model) When done, I use the Group->Subtract menu to remove all of the left_pelvis triangles from the working group. I save what is left as a right_pelvis group, and bind it to the Right Pelvis bone. The result (for the right pelvis, rear camera view) looks like this. 11/17/2018 Gwynhala's GwynFlex Tutorial
77
Gwynhala's GwynFlex Tutorial
Chest & Torso Bindings When I review the automatic bindings for the Left Chest bone, I see that some triangles in the shoulder pads of Q2Gal’s clothing were not bound to the left chest. In this model, the entire torso is covered in what looks like body armor. I could bind this (later) to the Armor mesh node, except there is no mesh under the body armor in this model. If I bound these left chest triangles to the Left Armor mesh node, the model would have a big hole in it where the chest should be, unless it was wearing armor. Viewing the Left Chest bindings from other camera angles, I suspect that the upper torso (body armor) is a self-contained mesh with no connection to any other part of the model. If this is true, I will get better results selecting the entire body armor and then splitting it into right and left halves using the dividing plane. 11/17/2018 Gwynhala's GwynFlex Tutorial
78
Gwynhala's GwynFlex Tutorial
Upper Torso Bindings I I click on a triangle in the upper torso, and select Group->Flood Add Triangles. Nearly the entire upper torso turns blue, and no other parts of the body turn blue, confirming my suspicion about the upper torso. I add the few triangles that were missed, and save the working group as upper_torso. If I found the upper torso was not a self-contained mesh, I would have corrected the Left Chest bindings like the legs were done. Now I want to split the working group into left and right halves. To do this I: Check View->Dividing Plane to show the dividing plane Click on the dividing plane and position it down the middle of the model (lucky me, this is the default position of the dividing plane) Use Group->Add to make sure the upper_torso group is copied to the working group Use Group->Split to divide the working group into left, right, and center groups. Uncheck View->Dividing Plane when I’m done. 11/17/2018 Gwynhala's GwynFlex Tutorial
79
Upper Torso Bindings II
When I split the upper torso, I named the three groups ut1, ut2, and ut3 because I couldn’t really see which triangles were in which group. Reviewing the groups using Group->New and Group->Add, I see that ut1 is the left side, ut2 is the right side, and ut3 is the center. I rename the groups to left_chest, right_chest, and center_chest for my convenience using Group->Rename. I also edit the groups to make the right side and left side areas similar. I can bind these at least two ways: left_chest to Left Chest, right_chest to Right Chest, and center_chest to Upper Torso bones. This will make the chest look flexible when animated. Or, everything to the Upper Torso bone. This will make the chest look rigid when animated. I decide to bind to the three different bones. The result looks like this (right, center, center, left). 11/17/2018 Gwynhala's GwynFlex Tutorial
80
Lower Torso & Center Pelvis
The automatic bindings for the Lower Torso and Center Pelvis bones look OK. Very few triangles are bound to the Lower Torso in this model, because it was constructed with a self-contained upper torso mesh. The Lower Torso triangles appear on the back (where the lower back is exposed) and on the sides just above the hips. There are also very few Center Pelvis triangles in this model, mostly because I assigned a lot of triangles to the Left Pelvis and Right Pelvis. Really, I had the same choice here as for the upper torso: either bind the entire buttocks area to the Center Pelvis for a rigid look during animation, or bind to three different pelvic bones for a more flexible look. I might re-assign more triangles to the Center Pelvis later if I’m not satisfied with how it animates. Here’s what these bindings look like (Center Pelvis, front; Center Pelvis, rear; Lower Torso, rear). 11/17/2018 Gwynhala's GwynFlex Tutorial
81
Right & Left Arm Bindings
The bindings for the bones in the right and left arms are corrected the same way as I did the right and left legs. GwynFlex made a lot of strange choices in the automatic bindings for the arms on this model (see example to right). Various changes were needed to correct the bindings, but there was nothing tricky or new so I won’t detail them here. Note that all of the Quake 2 model’s mesh related to hands is bound to the Right Hand Open and Left Hand Open bones. Eventually (in Lesson 6) I will have GwynFlex clone these hands to create the Right Grip and Left Grip bones. Note: Here’s an example of an automatic arm binding I had to correct 11/17/2018 Gwynhala's GwynFlex Tutorial
82
Head and Neck Bindings I showed how to correct errors in the the Head bone binding at the beginning of Lesson 5 (see Automatic Binding Errors 1, Figure 16a and Figure 16b). Recall that these errors occurred for two rasons: For most models, including Q2Gal, the lower part of the face mesh is below the neck joint (typically placed at the base of the skull). The pony-tail was a self-contained mesh; I had to add it to the head bindings manually. After adding triangles previously assigned to the Neck bone, to the Head bone, I change the bindings for the Neck bone so that each triangle is bound only to one bone. All of the bone bindings have now been corrected. I use File->Save Bindings to save the bindings as file tutorial.bnd, so that I can re-load them later if necessary. WooHoo! All of the bindings are done. Let’s animate! 11/17/2018 Gwynhala's GwynFlex Tutorial
83
Making the Model Poseable I
I’ve posed the GwynFlex skeleton inside my salute08 base pose of Q2Gal, and I’ve bound all of the mesh of the Q2Gal model to various bones. I’ve saved my work up to this point, so I can recover it using the File menu if I have to re-start GwynFlex for any reason. Now it’s time to have GwynFlex check my work, and prepare the model for animation. If no errors are found, I will be ready to have GwynFlex create a test model to view using the QMView model viewer that comes on the Heretic II CD. If GwynFlex finds errors in my work (such as triangles bound to more than one bone, or triangles not bound to any bone), I will have to update the bindings and try again. The secret command that tells GwynFlex to check my work is Model->Make Poseable. I select Model->Make Poseable. Almost immediately (darn), the following dialog box appears: 11/17/2018 Gwynhala's GwynFlex Tutorial
84
Making the Model Poseable II
The dialog box tells me that some triangles are not assigned to any bone. GwynFlex has set the working group to be all the triangles that are not bound to any bone. Chances are, some of the unassigned triangles belong to one bone, others belong to another, and so on - no single bone is missing all of these triangles. I click OK to dismiss the dialog box, I use the Group->Save menu to save the working group as error1. This will let me re-examine the triangles later. Next, I use the Camera menu to look at the model from various angles, trying to see all of the unassigned triangles and figure out which bones they should be bound to. The front (left) and rear (right) views look like this, showing 6 triangles that need to be assigned to torso, pelvis, or upper leg bones: 11/17/2018 Gwynhala's GwynFlex Tutorial
85
Making the Model Poseable III
I decide to assign the two triangles peeking out below the body armor at the front of the model to the bindings for the Lower Torso bone. To do this I: Uncheck Model->Solid (poseable) so I can get at the bones inside the model Check View->Bone Bindings so GwynFlex will set the working group to the triangles bound to the most recently selected bone. Click on the Lower Torso bone to see the triangles bound to it. Check Model->Solid (poseable) so I can select triangles using the mouse. Click on the two triangles I want to add, to turn them blue and add them to the working group (I remember where they were - if I forget, I can look at the error1 group to refresh my memory) Use Skeleton->Bind to Bone to update the bindings for the Lower Torso bone. Use File->Save Bindings to save the revised bindings. I decide to add the four triangles around the right buttocks to the bindings for the Right Pelvis bone. The procedure is similar to that used above for the Lower Torso. When finished, I save the bindings and try Model->Make Poseable again. Drat! 11/17/2018 Gwynhala's GwynFlex Tutorial
86
Making the Model Posable IV
I dismiss the dialog box and save the working group (the unassigned triangles) as error2. A more careful check of the model from different camera angles reveals a triangle that should be assigned to the Right Foot bone. I correct the Right Foot bindings and try Model->Make Poseable. Curses! It fails again, and I save the error3 group. This time, the error is very subtle. The triangle I’m looking for doesn’t show up when the model is solid, because it’s hidden under the “body armor” mesh. The triangle barely shows up when viewing the model as a wire frame, and then only from certain angles. I can’t find any other triangles, but I’m not sure this is the only one. I’ll gamble that it is. Here’s a front view where one edge of the triangle is visible near the right (circled in red) 11/17/2018 Gwynhala's GwynFlex Tutorial
87
Finally - A Poseable Model!
I decide to bind the error3 group to the lower torso. I do this, save the bindings, and try Model->Make Poseable again. This time, it works! In this example, there were no errors that a triangle was bound to more than one bone. Handle such an error similarly to the unassigned triangles error, except figure out which bones’ bindings to remove the triangle(s) from. Now, the model is poseable. This means that GwynFlex has enough information to reposition the Q2Gal mesh into any pose stored in mocap.spz or other motion capture files. I can try this out by checking the View->Generated Model menu item, and then using File->Load Pose to load poses from the mocap.spz file. Since the model is now poseable, and I have View->Generated Model checked, loading poses both the skeleton and the model. I uncheck View->Generated Model when I need to continue editing the bone bindings or other information. Several poses loaded for Q2Gal are shown below. 11/17/2018 Gwynhala's GwynFlex Tutorial
88
Gwynhala's GwynFlex Tutorial
Happy! Happy! Joy! Joy! Well, Lesson 5 is nearly over. Whew! I’ve tried various Corvus poses out on Q2Gal, and she looks great! You might not be so fortunate on your first few tries at getting the bone bindings just right. For example, when you try out poses from mocap.spz on your model, you might discover some of the kinds of distortions we discussed in Lesson 3 (see Wrong Bone Bindings). If so, you will have to adjust the bone bindings and try again. I haven’t added any weapons to Q2Gal yet. In Lesson 6: Weaponry, I’ll show you how to add the Blade Staff, Hellstaff, Bows, and Armor. Then in Lesson 7: Skin Patchwork I’ll show you how to make a skin for your model and all of its weapons. However, if you are making a model that does not need weapons - such as a model for a magic-using character class in a mod like The Heretic Fortress - Surprise! You’re finished! You can skip ahead to Lesson 8: The Final Model, where I’ll show you how to export a usable flexmodel from GwynFlex and use it in the Heretic II game. 11/17/2018 Gwynhala's GwynFlex Tutorial
89
Lesson 6 - Weaponry
90
Gwynhala's GwynFlex Tutorial
Weaponry Heretic II player models use both hand-held weapons and magic in combat. With the right hand, the character can wield a Blade Staff or the Hellstaff With the left hand, the character can fire a Storm Bow or Phoenix Bow The character can wear gold or silver armor on its torso When not using a weapon that it has acquired, the character carries that weapon “stored” either on its back or on its hip. In Heretic II, all of the weapons are stored in the same tris.fm file as the player model; this differs from Quake 2 which uses separate tris.md2 and weapon.md2 files. Each weapon , stored weapon and armor has its own mesh node in the flexmodel. Each hand has a 2nd mesh node, used in place of the normal hand mesh node when the character is holding a weapon in that hand. The mocap.spz motion capture file includes animation information for all of the standard weapons and armor; this allows GwynFlex to animate weapons in the same way it animates the character (that is, so that the weapon stays in the character’s hand and points properly as the character moves) Heretic II uses a single skin file for both the player model and the weapons. When converting a Quake 2 model for use in Heretic II, all of the Heretic II weapons must be added to the player model and to the skin. In this lesson, we will add standard weapons (but not armor) to the Q2Gal player model. 11/17/2018 Gwynhala's GwynFlex Tutorial
91
Gwynhala's GwynFlex Tutorial
Cloning the Hands I The first step in adding weapons to Q2Gal is to create a 2nd pair of hands to hold the weapons. Quake 2 models have only one pair of hands; Heretic II models have two pairs. Ideally, the normal hands would be open palms, while the weapon-holding hands would be clenched fists. GwynFlex can create a 2nd pair of hands to hold weapons, but it is identical to the original pair - a clone of the originals. The base pose I chose for Q2Gal has a cupped right hand a clenched fist left hand. In Lesson 5, I bound these to the Right Hand Open and Left Hand Open bones, respectively. The menu that tells GwynFlex to create a 2nd pair of hands is Model->Clone Hands When Model->Clone Hands is used after Model->Make Poseable, a bug in GwynFlex B10 changes the orientation of the model in a way that can’t be restored using the File->Load Orientation menu. Here, I will use a procedure that avoids this. To clone the hands I: Make sure that the bones, pose, orientation, and bindings I set up for Q2Gal are saved. Exit, and then re-start, the GwynFlex program. Use File->Load Bones, to load bone lengths from tutorial.bnz. Use File->Load Pose, to load the aligned skeletal pose from tutorial.spz. On the File menu, the “recent files” section near the bottom still lists the Q2Gal model’s tris.md2 file; I select it and load the salute08 base pose of Q2Gal. Use File->Load Orientation, to get the mesh facing the right direction and the hips aligned from tutorial.ori. Use File->Load Bindings, to get the bone bindings from tutorial.bnd. Use Model->Clone Hands to create the mesh, groups, and bindings for the 2nd set of hands. Note: GwynFlex is free, not perfect. I’ll try to make this easier in version B11 11/17/2018 Gwynhala's GwynFlex Tutorial
92
Gwynhala's GwynFlex Tutorial
Cloning the Hands II Creating the 2nd set of hands automatically changes some GwynFlex settings: The mesh bound to the Right Hand Open and Left Hand Open bones is duplicated, increasing the number of triangles in the mesh. The duplicate mesh is bound to the Right hand Closed and Left Hand Closed bones, respectively. Two new triangle groups are created - RHC for the triangles bound to the Right Closed Hand, and LHC for the triangles bound to the Left Closed Hand. The texture coordinates of the new hands are set identically to those of the old hands (both pairs of hands use the same skin). The Right Grip and Left Bow/Grip mesh nodes are automatically enabled. The lengths of the Right Hand Closed and Left Hand Closed bones are set to 2/3 the length of the corresponding open hand bones (to place the joint at the end of the bone in the middle of the hand, where a weapon would be held. The Right Hand Closed and Left Hand Closed bones are aligned with the corresponding open hand bones, and their twists are set identically to the corresponding open hand bones. 11/17/2018 Gwynhala's GwynFlex Tutorial
93
Gwynhala's GwynFlex Tutorial
A Whole New Model... Cloning the hands, and adding weapons, changed the number of triangles and 3D vertices in the mesh. THIS IS NOT THE MESH I STARTED WITH! It looks the same, but from this point on: All GwynFlex internal memory has been updated for the new triangle and vertex counts I can’t restore the mesh using File->Open to reload it from the Quake 2 model I can’t restore the pose with File->Load Pose using the tutorial.spz file I can’t restore the bones with File->Load Bones using the tutorial.bnz file I can’t restore the bindings with File->Load Bindings using the tutorial.bnd file In some circumstances, I can’t restore the position of the model with File->Load Orientation using the tutorial.ori file After cloning the hands I save the pose, bones, orientation and bindings of this new mesh, using the new file names tut2.spz, tut2.bnz, tut2.ori, and tut2.bnd. This is a whole new model as far as GwynFlex is concerned. I can use the new tut2.xxx files to restore aspects of this new model, but I can’t save / load its mesh. After cloning the hands and saving out the new Q2Gal bones, pose, orientation, and bindings, I am ready to import weapons and armor; each new weapon will add more triangles to the model. 11/17/2018 Gwynhala's GwynFlex Tutorial
94
Gwynhala's GwynFlex Tutorial
How Props Work Weapons and armor are imported into GwynFlex as props - independent models that are positioned relative to the base pose, then merged with the 3D mesh of the player model and bound to bones. Each prop has its own texture (skin mapping) coordinates. When a prop is merged with the 3D mesh of the player model, GwynFlex also merges the texture coordinates of the prop and the player model. Multiple props can be merged into the 3D mesh of the player model, but only one prop at a time. Weapons and armor are added one at a time as separate props. These GwynFlex menus manipulate props: File->Open Prop: Imports a prop as an independent model (movable, self-contained mesh). Ctrl-X: Deletes a selected prop that has not been merged. Model->Merge Prop: Merges the selected prop into the 3D mesh of the player model, creates groups for the mesh of the prop, and deletes the independent model A prop behaves differently before and after being merged: Before merging, I can move a prop around and rotate it using the mouse or keyboard (like moving the model); I can also delete it (for example, if I want a different weapon) using the Ctrl-X keys. After merging, the prop is just another part of the player model base pose and moves with the player model; I can use the mouse to select triangles on the prop, cerate working groups that contain triangles of the prop, and bind these triangles to one of the bones that make up a weapon or armor mesh node. Props that have been merged will be animated along with the player model using motion capture data from the mocap.spz file; the animations will match the original Corvus weapon types. 11/17/2018 Gwynhala's GwynFlex Tutorial
95
More About The Skin The design of Heretic II (and a limitation of certain 3D graphics cards) requires that all Heretic II player model skins are 256x256 pixels at 8-bit color resolution. Most skin texture maps have unused areas of varying sizes, For example, in Figure 17a, unused areas of the Q2Gal skin texture map are colored bright blue. Whenever GwynFlex merges a prop, it searches the player model skin texture map for an unused rectangular area big enough for the prop’s skin. If enough area is found, GwynFlex maps the prop texture into the unused area (Figure 17b). If not, GwynFlex first tries scaling the prop’s skin, and then scaling both the player model’s skin and the prop’s skin, by between 95% and 50% to fit both into the 256x256 area allowed. Scaling sacrifices some detail in order to get everything to fit nicely. Figure 17a: Q2Gal Skin Texture Map Showing Texture Triangle Outlines (white) and Unused Areas (blue) Figure 17b: Same Q2Gal Skin Texture Map After Mapping Weapon Props to Unused Areas (Some Prop Textures Have Been Scaled) 11/17/2018 Gwynhala's GwynFlex Tutorial
96
Gwynhala's GwynFlex Tutorial
The BladeStaff I First, I’ll add a Blade Staff to the Q2Gal model. GwynFlex B10 includes a 3D model and skin for Corvus’ Blade Staff that I will use. The 3D model is in the file BladeStaff.obj, which can be imported as a prop The skin is in the file BladeStaff.tga Obviously, the Quake 2 model I am working with was never intended to carry a Blade Staff. When I enable the Right Grip and Blade Staff mesh nodes, I see the staff posed in a position left over from the conjure11 skeletal pose I started with. Here’s the great thing: as long as The upper and lower staff form a straight line, The upper and lower staff bones have twists 180 degrees apart, and I line the prop from BladeStaff.obj correctly with the bone twists, it doesn’t matter what position the staff is in for my base frame - GwynFlex will calculate the correcct position for all of the frames during animation. 11/17/2018 Gwynhala's GwynFlex Tutorial
97
Gwynhala's GwynFlex Tutorial
The BladeStaff II I use File->Open Prop to import the blade staff prop from BladeStaff.obj. This works just like importing the base pose, except I specify a file type of WaveFront (.OBJ) instead of Quake 2 (.MD2) The imported prop is highlighted in red (see example to right) The prop doesn’t line up at all with the location of the blade staff bones - I will have to move the prop. Figure 9 in Lesson 3 (see Piercing the Flesh I) shows the blade of the staff should face away from the twist of the Top Half of Staff bone. I click the bone to note its twist, and use the keyboard to move the staff prop into position. Satisfied with the position and twist of the Blade Staff, File->Save Orientation lets me save this position of the prop in case I need to reload it later. 11/17/2018 Gwynhala's GwynFlex Tutorial
98
Gwynhala's GwynFlex Tutorial
The Blade Staff III Now I am ready to merge the Blade Staff prop into the player model. I select Model->Merge Prop, and GwynFlex displays the dialog box to the right. Since I want GwynFlex to merge my skins, I click OK. Two more dialog boxes appear to tell me how GwynFlex has combined the skins for the player model and the prop. The information in these dialog boxes is VERY important; I will need it to make a skin for the combined model. I write it down BEFORE clicking OK: model, 242x185 at (5,4), will be same bladestaff prop, 23x218 at (3,3), will be 100%, 90 degrees (swap x,y / flip x) at (1,191) 11/17/2018 Gwynhala's GwynFlex Tutorial
99
Gwynhala's GwynFlex Tutorial
The Blade Staff IV Now that the blade staff prop has been merged with the base pose, I need to select all of the triangles of the blade staff and bind them to the Top Half of Staff bone. To make this easy, GwynFlex created a group named Blade_Staff that contains all of the triangles of the prop. It did this because the BladeStaff.obj file that I imported the prop from has group definitions built-in. The sequence I use to bind the Blade Staff: Uncheck Model->Solid (selectable). Click on Top Half of Staff bone. Use Group->New to empty the working group, then Group->Add to add the Blade_Staff group to the working group. Use Skeleton->Bind to Bone to create the bindings. Note that I bound the entire staff prop to the Top Half of Staff bone, and nothing to the Bottom Half of Staff bone (which exists only for reference use by GwynFlex). 11/17/2018 Gwynhala's GwynFlex Tutorial
100
Gwynhala's GwynFlex Tutorial
The HellStaff The Hellstaff is added exactly like the Blade Staff. The prop is in HellStaff.obj. The group that gets created when the prop is merged is Hellstaff. Figure 9 in Lesson 3 (see Piercing the Flesh I) shows the chin of the hellstaff should face away from the twist of the Top Half of Staff bone. I click the bone to note its twist, and use the keyboard to move the staff prop into position. When I merge the prop. I record the very important skin texture map information that GwynFlex displays: model, 246x210 at (1,4), will be same hellstaff prop, 114x44 at (3,3), will be 100% at (58,199) I bind the entire hellstaff to the Top Half of Hellstaff bone. 11/17/2018 Gwynhala's GwynFlex Tutorial
101
Gwynhala's GwynFlex Tutorial
The Bow in Use The Bow in Use is also added like the Blade Staff. The mesh node is Left Bow / Grip. The prop is in Bow.obj. The group that gets created when the prop is merged is Stored_Bow. Figure 9 in Lesson 3 (see Piercing the Flesh I) shows the twist of the Bow in Use bone should point out the front of the bow. The Bow in Use bone represents only the bottom half of the bow; the middle of the bow itself is positioned over the fist. When I merge the prop. I record the very important skin texture map information that GwynFlex displays: model, 246x239 at (1,4), will be same bow in use prop, 24x86 at (5,3), will be 100%, 90 degrees (swap x,y / flip x) at (161,199) 11/17/2018 Gwynhala's GwynFlex Tutorial
102
Gwynhala's GwynFlex Tutorial
The Stored Bow The Stored Bow is added like the Bow in Use. The mesh node is Stored Bow. The prop is in Bow.obj - same file as for the Bow in Use. The group that gets created when the prop is merged is xStored_Bow (GwynFlex creates a unique group name) Figure 9 in Lesson 3 (see Piercing the Flesh I) shows the twist of the Stored Bow bone should point out the front of the bow. The Stored Bow bone represents only the bottom half of the bow; the middle of the bow itself is positioned over the fist. When I merge the prop. I record the very important skin texture map information that GwynFlex displays: model, 246x239 at (1,4), will be same stored bow prop, 24x86 at (5,3), will be 90%, 90 degrees (swap x,y / flip x) at (174,223) 11/17/2018 Gwynhala's GwynFlex Tutorial
103
Gwynhala's GwynFlex Tutorial
The Stored Staff The Stored Staff is also added like the Blade Staff. The mesh node is Stored Staff. The prop is in StoredStaff.obj. The group that gets created when the prop is merged is Stored_Staff. The stored staff is just a cylinder hanging at the model’s side. The bone twist isn’t really important for this prop, but the ideal twist is show in Figure 9 in Lesson 3 (see Piercing the Flesh I). When I merge the prop. I record the very important skin texture map information that GwynFlex displays: model, 249x240 at (1,4), will be same stored staff prop, 7x36 at (3,3), will be 100% at (123,18) 11/17/2018 Gwynhala's GwynFlex Tutorial
104
Gwynhala's GwynFlex Tutorial
Armor Q2Gal was originally modeled by Id Software, wearing body armor on the upper torso. The original model has no option to remove this armor. Since this model is always wearing body armor, and since there is no mesh beneath the body armor, I decided that I would not bind anything to the Armor mesh node of Q2Gal. This doesn’t really impact game play; the main impact of having nothing bound to the Armor mesh node will be that in Death Match, other players won’t be able to tell whether Q2Gal is wearing none, silver, or gold armor. If I were adding armor to this model, I’d do it just like any of the weapons: import an armor prop, position it, and merge it into the model. True Confession: Armor is difficult to animate properly with GwynFlex, because separate bones are used for the armor and upper torso. If the Upper Torso or Left Chest bone happens to twist slightly differently than the Armor bone, part of the model’s body pokes out through the armor. It’s not a pretty sight. So consider yourself lucky that in this first tutorial we get to avoid armor. 11/17/2018 Gwynhala's GwynFlex Tutorial
105
Gwynhala's GwynFlex Tutorial
Saving My Work Wow! All of the weapons are added, and the Q2Gal model is ready for full animation. This is quite an accomplishment! I save the current bones, pose, bindings, and orientation of the model in tut2.bnz, tut2.spz, tut2.ori, and tut2.bnd. GwynFlex B10 does not provide a way to save the 3D mesh with all the weapons added, or the groups that have been defined. The closest thing to saving the mesh is to uncheck Skeleton->Scale to Ground, then use the File->Export->Flex Model From menu, specify tutorial.fm as the output file, and specify tut2.spz as the motion capture data file. This will create a flexmodel with a single animation frame matching the base pose I’m using, salute08, with all the added weapons. I can inspect the skin texture map of the new model by opening tutorial.fm with the QMView model viewer and selecting the skin view. It looks like the image below. In Lesson 7: Skin Patchwork, I’ll show you how to add actual weapon textures to the blue areas of the skin texture map so that the weapons will look right during game play. 11/17/2018 Gwynhala's GwynFlex Tutorial
106
Gwynhala's GwynFlex Tutorial
Its Alive! Once I’ve exported a single frame of animation to the file tutorial.fm, I’m ready to export the entire model with weapons. Although I haven’t created the skins for the model yet, working through Lesson 1 - Lesson 6 has told GwynFlex everything it needs to know to create the tris.fm file and frames of animation that is a Heretic II player model. The steps for exporting the Heretic II player model are described in more detail in Lesson 8: The Final Model. No time like the present though, so I’ll go ahead and export the model now. To export the model and weapons as a tris.fm file using all of the standard Corvus poses from mocap.spz, I: Uncheck View->Generated Model; if this is checked, every pose will be displayed and animation will take much longer. Check Skeleton->Scale to Ground so the feet of the generated model will touch the “ground” when standing in Heretic II. Select File->Export->Flex Model to begin the export. If any “OK to overwrite…?” dialog boxes are displayed, I click Yes for each. GwynFlex displays a “Save As” dialog box; I navigate to the folder where I want to save the model, enter the file name tris.fm, and click Save. GwynFlex begins writing the model to the tris.fm file that I specified, updating the status bar regularly to show progress. After about 5 minutes of processing (400 MHz K6-2 CPU), the model is done! GwynFlex displays Ready in the status bar. 11/17/2018 Gwynhala's GwynFlex Tutorial
107
Lesson 7 - Skin Patchwork
108
Gwynhala's GwynFlex Tutorial
Skin Patchwork In Lesson 1, I made a basic 256x256 skin for Q2Gal and saved it as Q2Gal.bmp. In Lesson 6, I merged all of the standard Heretic II weapons into the Q2Gal model, and created a tris.fm file containing the fully animated model. While merging the weapons, GwynFlex displayed dialog boxes with information about how it was mapping and scaling the weapon skins onto the 256x256 Q2Gal template. Now I need a skin that includes the Q2Gal texture and all of the weapon textures, using the information that GwynFlex displayed in those dialog boxes. I call this lesson Skin Patchwork, because the final skin will be a 256x256 patchwork of the original Q2Gal skin and weapon skins. Note: This is a screenshot of the Q2Gal.bmp skin I made in Lesson 1. The screenshot also includes the window of the paint program I used, which is not part of the skin. 11/17/2018 Gwynhala's GwynFlex Tutorial
109
Gwynhala's GwynFlex Tutorial
Weapon Skins In addition to the Q2Gal.bmp skin, I have the weapon skins that came with GwynFlex B10. BladeStaff.tga: the blade staff skin BladeGold.tga: the golden blade staff skin HellStaff.tga: the Hellstaff skin Storm.tga: the Storm Bow skin Phoenix.tga: the Phoenix Bow skin StoredStaff.tga: the stored staff skin Note that no armor skin is included. All of the weapon skins are stored: In the same folder as GwynFlex.exe. In 24-bit color, in Targa (.tga) file format that should be readable by most graphics programs. The weapon skins have been optimized to be very compact and rectangular. This is why the layout of the skins is different than in the Corvus model. Parts have been moved around, but the basic shapes of weapon skin elements are identical to the Corvus model. Note: These are the skins for standard Corvus weaponry, the weapons I used for Q2Gal. If I had decided to give Q2Gal a different weapon (say a Quake 2 blaster instead of the Hellstaff) I would need to create a compact, rectangular skin for the new weapon to allow GwynFlex to merge its skin with the rest of the model. 11/17/2018 Gwynhala's GwynFlex Tutorial
110
Gwynhala's GwynFlex Tutorial
The Dialog Box Said... As I merged each weapon into the Q2Gal model, GwynFlex displayed two dialog boxes with information about skin mapping: The first, telling how (if at all) GwynFlex moved or scaled the skin of the player model. The second, telling where GwynFlex positioned the weapon skin in an unused area of the player model skin. For Q2Gal, none of the dialog boxes indicated any movement or scaling of the player model skin - the scale was always 100% and the “was” and “will be” coordinates matched in every message. This is not always the case for models; it makes this one a bit easier. The message for each weapon, IN THE ORDER I ADDED WEAPONS, was something like this: Blade Staff: 23x218 at (3,3), will be 100%, 90 degrees (swap x,y / flip x) at (1,191) Hellstaff: 114x44 at (3,3), will be 100% at (58,199) Bow In Use: 24x86 at (5,3), will be 100%, 90 degrees (swap x,y / flip x) at (161,199) Stored Bow: 24x86 at (5,3), will be 90%, 90 degrees (swap x,y / flip x) at (174,223) Stored Staff: 7x36 at (3,3), will be 100% at (123,18) 11/17/2018 Gwynhala's GwynFlex Tutorial
111
Gwynhala's GwynFlex Tutorial
The Dialog Box Meant... What do these messages really mean? I’ll explain the message for the Stored Bow as an example, since it is the most complicated. The message was something like 24x86 at (5,3), will be 90%, 90 degrees (swap x,y / flip x) at (174,223) To explain this message, I’ll break it up into 4 parts. The first part is 24x86 at (5,3), telling the area used by the original weapon skin. Seen see at right, the Stored Bow doesn’t use its entire skin rectangle - blue on the skin marks unused areas. For the Stored Bow skin (either Storm.tga or Phoenix.tga) the area is always is 24 pixels wide, 86 pixels high, with its upper-left corner at coordinates (5,3) in the image. The second part is will be 90%, which tells whether GwynFlex scaled the skin coordinates. 100% indicates no scaling. Any other number indicates that the skin was “shrunk” to a percentage of its original size. In this case, GwynFlex was not able to find a 24x86 pixel unused area in the model skin, but it was able to find an unused area 90% of this size. The third part is 90 degrees (swap x,y / flip x), which tells whether GwynFlex rotated the skin coordinates. If this part is missing, GwynFlex did not have to rotate the skin coordinates. If present, it tells how GwynFlex rotated the used area of the skin to fit it into an unused area of the model skin. In this case, GwynFlex rotated the skin coordinates 90 degrees clockwise. The fourth part is at (174,223), indicating the coordinates on the model skin texture map of the upper-left corner of the unused area where the weapon texture was placed. In this case, the weapon texture was placed at X=174, Y=223 in the 256x256 player model skin texture map. In other words, GwynFlex scaled the 24x86 skin rectangle of the Stored Bow weapon to 90% of full size, and turned it on its side, to fit into an unused area at (174,223) of the model skin.. Only the skin map was adjusted (the effect is a minor loss of skin detail for the Stored Bow); the size of the weapon was not changed. 11/17/2018 Gwynhala's GwynFlex Tutorial
112
Merging Two Skins I add the skins for the weapons to be basic Q2Gal skin, in the same order that I added the weapons. The order is very important if the model skin was scaled during any prop merge;each time the model skin is scaled, the skins for all previously merged props are scaled along with it. Fortunately for Q2Gal, GwynFlex was able to add all of the weapons without scaling the model skin. Since I merged the Blade Staff prop first, I merge its skin first. I open both the Q2Gal.bmp file (from Lesson 1) and the BladeStaff.tga file (that has the skin for the Blade Staff) as two images in the same paint program. I convert the Q2Gal.bmp image to 24-bit color - I want maximum color detail during merging. See Figure 18a. The blade staff skin information GwynFlex displayed is: 23x218 at (3,3), will be 100%, 90 degrees (swap x,y / flip x) at (1,191) Using the mouse, I select a 23x218 pixel area of the Blade Staff skin with upper left corner (3,3), rotate it right 90 degrees, copy it, and paste it onto the Q2Gal skin (scale was 100%, so no scaling needed). I move the pasted item so that its upper left corner is at (1,191) on the Q2Gal skin. See Figure 18b. That’s it - the Blade Staff skin is merged. I close the BladeStaff.tga file, save my modified Q2Gal.bmp skin (still as 24-bit color) and continue on with the other weapons. Figure 18a: Q2Gal and Blade Staff Skins in Paint Program Figure 18b: Q2Gal Skin With Blade Staff Skin Merged 11/17/2018 Gwynhala's GwynFlex Tutorial
113
More Merging I merge the HellStaff and Bow In Use skins very much like the Blade Staff skin. For the HellStaff, I use the HellStaff.tga skin, and I don’t have to rotate the selected part of the skin before copying it. For the Bow In Use, I use the Storm.tga skin (I’ll use the Phoenix.tga skin later, when I make the “damaged” skin). In each case, I use the coordinates and rectangle size that GwynFlex displayed during the merge of that weapon into the model. After adding these two weapons, it looks like Figure 18c. The Stored Bow is a bit different. Here, GwynFlex scaled the weapon skin by 90%. The Stored Bow information GwynFlex displayed is: 24x86 at (5,3), will be 90%, 90 degrees (swap x,y / flip x) at (174,223) My paint program won’t let me scale a selected area - I can only scale the whole image. I scale the whole Storm.tga image to 90% of its original size, then calculate 90% of each of the numbers displayed by GwynFlex during merging: (5,3) becomes (4.5,2.7), and 24x86 becomes 21.6x77.4; I round these to (5,3) and 22x77 Then I merge the scaled version of the skin, using the scaled information instead of the original GwynFlex information; that is, I pretend the information was: 22x77 at (5,3), will be 100%, 90 degrees (swap x,y / flip x) at (174,223). See Figure 18d. Figure 18c: Q2Gal Skin With Blade, Hellstaff, Storm Bow Figure 18d: The Stored Bow Skin is Added 11/17/2018 Gwynhala's GwynFlex Tutorial
114
Gwynhala's GwynFlex Tutorial
An Interesting Merge I have only one weapon left to merge: the Stored Staff. Merging this weapon is really the same as merging the Blade Staff. The skin file is StoredStaff.tga, and no scaling is needed. The interesting thing about this skin, is where GwynFlex decided to put it in the Q2Gal map. The information displayed by GwynFlex for the Stored Staff is: 7x36 at (3,3), will be 100% at (123,18) This is somewhere in the middle of the original Q2Gal skin! See Figure 18e. Nothing is wrong with this placement - it’s actually quite clever. The skin for the Stored Staff is quite small, and GwynFlex was able to find an unused area of the correct size in the original skin . Don’t be alarmed if GwynFlex does this for a Quake 2 (or other) model that you are converting. At this point, all of the weapons have been merged and I have a complete Q2Gal.bmp skin for the Q2Gal player model. I save Q2Gal.bmp and prepare to create the “damaged” skin. Figure 18e: The Stored Staff Skin is Added (circled in red to show placement) Note: The changing black and white background colors in Figure 18a - Figure 18e are caused by the program used to create this tutorial. They are unimportant. 11/17/2018 Gwynhala's GwynFlex Tutorial
115
Gwynhala's GwynFlex Tutorial
The Damaged Skin I Although I have a complete skin for Q2Gal, I have not yet used the BladeGold.tga and Phoenix.tga weapon skins. I mentioned in Lesson 1 that Heretic II models require two skins: a “normal” skin (the one I just made for Q2Gal) and a “damaged” skin. The BladeGold.tga and Phoenix.tga weapon skins are used on the “damaged” version of the Q2Gal Skin. To create a “damaged” skin, I make a copy of the “normal” skin and add the suffix “Dmg” to the file name. In this case, I save the copy as Q2GalDmg.bmp. Now I need to edit the “damaged” version of the skin. I need to make four changes: Replace the area that the BladeStaff.tga skin was copied to, with the same area (at the same scale and rotation) from the BladeGold.tga skin. Replace the area that the Storm.tga skin was copied to for the Bow In Use, with the same area (at the same scale and rotation) from the Phoenix.tga skin. Replace the area that the Storm.tga skin was copied to for the Stored Bow, with the same area (at the same scale and rotation) from the Phoenix.tga skin. Add images of bloody wounds on the head, arms, legs, and torso of the player model areas of the skin. 11/17/2018 Gwynhala's GwynFlex Tutorial
116
Gwynhala's GwynFlex Tutorial
The Damaged Skin II One of the weapons was scaled to 90% of original size in the Q2Gal.bmp skin. This weapon (the Stored Bow) must also be scaled in the Q2GalDmg.bmp skin. I have two options for replacing the bow and staff weapons in the damaged skin: Follow all the steps of precisely placing each weapon skin on the original Q2Gal.bmp skin (if I still have an unmodified copy of it around); in place of BladeStaff.tga I use BladeGold.tga, and in place of Storm.tga I use Phoenix.tga to create the proper weapon skins; then add the bloody wounds. Start with the fully modified Q2Gal.bmp skin, replace those parts of the skin that need to be different; then add the bloody wounds. For Q2Gal, the only tricky part of the skin is the Stored Bow, so I pick the 2nd option. My finished damaged skin is shown at the right. I save it as Q2GalDmg.bmp. That’s it for Lesson 7. If you’ve made it this far, go out and buy yourself a nice toy, make love to someone special (or not…), or gloat in front of your friends - you are a real achiever. All that’s left now is Lesson 8: The Final Model. See you there! 11/17/2018 Gwynhala's GwynFlex Tutorial
117
Lesson 8 - The Final Model
118
Gwynhala's GwynFlex Tutorial
The Final Model Yay! I am now done with the model (Lesson 6) and both skins (Lesson 7) for the Q2Gal model. At this point I’ve told GwynFlex everything it needs to animate my Quake 2 model (and any weapons) for use in Heretic II. The final steps in creating the animated Heretic II model are: Converting my “normal” skin and “damaged” skin to the .m8 format used by Heretic II Exporting a tris.fm (flexmodel) file containing my model and all animation frames Copying everything Heretic II needs for the new model into a new directory in the heretic ii\base\players\ folder on my hard disk. 11/17/2018 Gwynhala's GwynFlex Tutorial
119
Getting Skins to .m8 Format
I think Aaron Taylor’s MIPMaker is the easiest tool to use for getting normal and damaged skins into the .m8 format required buy Heretic II. MIPMaker is available on-line for free at <insert URL here> Eventually, this part of the tutorial will tell you how to use MIPMaker. It’s not difficult, I just haven’t written it down yet. If you’ve ever made a skin for the Corvus or Kiera player models that come with Heretic II, you probably already have a favorite way of making .m8 files. Go ahead and keep using what you’re comfortable with. If you’ve never made a skin before, either read the MIPMaker instructions or ask a friend to convert the skins for you. 11/17/2018 Gwynhala's GwynFlex Tutorial
120
Model Export: With Weapons
GwynFlex B10 does not allow me to save the mesh of my model, so once I have cloned the hands or merged any weapon props I need to keep GwynFlex running until the finished model has been exported. All the time that I was cloning the hands and merging weapon props, I deliberately avoided using the Model->Make Poseable menu - mainly to work around a bug in GwynFlex B10 that causes problems in model orientation if additional mesh is added after making the model poseable. I don’t need to use Model->Make Poseable at all, since GwynFlex will perform equivalent operations automatically as part of exporting the flexmodel. To export the model and weapons as a tris.fm file using all of the standard Corvus poses from mocap.spz, I: Uncheck View->Generated Model; if this is checked, every pose will be displayed and animation will take much longer. Check Skeleton->Scale to Ground so the feet of the generated model will touch the “ground” when standing in Heretic II. Select File->Export->Flex Model to begin the export. If any “OK to overwrite…?” dialog boxes are displayed, I click Yes for each. GwynFlex displays a “Save As” dialog box; I navigate to the folder where I want to save the model, enter the file name tris.fm, and click Save. GwynFlex begins writing the model to the tris.fm file that I specified, updating the status bar regularly to show progress. After about 5 minutes of processing (400 MHz K6-2 CPU), the model is done! GwynFlex displays Ready in the status bar. 11/17/2018 Gwynhala's GwynFlex Tutorial
121
Model Export: No Weapons
This procedure works ONLY if the model has no weapons or other merged props; otherwise, see Model Export: With Weapons. I’ve quit GwynFlex to do some skin editing. When I start GwynFlex again, I need to get my pose and bindings set up to export the model. File->Load Bones, to load bone lengths from tutorial.bnz File->Load Pose, to load the salute08 skeletal pose from tutorial.spz On the File menu, the “recent files” section near the bottom still lists the Q2Gal model’s tris.md2 file; I load that to get the mesh; and import the salute08 pose File->Load Orientation, to get the mesh facing the right direction and the hips aligned from tutorial.ori File->Load Bindings, to get the bone bindings from tutorial.bnd Now, to export the model as a tris.fm file using all of the standard Corvus poses from mocap.spz, I: Uncheck View->Generated Model; if this is checked, every pose will be displayed and animation will take much longer. Check Skeleton->Scale to Ground so the feet of the generated model will touch the “ground” when standing in Heretic II. Select File->Export->Flex Model to begin the export. If any “OK to overwrite…?” dialog boxes are displayed, I click Yes for each. GwynFlex displays a “Save As” dialog box; I navigate to the folder where I want to save the model, enter the file name tris.fm, and click Save. GwynFlex begins writing the model to the tris.fm file that I specified, updating the status bar regularly to show progress. After about 5 minutes of processing (400 MHz K6-2 CPU), the model is done! GwynFlex displays Ready in the status bar. 11/17/2018 Gwynhala's GwynFlex Tutorial
122
Gwynhala's GwynFlex Tutorial
The Model Folder Each Heretic II player model must have its own folder in the Heretic II\base\players\ folder. The name of this folder is used as the name of the model. For example, if your model is named Q2Gal, the model folder is Heretic II\base\players\Q2gal\ This folder must contain at least the following files: tris.fm: The model generated by GwynFlex ???.m8: A skin for the model (replace ??? with the name of your skin) ???Dmg.m8: A damaged skin for the model (replace ??? with the name of your skin) reflect.m8: Not used any more, but needs to be there; make it a copy of the ???.m8 file To use the model in a single-player game: In the console, type: allowillegalskins 1 In the console, type: skin Q2Gal/Venus (for example, if your model folder is named Q2Gal and the skin you want to use is named Venus.m8) To use the model in The Heretic Fortress: Decide which class you want to use the model for, and copy the contents of the model folder to the folder for that class (for example, the folder for the female cleric is Heretic II\thf\players\fcleric) In the class folder, rename the skin you want to use to male.m8 (for male team) or female.m8 (for female team); rename the damage skin you want to use to maleDng.m8 (for male team) or femaleDmg.m8 (for female team) Note: To use the model in a deathmatch, the server must also have the model folder, including the skin you want to use. Select the model using skin Q2Gal/Venus (for example) in the console. 11/17/2018 Gwynhala's GwynFlex Tutorial
123
Gwynhala's GwynFlex Tutorial
Some Final Words This tutorial is difficult. It took well over 100 slides in the slide show just to present this tutorial. There is a lot of room for new features in GwynFlex, to make conversion of Quake 2 models easier. Don’t feel bad if you have trouble with this tutorial. Just keep trying, and after a time you will get the hang of it. Once you have mastered this tutorial and worked with GwynFlex for a while, you can expect that it will take you 6-8 hours of steady work to convert a Quake 2 model for use in Heretic II, including adding the weapons and creating the “normal” and “damaged” skins. Let us know about any models you convert. We will post them on our web site for others to enjoy. Send your models to: -or - Be sure to include a text file with your name, address, the name of the Quake 2 model you converted, installation instructions, and anything else you think people would like to know about the model. 11/17/2018 Gwynhala's GwynFlex Tutorial
124
The End Questions? Comments? Snide remarks? Write me at Watch for more GwynFlex tutorials soon!
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.