Welcome
Ladies and Gents:

These forums are now closed and registration disabled.

Please join us at our new forum on Proboards. Our hope is that these new forums are more stable, provide more and better features, and allow continuation of the project forums in a safer, more secure, long term environment.

me3explorer.proboards.com

--The ME3Explorer Team

Tutorial: Editing Static Meshes

Dedicated area for texture and mesh-related tutorials. This includes modder's tutorials such as how to create your own TFC files. Do NOT post help requests in tutorials; use the relevant help board below.

Tutorial: Editing Static Meshes

Postby Eudaimonium » 01 Nov 2012, 02:05

Static Mesh – ultimate guide!

Greetings,

This tutorial will teach you how to export a static mesh object out of the Mass Effect 3 game, how to create new mesh or modify existing one, how to do a UV Unwrap and create a texture for your mesh, and how to properly import the stuff you created back into the game!

Static Meshes are objects which have ratios between vertices always the same. Contrary to what their names says, they’re not actually “static” in the game world. Weapon barrel attachments, omni-tools, even projectiles that are visible with biotic and tech attacks are static meshes.

This is opposite to “skeletal” meshes which are characters and weapons in game. Weapons are skeletal meshes because they have collapsing animations. You obviously cannot animate a static mesh object. So yeah, no actual modding of guns for now. Bummer huh? Let me cheer you up!

Image
Omni-katanas!
I love katanas.

So let’s say you’re tired of this stupid-looking thing always hanging from your gun like some tumor, commonly refered to as “barrel attachment”.
Image

And you want to create something new for your gun. Like some TRON looking attachment:

Image

No modding skills? No problem! This tutorial will guide you step-by-step, and in the end, you’ll have the most pimped up gun in ME universe, and learn a thing or two in the process!

Let’s start off with the essentials.
Here is a list of mandatory tools you WILL need:

-3D Studio Max - yeah I know. If you really don’t have $3500 burning in your pocket, hey, torrents. Don’t worry, it’s only about 600MB. You also need additional plug ins for Max:

*ActorX Import script by Gildor: http://www.gildor.org/down/31/actorx/ActorXImporter.zip
*Epic’s ActorX Exporter: http://udn.epicgames.com/Two/ActorX.html

-ME3 Explorer – get here https://sourceforge.net/projects/me3explorer/

-Image editing software with ability to edit DDS images. I recommend GIMP 2.8 with DDS plug in installed : http://www.gimp.org/downloads/ and http://code.google.com/p/gimp-dds/

Armed to the teeth? Good.

First of all, you need to know what you want to mod. For our example, we are modding the Assault Rifle’s barrel attachment mesh. To find it, first: Open up the ME3Explorer tool.

Navigate to Developer Tools and select “Meshplorer”. (I didn’t come up with the name. Shut up.)

When Meshplorer is opened, you will see a button appear in primary toolstrip: “Load PCC”. Click that. GENTLY.
Rub your hands together, lots of work ahead. I will guide you to finding the mesh models we need for the sake of this tutorial, but, when you want to mod yourself, finding a mesh file you want within 3580 PCC files – I hope you have patience, time, and God on your side. Usually the names of the files can help you but it’s trial and error majority of the time.

To find the meshes we need, find and open this file: “SFXWeaponMods_AssaultRifles.pcc” within your Mass Effect 3 directory \BIOgame\CookedPCConsole.

Once you open it, you will see a list of objects on the left side.
Image

Once you select an object on the left, it’s raw binary data will be displayed as treenode in the middle section and it’s 3D preview on the right.

Sometimes when you click an object on the left, you will be prompted to find your MassEffect3.exe – just do as the program says. This is simply for the parts of the code to find the other needed files, like textures.

In our example, you will see 10 items. You will very quickly figure out what they are by clicking them and seeing their 3D preview – they are scopes and barrels for Assault rifles, sorted by levels.

So let’s say you want to change your Level 5 barrel. Find it in the ME3Ex:

Image

With it selected, on the toolstrip up there, select Transfer -> Export to PSK. What this will do, is rip out that exact same part of PCC file (the mesh you’re looking at) and write it into a .PSK file which you will be able to import into Max for editing. PCC files contain a lot of stuff, like scripts, sound events, skeletal meshes, and a big list of stuff to import from other PCC and TFC files, and big list of what to export into the game’s engine for rendering. So for now, we want THAT one mesh and we want it NOW!

Once you wrote the PSK file out, we need to import it into 3DS Max. To do that, first make sure you have installed your import and export scripts properly! For import script, you can place it pretty much anywhere. For export stuff, place the downloaded file into your Max folder \Plugins.

