Skip to content

Attaching weapons and other objects to a character

ZeroGravitas edited this page Jul 25, 2023 · 22 revisions

Once again, thanks to the .gr2 Importer Add-on's ability to handle SWTOR's skeletons and related properties, getting a weapon correctly auto-positioned and angled in the hands or the holsters of our characters is a matter of three or four clicks.

Our Player Characters' (and NPCs') skeletons, aside from the bones needed to pose them, come with a few extra ones floating around the character for things like attaching nameplates, cameras for cutscenes, jetboots… and, of course, for placing weapons, both wielded or holstered. We can see their names if in the Properties Editor panel> Object Properties tab > Viewport Display we tick the Show Names checkbox.

The beauty of it is that, by applying Blender's Object Constraints to a weapon, we can have the position and rotation of those bones be transferred to the weapon, leaving it pointing towards where it should without needing to adjust it manually! We can also set an option that will let us further adjust them, such as moving a saber hilt a little outwards to keep it from poking through a piece of armor, or holstering a couple of vibroswords on a character's back in a "X" arrangement instead of vertically.

No strain constraint

So, let's suppose we have a character parented to a skeleton. Let's import a saber hilt (for example, the Outbreak Response Lightsaber at resources\art\dynamic\weapon\model\saber_high16_a02_v02.gr2) and a blade object to align and parent to the hilt (there is a nice one at resources\art\fx\geometry\all\fx_saber_blade_01.gr2).

We don't need to move the saber around (it doesn't matter if we do in this simpler version of the method): we can leave it lying on the floor for the moment.

With the hilt selected, we go to the Properties Editor panel > Object Constraints Properties tab.

There, we click on the Add Object Constraint menu and select in the second column to the left (Transform) the Copy Transforms option.

A Constraint is added to the saber object, but nothing will happen until we tell it what to constrain it to. In the Target menu we have to select the skeleton object (bmnnew_skeleton in this example), and in the Bone menu we have to select from which bone we want to transfer position, rotation, and scaling information (that is, all the "transforms") to the weapon (in order not to have to scroll through the long list of bones composing the skeleton, we can type words like "weapon" or "socket" to reduce the list to the actually useful stuff).

The moment we do, the saber will jump to that bone, as it is receiving the bone's position and angle! When posing or animating the character, the saber will follow automatically.

Here we see it receiving the RightWeapon bone's transforms and the socket_saber_right one (that "right" refers to which weapon it accepts).

What are the bones we can use for this?

For holding the weapons we have:

  • LeftWeapon
  • RightWeapon

And for holstering them:

  • socket_bfg_right (bfg = trooper cannon)
  • socket_saber_left
  • socket_saber_right
  • socket_pistol_left
  • socket_pistol_right
  • socket_staff_back_right
  • socket_weapon_back_left
  • socket_weapon_back_right
  • socket_weapon_back_left_upper

That said, we could decide to constrain the weapons to other bones that aren't really meant to be used that way. For example, we could want to put sabers' hilts at the back of the character, in the style of Jyn Erso in Rogue One.

But it happens that the bones at the back don't align the weapons the way we want to: we need to adjust their positions and rotations.

Degrees of freedom

Leaving the Constraint unmodified, it replaces the transforms of the saber with those of the bone and that's it: it won't let us do any further adjustment over them. In order to add our own transforms over the ones coming from the bone, in the Mix menu we switch from the default Replace to Before Original (Full).

As soon as we do that, we'll see the weapon rotate in the wrong direction, and maybe move away from the correct position. Why is that, and how do we solve it?

When we import SWTOR objects, the importer add-on rotates them 90º in the X axis because it has to correct for Blender's "Z is up" coordinate system (most 3D apps use a "Y is up" one). One can see that in the Sidebar > Transform tab's Rotation fields. And if we happened to have moved the saber previous to constraining it, the Location's fields will exhibit some values different from zero.

Those transforms are being added to the ones coming from the bone, and that's why we get those wrong rotations (and translations, if any). To correct that, we just need to zero them:

Now, from that "neutral" position and rotation, we can do our own adjustments in a far easier way.

Switch the blade

An interesting detail to know: we can add more than one Constraint, and "crossfade" between them using their Influence value fields. For example, we might have a saber with both a constraint to the right hand weapon bone and to the left holster socket one:

If we animate the hand grabbing the saber hanging from the character's belt, what we would do is keep the socket bone's influence to 1 and the hand one to 0 until the very moment the hand is supposed to grip the hilt. In that precise moment, we would switch the influences to 0 for the socket and 1 for the hand, so switching the sources of transforms the saber is receiving.

Bringing a datapad to a gunfight

This method, of course, works for any object other than weapons: datapads, holocoms, caff cups, etc. If they don't fit the hand correctly with the Mix option set to Replace, Before Original (Full) will do.

Table of Contents


INTRODUCTION

IMPORTING SWTOR MODELS INTO BLENDER: A BRIEF OVERVIEW.
Check this intro first. Afterwards, you can jump directly to the guides on extracting PCs, NPCs and others.


TOOLS

No need to read this section right now: each extracting/assembling guide explains its required tools anyway.

Applications and Blender Add-on tools:

Online Tools:

Deprecated Tools:

  • EasyMYP (Windows app).
  • Noesis (Windows app).

THE COMPLETE GUIDE TO AUTO-EXTRACTING AND ASSEMBLING PLAYER CHARACTERS AND NPCs:

READ THE BROAD STROKES FIRST: YOU'LL SEE IT'S EASIER THAN YOU THINK!


ASSEMBLING GAME LOCATIONS AUTOMATICALLY:


LOCATING AND ASSEMBLING ASSETS MANUALLY:


OTHER GUIDES (WIP):


MODDING (to do)

Modding isn't working at the moment due to SWTOR's change to a 64bit codebase. It's going to take a while 🙁.


DATAMINING (to do)

  • Overview.
  • Tools.

SWTOR TECHNICAL INFORMATION:


OTHER RESOURCES:

Clone this wiki locally