上QQ阅读APP看书,第一时间看更新
Setting up sockets
Sockets are points on the model where elements that are not part of the character can be fixed on it, such as weapon points, particle emitter points, or any other kind of contact point that you can think of. Typically a character in UDK needs to have two weapon sockets to work as a player character and also two jump boot sockets and a neck gore socket because they are defined in the default player class, at least for UTGame. They should be defined, but they don't need to actually have anything assigned to them.
Getting ready
Make sure the Packt package is fully loaded, and open Packt_Character_AddSocket in the AnimSet Editor. This mesh is different to Packt_Character, which already has the sockets added.
How to do it...
- Choose from the menu Mesh | Socket Manager or click its icon [ ]. In the dialog window that pops up press New Socket. You will be prompted to select a bone name from the bones that comprise the active skeleton to add a socket to.
- In this example choose b_RightWeapon. You will be prompted to label the socket. Enter WeaponPoint.
- Other common sockets are as follows: b_LeftWeapon = DualWeaponPoint, b_Neck = HeadShotGoreSocket, b_LeftAnkle = L_JB which is a jump boot designation, and b_RightAnkle = R_JB which is the other jump boot designation. These designations are used by characters conforming to UT3 presets. Of course, you can create sockets where you like as well.
- Let's create a socket on the head bone b_head called Hat. Notice that it takes the pivot of the bone itself, which isn't really a suitable place for a hat.
- In this case, we'll move the socket to the model's crown simply by dragging on its widget in the view port. If you prefer you can set a Relative Location for the socket in the properties section of the Socket Manager. The location is relative to the chosen bone's pivot.
- In the Content Browser highlight Packt.Mesh.Packt_TopHat and then in the Socket Manager properties section, find Preview Static Mesh and assign Packt_TopHat to it using the assign icon [ ] as in the next screenshot.
- If the added mesh does not show up where expected you may need to adjust the Relative Rotation (something like Roll=0, Pitch=-90, Yaw=11), and you can also adjust it directly by pressing Space in the preview and rotating it there.
- Tweak the placement of the Hat socket until the mesh is sitting agreeably on the model and follows the AnimSet animations accurately.
- At the start we mentioned that there are already sockets for Packt_Character. The problem is, the mesh lacks an animated tail and isn't as complete as the model we'll use later. Putting sockets on again would be tedious. Luckily there are Copy Sockets and Paste Sockets tools in the socket manager. Open Packt_Character in the AnimSet Editor, then press the Socket Manager icon [ ]. Along the socket manager dialog's icons you will see a scissors icon [ ] and a clipboard icon [ ]. These are Copy Sockets and Paste Sockets tools, so press Copy Sockets, then open Packt_SkinTail_LODtest and its socket manager (which should be empty) and press Paste Sockets to complete the transfer.