Run your 3DS Max – if it’s your first time, you’ll notice it takes quite a bit of time to load.

Once done, go to the MAX script on the toolstrip, and click “Run Script”.

Image

Find your ActorX importer script and double-click it. You will see a new window open up in your Max:

Image

Click Import PSK, and navigate to the PSK you exported using ME3Ex.
Once you import it, you will see the 3D model appear in your Max!

Image

So here you will re-model it as you want. Here’s a brotip, if the model is beyond salvaging, like Level 3 and 5 barrels are, and you start modeling new barrel, first what you need to do is pick up the material from existing barrel so you don’t lose it!

Image

Then apply the material to your new mesh:
Image

You can now model your mesh to whatever you think is cool. Here’s my new barrel V :
Image

Not much, but hey, it’s just a proof of concept for now.
If you’re created a new model, you’re obviously going to need to texture it. Applying old textures will be possible, but it’s going to look horrible:
Image

I know you’re a bit eager to try it out right now, but bear with me a moment, we’ll do just that in a second.

Now, first step in creating textures for a 3D model is something called “UV Unwapping”. Contrary to what it’s name might look like, it has nothing to do with ultraviolet light. The “UV” in the name means coordinates in two-dimensional plane. Since X and Y are already taken, we use U and V.

UV unwrapping means assigning pixels from an image, to the triangles that make up the model you just created. This way, the game knows which part of the image goes on what triangle on your mesh. In more technical terms, each Vertex (already defined by X, Y, and Z coordinates) gets assigned a new pair of coordinates, U and V, which correspond to two-dimensional coordinates of the picture you are going to use as a texture.

To do that, select your mesh you just created, go to Editing tab, and on the list of Modifiers select “UVW Unwrap”

Image

Once you have that, you will see your mesh with some green outlines. Don’t worry about those. Go to the new Modifier you just created and find the big-ass Edit button:

Image

A new window will appear, with your mesh stretched out and horribly mutilated in unspeakable ways. Quickly press CTRL+A on your keyboard. This will select the entire mesh that’s screaming in agony down there. It’s gonna turn red. Try not to look too much into that, cover your eyes so you don’t see that part of window, and find a toolstrip and click Mapping -> Flatten Mapping.

It’s safe to look in your window now:

Image

Here you can see all the parts that make up your 3D mesh, are nicely laid out on the paper. It’s like peeling off an orange and stretching it out on paper, flatting it. That’s why it’s called “Unwrapping”, it basically takes all the triangles that make up your mesh, and “peels” them off really gently, like you unwrap your Christmas presents. Then, exactly like on Christmas, it takes all the torn off paper and nicely arranges them on the paper in almost OCD-like behavior. What? You don’t do that? Just me, then.

In any case, before you export your PSK, there’s just one more thing. You need to create a reference texture – doing this is as simple as clicking Tools -> Render UVW Template in your UV window. In following window, render out your reference texture in whatever appropriate resolution you think will do. For weapon barrel attachment, 256x256 will do.

Image

Press Render and save the image that comes up as some lossless format, like TGA or BMP. Also, remember where you saved it. Don’t ask me later, I don’t know where’s your rendered stuff.

Now comes the PSK export. Doing that is easy. Don’t worry, your UV sets are already saved, and you don’t need to do anything to save them yourself!

Now, please go to your Utilities tab in Max, select More, and double click ActorX on the list. If it isn’t there, you messed something up with installing it. I said, plugins directory in your Max folder, damn it! Save your entire Max scene somewhere, exit Max completely, then install the damned thing, THEN run Max and load your scene. Let me know when you’re back.
Back? Ok, here’s what you need to do next:

Open the ActorX utility, and down there, you will see Epic’s epic logo appear, and some tools. First, find and set the output directory of your PSK file that you’re going to export. Then, type the name of your PSK. Make it creative, so you know what’s what. Like, “ARifles_Barrel_5_modified”.

Down in the options, make the checkboxes EXACTLY like this:

Image

Also, make sure your Mesh is currently selected, and positioned correctly – it has to be positioned exactly like previous one, in order to appear correctly in the game. You don’t want your barrel floating an inch in front of your gun... or uhh... that sounds pretty cool, actually. Well! If your export went well, you will see two messages: [0] vertices added; press OK, and PSK file successfully written! Press OK!

Now, you need to go back to your ME3Explorer, and import the PSK.
Make sure the mesh you wish to replace is selected in the list, it’s 3D model spinning on the right, and press Transfer -> Import.

