Importing Objects and Assigning Materials in Blender - SWTOR-Slicers/WikiPedia GitHub Wiki

WARNING: THE RELEASE OF THE NEW VERSION OF THE .GR2 IMPORTER ADDON AND THE WAY ITS SWTOR MATERIALS WORK MAKES A FEW SECTIONS OF THIS GUIDE OBSOLETE. WE'LL UPDATE IT AS FAST AS POSSIBLE.


WARNING: the release of TORCommunity's Character Designer online tool solves the character's color data issues mentioned in this article, although they are still relevant in the case of manual asset gathering.

If you followed older guides based on the use of Noesis to convert SWTOR assets to usable formats (.obj 3D files and .png image ones, tipically), be aware that we no longer need such conversions thanks to LeeThorogood's .gr2 import/export add-on for Blender, the 3D app of choice out of both its ample capabilities and zero cost.

Also, there is no need to modify the texture files in Photoshop or similar packages: Blender understands the .dds image format (it's pervasive in videogame production), and the preset materials provided by this same add-on do all the required texture manipulations.

So, Noesis is no longer necessary, although it still is useful as a model visor and, in certain cases, as a model and texture converter for less capable 3D apps.

Installation of the SWTOR .gr2 Import/Export add-on

First of all, make sure to download the latest version of the add-on hosted in this Github, especially if you happened to obtain one through the Steam pages of SultanaVerena (founder of this Github and its associated Discord server 🙂 ), as that one is simply too old and somewhat incompatible with Blender 2.90 and above versions.

This add-on's installation follows Blender's usual conventions: download the add-on's .zip file, DON'T decompress it, and install it via Edit menu > Preferences > Add-ons > Install. Activate it by clicking on its checkbox (no need to relaunch Blender) and it'll show up in the File menu >Import and Export submenus:

Its single importing option is the "Import Collision Mesh" checkbox, which normally will be left unchecked.

Using the .gr2 add-on's SWTOR materials

Let's suppose we have imported the parts of a character. They'll appear correctly positioned already.

If we happen to switch the Outliner to Blender File mode (no real need, but it is interesting), we'll notice that there are a series of new material "templates" added to the project: Creature, Eye, Garment, HairC, SkinB, and Uber (they are produced by the add-on the moment it imports a .gr2 file). Those names match the label that appears at the heading of the .mat material definition files, which tells us which one we'll use for each object.

We'll notice, too, that some of the materials have names that match the name of the .mat files, but some didn't manage that and defaulted to "default" and similar. That is a current limitation of the importer add-on. It's not really a problem because we are going to disregard those materials, replacing them with copies of the templates.

In the Outliner, twirling the objects' little left-side arrows, we can see their meshes and materials (and vertex groups, which aren't relevant for this tutorial).

We see that sometimes there are two or more materials in an object instead of a single one. Some of such cases are:

  • A head that has a skin material and an eyes material.
  • A "hair piece" such as a Zabrak's horn plus hair object, which has materials for the hair and the horns.
  • A piece of armor that shows skin. As SWTOR replaces whole body parts with corresponding pieces of armor, those need to incorporate the skin of the body part they replace, which uses its own material.
  • Objects such as props (consoles, desks…), vehicles, weapons, etc.: oftentimes they have different areas with different materials. Many weapons are the result of cutting and pasting bits of other weapons, each bit with its own materials.

In such cases, we would replace each of those materials with the relevant template ones. Say, the head body part would use the SkinB Shader for the first material and the Eye Shader for the second one.

Let's go for the chest part as an example. In Blender's Shader Editor panel we see that the chest has been assigned a generic material based on the usual Principled BSDF shader (Blender goes to that one because it's kind of a Swiss Army knife shader)

We are NOT going to use that default material: what we are going to do is replace it with one of the template materials that the add-on created in the project at the moment of importing the model. As typical of any bare skin body part (or bit of skin showing in any piece of sexy armor), the .mat file tells us that we have to use a "SkinB" shader (that shows up as "SkinB" near the head of the file). We'll explain how to locate and interpret such files in another section of this Wiki.

So, with the object selected and the Shader Editor showing its material, we use the materials menu to select the SkinB Shader template. This will result in the replacement of the original material assignment with the SkinB Shader one.

BUT!!! We need to do something before continuing: yes, the materials are named "template" this and that, but Blender has no template library system as such (there is one doing trials in the latest betas), so we need to make a duplicate to preserve the original. If we don't, we risk finding ourselves rewriting and using the same material in different body parts without meaning to.

For that, we'll simply click on the New Material button next to the material name in the menu:

As the name field is so narrow, we probably won't see that clearly that the name was appended a ".001" or similar. We can check it by opening the wider selection menu, or by double-clicking the field (the cursor will move to the end of the name, so it will become visible).

Once having assigned this duplicate of the template to the object, it's best that we change that name to something more comprehensible. Say, "Chest".

Applying textures and values to the character's materials

Now, let's give the material a look. We can see that there is a big custom node (Node Group, in Blender's parlance) at the right side of the material's nodes network, and a lot of unassigned texture file nodes, named with the texture file suffixes that belong in each (ending in "_d", "_s", etc.) and the technical names BioWare gave them ("RotationMap" for normal maps, "PaletteMaskMap" for dye masks, etc).