The tool will prompt you to select a material to apply to your new mesh. You will want to have the same material that was applied to the previous mesh. A material is a collection of textures, and a bunch of code on how to shade them. Don’t worry, we will modify this material so it’ll look cool afterwards. For now, select the material as many times as you’re prompted. Barrel Level 5 (don’t know about others), have three material instances so you will be asked 3 times.

When your import is complete you should see your mesh happily spinning in the 3D preview.

Image

I am pretty sure you’ve very eager to try out the mesh in the game! First, close the Meshplorer.

There’s just one more step to do if you want to do that. In the ME3Ex, go to Tools, and find TOCbinUpdater. Open it, and on the toolstrip, click Open and find your PCConsoleTOC.bin file in Mass Effect directory \BIOgame.
Give the tool about 5 minutes to scan through all your game files and update TOC.bin file accordingly.

TOC.bin file contains a list of all the PCC and other files that make up the game, and their exact size in number of bytes. This is very important, because it tells the game engine exactly how much memory to allocate when the specific file is needed. If you forget this step, the game will instantly crash the next time it’s asked to load anything from SFXWeaponMods_AssaultRifles.pcc, because now it takes more memory than it used to, and it won’t fit into the size allocated in the existing TOC.bin.

TOC bin updating done? Good. You can now try out your game and see what the weapon attachment looks like. It’ll probably look something like this:

Image

Now finally, we need to create a texture for the new object. Depending on your personal preferences, we already have. Remember that UV template you rendered out? No? Man it was like 15 minutes ago!

To apply it to your mesh, first you need to determine what resolution your texture currently is.
To do that, in ME3Explorer, open up Asset Explorer under Tools. Show the program where your MassEffect3.exe file is if needed. Then, open up the default PCC file collection, and find your PCC file which you just modded.

In it, this time instead of a list of Static Mesh objects, you will see a helluva lot of folders. Finding a texture can be a bit tricky, but for the sake of this tutorial, I’ll tell you exactly where the files you need are:

BIOG_WPN_ASL_R -> Mods -> BARe

Here you see two uninteresting looking things, and three items which look like pictures. Those three images are textures the game uses. But why three textures, and not one?

The first texture, and the one most important to us, is called Diffuse texture. It’s simply an image glued on your mesh model.

The second one is called a Normal map. It is used to simulate uneven surface, like metal surface having fins or seams or grooves cut in it. It’s too much of a bother to model that, and sometimes too expensive to render out all those polygons, so a normal map is used to “simulate” such effects.

Specular map is used to tell the game how the parts of the mesh reflect light. It’s used on meshes which appear to be made of several materials, for example the handle of the gun is going to be matte rubber finish, but the outer metal shell has to be shiny. This tells the game where to draw the shiny stuff.

We want to modify the diffuse texture, so you will want to take a look at what it looks like. Right click the item WPN_ASLR_BARe_Diff and click Preview. It will draw out the current texture in the window.

Press right click to go back. First, find out the resolution: Right click the item again, go to Advanced, and click Replace. It will open a small window with list of textures currently there. You will see a list, and highest resolution will appear to be 256x256. But look at the offset – it shows it’s “-1” which means that texture doesn’t exist. Also with 128x128x. So 64x64 is our highest resolution.

Image

You’d suspect that’s surprisingly low for an ingame object of that size. And you’d be right, as you’re about to find out.
Now, go back to your image you rendered out back as a UV template. I used 256x256 size. Open it in your current photo editing software, and scale it to 64x64 pixels, and save it somewhere else (Don’t overwrite the original!).

Save the image as DDS file: with format DXT1 and no mipmaps (these two steps are important!).

Go back into your asset explorer, go to Replace again, place a checkbox on 64x64 on the list, and press Replace button.
Find the texture file you just created, and select it. If you’re prompted to find .tfc file, you will find it among the collection of PCC items in CookedPCConsole folder in your ME3.

Once you selected it, it should say “All images replaced successfully”. On the upper toolstrip, select Save Changes. You can check via preview if your image got replaced properly.

So now, last thing to do is to update PCConsoleTOC.bin file again. This time, the Textures.tfc file is of different size and game needs to know that. Let the updater do its job.

So now, finally, the results of your work!
Image

Yeah, it kinda-sorta looks like piece of shit. This is because 64x64 texture is applied to the object which should have at least twice as much resolution.

But how do we use higher resolution textures?

First step, is to create 128x128 resolution texture from your rendered out template. Once you have that, we can move on. Open the original which, hopefully, you didn’t overwrite, and scale down the resolution to 128x128 and save it as DDS.
So now you have 128x128 and 256x256 resolution textures, but tricky part is getting the game to use them. Go to Asset explorer, and use Replace on 128x and 256x textures. After correctly doing so, you will see that they now have normal Offset numbers.

If you update TOC.bin file and run the game, you’ll find that the attachment still looks like shit. This is because, no matter if there are higher resolution textures, the game is never told to use them. It assumes 64x64 is the highest resolution texture, because one of the properties of that texture as defined by PCC file is the group of textures it belongs to. To check that, right click your texture and select, Open in PCC Editor. You will end up with this:

Image

DON’T WORRY! To hide all the raw Hex code, go to View, and press Properties.
That’s better, init? You’ll be editing that raw hex code later.

Under Byte Property, you will see that there is a node called “LODGroup”. Opening it will reveal a piece of information that’s crucial: TEXTUREGROUP_VFX.

To make the game apply higher textures, there are two methods.
First method is to increase the limit of VFX texturegroup, second is to make the texture a part of another group.

First method:

I’m pretty sure you are aware of methods of editing Coalesced.bin file. Download your favorite Coalesced editor (one in ME3Ex is under construction, it’s not too high on priority list. Tali’s face is).

Navigate to bioengine.ini -> systemsettings

On the lower end of that list you’re going to see a bunch of entries starting with “texturegroup ...”

Look for texturegroup_vfx. You will find several entries:

Image

Logically, 64x64 texture in the PCC file belongs to vfx_64 texture group. You can instruct the game to use a higher quality texture by changing that line into:

(MinLODSize=8,MaxLODSize=256,LODBias=0)

So MAXLod size dictates the largest resolution texture that can be drawn in that particular group.

Save your Coalesced file. Run your game. If you did everything right, you should see the sharper texture finally appear:

Image

However, you will notice problems not long after that.

Image

You might be wondering where did all the HUD go, possibly using a lot of very creative nouns and adjectives.

This happens because the barrel texture is not the only member with that texture group. Other textures that belong in vfx_64 group are some HUD buttons. Since we’ve told the game that while at minimum LOD [Level of Detail] (which is, maximum quality, when object is nearest to the camera) it should render 256x256 images. These buttons are at LOD of 0 while being in menus and it’s the only LOD they have, but there is no 256x256 texture to render. You might be thinking it’s retarded that the game doesn’t try lower quality textures. Truth is, we’re incredibly lucky that the game doesn’t crash on us at all. Try something like this on any other engine and your monitor will very much likely explode, right after the GPU launches its heatsink in your face.

You can possibly go around and create higher resolution buttons and other texture members, which would be incredibly awesome, and pretty much unavoidable in near future, but for the purpose of this tutorial, we’re going to mention the other method of solving the case of our barrel extension looking like shit when texturegroup_vfx_64 is returned to 64, which you are expected to do now.

Second method, like I mentioned before, is putting our texture into another texture group which has a higher limit for resolution. First we need to find out which groups are even supported in the current PCC file. As of the time of writing of this tutorial, it’s not possible to create new references to other texture groups, so we have to make do with what we have.
Locate your texture in PCC editor like before, and next to name “TEXTUREGROUP_VFX” you will also see a name index number: 546.

If you click the names list on the left side of the window, scroll down to locate that number, you will see this:
Image

If you remember from the Coalesced... of course you don’t, go scroll up and take a look at the screenshot. Back? OK, so you found that texturegroup_ui has MAXLod 1024 by default. So we need to put our texture there!

OK now it gets ugly. You need to know a bit of Hex code and how it works to pull this off.

First, find the hex value of the “546”. A Windows calculator with Programmer view helps here. You will find that Hex is “222”. This is written in the form of 4 bytes likes this: 00 00 02 22,

Or just 0x222 for short. However, you need to know that the Unreal Engine 3 uses “Little endianness” bytes system, which essentially means, the bytes are reversed. So your 0x222 in raw byte code actually looks like:
22 02 00 00.

Note that the numbers themselves are not reversed : 02 is still 02, that’s one byte. But bytes themselves are.
Switch your View into Raw and find a string that matches “22 02 00 00”. Once you found it, click the “22” part and change it into “21”. It’ll look like this:

Image

You can check back in Properties view to see that the texture group has indeed changed.
Now, press Edit -> Save Hex Changes.

Oh yeah, alternatively; You can simply change the number in nameindex field in Properties view:
Image

Don't worry, knowledge of how to edit raw Hex will surely come in useful later on. Maybe.