Well: the idea is that you click on their "Open" buttons, browse to the correspondingly suffixed files, and load them.

One thing we'll have to do to each of those, once assigned, is set their Color Space setting to "Raw" (Blender defaults them to sRGB, which isn't appropriate for the way these SWTOR materials work, especially in the case of non-image texture files such as the "_n" normal maps).

As the SkinB shader works for head body parts too, it includes nodes for Complexions and FacePaints (tattoos, fur patterns, etc.). The .mat file will tell you what to use in those nodes when dealing with non-head parts, using files such as "white", "default_facemap", etc.

(Currently, the SkinB Shader material doesn't support scar or wrinkles maps. We are looking into that)

The problem with manually finding the character's color data

Now that we have all the texture files assigned, we can see about filling the big node group's fields with the data necessary to reproduce the colors and finish of the character.

If we used TORCommunity.com's Character Designer, all the data necessary to fill the following fields is already there, so, you can dismiss the discussion on how to obtain it. If you are doing a manual gathering, the situation is more complex because, yes, most of it is in the .mat files, and its labelling matches the one in the node, but some of it isn't, most specifically the skin color (which happens to be the most important one, isn't it?). We'll see to it.

The Palette1's X, Y, Z, and W fields are meant to work very much like Photoshop's (or any other painting app's) Hue-Saturation-Lightness adjustment tool. The fields are:

  • Palette1.X = Hue adjustment.
  • Palette1.Y = Saturation adjustment.
  • Palette1.Z = Brightness adjustment.
  • Palette1.W = Contrast adjustment.

The thing is: if we can't get the correct values (we can: it's just a bit involved), we can still eyeball them. We could start by raising Palette1.Z (brightness) to something like, say, 0.2, and Palette1.W (contrast) to 0.5, so that the object shows something other than black, and then we would play with all the Palette fields to try to approximate the skin color we want (shift-click'n'drag on those fields lets us change them in fine increments/decrements). Mind that Saturation (Palette1.X) is highest at 0 and lowest at 1, contrary to the usual.

As for the Palette1 Specular and Metallic Specular, the corresponding data in the .mat files comes as value triplets, but we can see in the node that there are color wells instead of groups of fields. No trouble: we just open them and enter the values as R, G, B (and Alpha if there is a fourth value listed).

Let's see now about getting the actual, exact values for the Palette1 fields.

The problem we have is that, although most of the information about the objects' materials is present in the .xml and .mat files extracted with Slicers GUI or EasyMYP, there are bits that only exist in the game's nodes database, a non-human readable binary file, so we need NodeViewer to consult it (and maybe extract it to have it more at hand).

In NodeViewer, the skin, eye and hair's colors appear in the dynamic menu's related submenus: inside them, their nodes' names are the filenames that supposedly ought to exist amongst the extracted assets but, alas, don't.

For example, in the case of this Zabrak character, we can find the node and see there the Palette information we need. Note that the order of the fields in NodeViewer doesn't match the order in Blender's node, so remember what's what to place the values correctly:

  • Palette1.X = appPaletteHue (hue adjustment).
  • Palette1.Y = appPaletteSaturation (saturation adjustment).
  • Palette1.Z = appPaletteBrightness (brightness adjustment).
  • Palette1.W = appPaletteContrast (contrast adjustment).

(You can find there the Specular and MetallicSpecular values, too)

If a value appears with a minus sign and the results look weird, try omitting the sign (not yet fully sure about this but it seems to work).

For the material to handle transparency (typical of fine edge detail such as hair strands) while using the Eevee renderer, check that both the material's Blend Mode and Shadow Mode are set to "Alpha Clip". The latest version of the add-on ought to do that automatically.

And that's it, mostly.

Some issues regarding this add-on on different Blender versions

The current version of the .gr2 importer works in both Blender 2.8x and 2.9x, but the materials of a project started in 2.8x won't fully work in Blender 2.9x without some minor modifications: Blender introduced a new input socket in 2.9x' Principled Shader between the "Emission" and the "Alpha" ones, and that makes some of the materials' shader network "noodles" connect to the wrong inputs. It's easy to correct manually and we'll add a small guide to how to solve it.

There is a .gr2 importer for Blender 2.7x, but it doesn't provide with SWTOR-like materials: it only imports the objects. Still, with some effort, an approximation to the materials of the modern version could be built for 2.7x' Cycles renderer.

⚠️ **GitHub.com Fallback** ⚠️