Then, press File and Save, and re-save the PCC. If you don’t want to type out the full PCC name, good trick is to go within your CookedPC folder, and sort everything by Date Modified. Your file should be right at the top, or maybe second if Textures.tfc got modified last. Double click the PCC file and save it.

You will be asked if you want to update TOC.bin file. Since we only changed a byte, and didn’t add any new ones, you can, but don’t have to update it.

Go back into your game and take a look.
Image

YAY! It’s broken and it doesn’t work. No texture is showed.
Reason for this is the same as why the HUD items didn’t show when we increased VFX. They were 64x64x items in 256x256 territory.

Now, we have 256x256 item in 1024x1024 territory. I don’t know why exactly doesn’t the game put it into vfx_256 texturegroup, it appears to be defined somewhere else but requires more digging around the hex code. Anyway...
Solution for this is simple – simply render out a 1024x1024 texture template in Max, create 512 out of it too, and place those as textures in Asset Explorer.

You’re maybe wondering that we’re maybe pushing the limits here – those items are supposed to have 64x64 resolution, and we’re about to use 1024x1024. That’s two hundred and fifty seven times larger resolution than intended. But remember, there is only ever going to be a maximum of three items on the scene, you and maybe two squadmates with two assault rifles with that same mod. As long as you’re aware of that, it’s no problem.

If what you are doing becomes a problem, for example using a very high texture for common stuff like biotic attacks, bullet tracers, enemy models, or environment such as walls and ceiling, then the game won’t really run as smooth... on a 7 year old Xbox 360. Modern computers will handle it no problems.

If you’re wondering, the maximum texturegroup resolution you can have is 8192. That’s what the engine was designed to render out. For reference, entire body of squadmates is textured with 1024x1024 resolution texture. Normal and Specular maps are, most commonly, only ¼ of resolution of diffuse texture, so for 1024x1024 item, 512x512 specular map is normal. Yes that was a horrible pun, and no there is no math error. Multiply it yourself.

So now that you finally have your template texture showing up correctly and nothing else is messed up, all that remains the texturing itself. It not as hard as you might think. It basically boils down to hunting down images and textures of metal surface of whatever it is you’re looking for, and photoshopping it over outlined-in-green areas in your texture template. Then simply re-import the texture via Asset explorer, and check out what it looks like in game.

When all is said and done and you’ve pimped the barrel attachment with high quality stuff...

Image

Image

...Great! Now the rest of the gun looks bad.

That’s it for today. If you stuck around long enough to get to here, I hope you’ve learned something from this tutorial, be it UV wraps, how stuff works, or new curse words because the tutorial is specifically written to have you make a mistake and then correct it.
Apologies for not-top-notch texturing work, it’s 3AM. I know you can do better! Show me!

SuperD22! I'll need you for a lot of texturing work here on out! :D
One of few surviving members of species that actually loved Mass Effect endings.
User avatar
Eudaimonium
Emeritus
 
Posts: 299
Joined: 23 Aug 2012, 23:22
Has thanked: 17 time
Have thanks: 33 time

Re: Static Meshes mega-tutorial: How to do everything!

Postby Methos » 21 May 2013, 09:41

Note: The ActorX importer download location has changed: http://www.gildor.org/down/35/actorx/ActorXImporter.zip
User avatar
Methos
User
 
Posts: 19
Joined: 12 May 2013, 07:52
Has thanked: 0 time
Have thanks: 2 time

Re: Static Meshes mega-tutorial: How to do everything!

Postby Mimi » 24 May 2013, 11:08

Hrm... I suppose this wouldn't work for Blender? There's no import script for it, right?
User avatar
Mimi
Modder
 
Posts: 69
Joined: 11 Dec 2012, 19:05
Has thanked: 28 time
Have thanks: 3 time

Re: Static Meshes mega-tutorial: How to do everything!

Postby Eudaimonium » 25 May 2013, 12:33

Mimi wrote:Hrm... I suppose this wouldn't work for Blender? There's no import script for it, right?

Note, this tutorial is far outdated.

See this one for advanced mesh replacement:
skeletal-meshes-tutorial-scope-on-avenger-t442.html

Static Mesh and it's texture set replacement has been rendered trivial by Meshplorer. Use that.
One of few surviving members of species that actually loved Mass Effect endings.

Eudaimonium has been thanked by:
User avatar
Eudaimonium
Emeritus
 
Posts: 299
Joined: 23 Aug 2012, 23:22
Has thanked: 17 time
Have thanks: 33 time


Return to TexMesh Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests

suspicion-preferred