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: Swapping Skeletal Meshes (Avenger example)

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: Swapping Skeletal Meshes (Avenger example)

Postby Eudaimonium » 23 May 2013, 22:59

Greetings people,

So I did some digging around and found out a way to safely swap out a weapon's skeletal mesh, not only leaving the bones and sockets intact, but how to modify those as well! End results can be seen in my thread here, you can download a finished mod there:
post3185.html#p3185

So let's get started!

What you need:
- ME3 Explorer
- 3D Studio Max (No alternatives unless you know their bones manipulation to the bone)
- ActiveX Importer script (for importing of PSK meshes)
- Epic's ActorX Plugin for exporting PSKs.
- Mass Effect 3
Optional:
- Gildor's uModel if you wish to extract and reuse ME2 stuff.
[links to get these can be found in Voider's tutorials]

Getting started:
For this tutorial, I'm going to use the Avenger's model reversal to it's ME2 variant. It'd be best, if you first follow this, even if you maybe already installed or modified your Avenger, so you can get a grip of how things work, so that you can in final produce your own mods using these techniques.

First of all you need to prepare your materials. You will need PSKs of both versions of the rifle you are going to work with. Why this is, it'll be made clear in just a sec.
Use uModel to extract Avenger rifle from Mass Effect 2. It's in file
SFXWeapons_AssaultRifles.pcc


When extracted, it'll be in
uModel's directory\SFXWeapon_AssaultRifles\SkeletalMesh3\WPN_ASLa_MDL.psk


Please save it in a known location.

NEXT, Fire up your ME3 Explorer. Run Meshplorer, and open a file:
SFXWeapons_AssaultRifles_Avenger.pcc

with it.
Image

Click on the first entry on the list to the left. You will see a spinning, albeit crippled and scopeless Avenger in the preview window. Export it into a PSK file via "Transfer" menu.

Image

Once both files are exported, you're ready to move on to next section:

Transplant.

The final goal of this section is to transplant the Weight Table of ME3's rifle, onto ME2's rifle, and import ME2 into ME3.

Basically, if you simply import ME2's rifle straight into Meshplorer, your in-game Rifle will not reaction to any animations (it'll stay open entire time), and it's Holographic Ammo indicator, Firing muzzle effect, Heatsink ejection spot, and weapon mod attachments will all take place at precise middle of the gun, somewhere bit above the trigger. This is because you do not have the "bones" connected.

Bones are one-dimensional objects in 3D space. They are special because every vertex has a "Weight" value for every bone. Now, "Weight" might be bit misleading, the proper expression I'd use is "Influence". Basically what that does, is tell the engine how much to move a vertex, in relation to the movement just done on the bone.

Overly exemplified, if Vertex has a 0.5 weight to a bone1, if bone1 moves 1 unit of distance, vertex will move 0.5 units. This means that if you have an Avenger rifle with some 1500 vertices, and 12 bones, that's 1500 x 12 = 18000 values that we will NOT copy over by hand :p Trust me this tutorial is shorter.

Now, the ME3 rifle is perfectly fine in ME3 game. ME2's rifle is rigged a bit differently and we have to make it work.

First we need two things from ME3's rifle: It's bones, and it's Influences.

Open up your 3DS Max (you should've setup your scripts by now. If not, go do that first).

Image

Click MAXScript -> Run Script, and find and run your ActorX importer. A new window will open up in your MAX. Click "Import PSK..."

Image

Open your ME2 Avenger.

Image

Now, we have to delete all of it's bones, preserving the mesh alone, and reapply ME3's bones to it.

There is a simple way, just drag a box around EVERYTHING, then just ALT-Click the rifle. You should Deselect the rifle, leaving "12 Objects selected". Hit Delete. Save this MAX Scene somewhere.
Now that we've extracted ME2's Model, we need ME3's skeleton...

Open your ME3 Avenger.

Image

Please note, on the right side, there is a list of Bones, under Modify tab in the selected model. That's what we will accomplish on ME2's model.

Now, you will also notice that beside all the rifle itself, there are small pyramids. These small gizmos represent invisible, but very real, bones. Now, we will need to get rid of the rifle but before we do that, I'd like to divert your attention to this part:
On the right side
Image

Now you will see your rifle has different parts colored up when you select those bones. Try it and select some other ones.

Basically, the intensity of the color is telling you how much influence does that bone have, over that area. You can try to see it yourself, for example, disengange the Envelope editing and click the barrel gizmo and try to move it:
Image

Image

The evenly colored part moves evenly. Non-colored parts don't move.

Now, what we need to do is extract these "rules" of movement, so we can re-apply them on the new model. To do that, go to Utilities, More, and get Skin Utilities:
Image

With your rifle selected, press "Extract skin data to mesh".

Image

Now, you have a new brightly colored rifle in your scene, overlapping with your old one. Now, just delete the old one, leaving the new one intact.

Image

Now, basically what you are seeing is a visual representation of an enormous table I mentioned back (18k entries...). You can actually see that table if, before you delete the rifle, click Weight table under Modify tab.

Now, you will need to apply this data to the new Scoped ME2 rifle. Now, press Max's Menu, and you will need to Import an object into your scene (Merge):
Image

Find your Exported ME2 mesh, and Import it.

If you get this menu, select ONLY "WPN_ASLa_MDL" and nothing else.
Image

You should now have ME2's Rifle overlapping with ME3's Weight image. We're not done yet...
Image

First we need to add the bones to the mesh. Click "Add" next to label Bones when rifle is selected (not skin image), and select all bones and add them.

Image

Image

Now, we need to re-apply the skin influences. First, select both the rifle and mesh at once. Best is just to clip the edges of both with a small box, not to catch any bones in the frame:
Image

Image

Makes sure it's only two objects selected.

Next, to go Utilities, and press "Import Skin Data from Mesh". You will get this:
Image

Press "Match by name"

Image

And press OK. No visible change will happen in your scene, but you can now safely remove the skin image. If you want to know if you're successful, simply go to Edit Envelope and see if your rifle gets colored when selecting bones!
Image

If it looks like this, then we're nearly done! We're off to export out Frankenrifle. Find and run your ActorX Exporter utility:
Image

Make all your settings like this:

Image

And finally choose an output directory and file name to export your file. Your PSK skin should be written correctly.

Re-import

Now, with modified PSK, you're ready to re-import it into the game.

Using Meshplorer, simply open your ME3's Avenger PCC file again, and first, before importing, make your Import settings exactly like this:
Image
By default, Three settings need to be disabled (Flip Z tangent and bitangent, and swap tangents) and one turned on (Import bones). I've got myself frustrated a lot to apparently hit a dead end with my research, until I figured out that I hadn't turned on "Import bones". Stupid! Anyway...

Now, simply select your old rifle:
Image

Go to transfer, Import from PSK, find the one you just created, and voila!

Image

Now close Meshplorer (PCC is already saved), and open TOCbinUpdater. Run it on your TOCBin file and let it update the file properly.

If all is done well, your result looks like this:


Image
Please note, that in this screenshot I'm using a texture-replacement, you'll probably use the standard old texture. Also, if you're wondering where does the texture for the scope come from - from the old gun's texture. It actually has the scope in the texture that's applied to the rifle, but the rifle is UV mapped in such a way to not use that part of the image. They went some lenghts to remove the scope for no good reason.

Now, results are kinda satisfactory as it is. What follows is optional.


Advanced: Socket re-positioning [Still experimental, needs fix!]


Now, let's say we want to re-position the sockets, so that the scope is higher and barrel attachment is on the lower barrel (which makes more sense, obviously).

Open the PSK file in MAX using ActorX importer.

Now, as you already know, if we move the bone, parts of the gun influenced will move as well. The socket points are on the tips of the bones.

To move them, we first have to break the influence, and re-make the influence after we're done repositioning them. This part is a bit tricky. I've done some searching around and one simple method, which would make our lives easier, does not work for me. Allegedly, simply removing "Always Deform" Checkbox under Advanced Parameters in Max while rifle is selected should prevent the bone's influence. But that does not hold true for me. Instead, here is what we have to do:

First, before touching anything, find this:

Image

Save your existing Envelope somewhere you can find it. Now that you have, find the bone you wish to remove. Say it's the Barrel attachment one, Upper_Front. Click the rifle itself, and under the list of bones, find the one, and remove it.
Image

You will notice it does not remove the actual bone, only the entry from the list.

NOW you can move that bone around without it influencing the rifle's mesh. Once you've positioned it properly, Click "Add", add the bone back into the list, and then click "Load" and load your saved Envelope file (Simpy press OK, the window might look complicated). Once done, click "Edit Envelope" and click your repositioned bone and make sure it's still influencing the part that it was supposed to.

Before:
Image

After:
Image

Everything except "Saving" the envelope will need to be repeated for every point you wish to move. When you're done repositioning all the bones, save your PSK file. Then repeat the Re-import step of this tutorial.

If all is swell,
Image

Now, the reason why this needs fixing is because, even though you may move the bones yourself for the weapon mesh, next time any animation plays out, such as weapon assembling itself when you pull it out, the bones are going to their old places, which is where they're not supposed to be anymore.
Image
LOL! So that will require fixing animations. I'm gonna research that a little bit. If somebody has any ideas, let me know!

That's about it, let me know if I got anything wrong or something.

EDIT - Addendum:

Fixing Scope Influence


You probably noticed that, since scope itself didn't get any influences assigned, it's never going to move, meaning the weapon assembling animations are going to look weird and weapon on your back is going to look off.

Luckily, fix is as fun as it's simple. Promise! :)

Open up your PSK in Max. Click "Edit Envelopes", otherwise known as button that makes your rifle pretty colors. You will see that scope is currently belonging in Root bone, because it's red when you select Root.

Image

Now, if you select, for example this bone:
Image

Wouldn't it be awesome if we could just paint the scope red and have it recognised as influenced?

It would, and that's EXACTLY what we're going to do. See the big "Paint Weights" button on the panel? Click that, and click the small Wrench icon next to it.

Now you have an awesome targeting reticule and a control panel for it! If you try clicking it on the rifle, you'll see that it's precise function is painting colors which determine the influence of the bone!

Image

Setup your brush like this. You can put a Mirror option and automatically mirror changes from one side to the other side of the scope, i.e. you have two targeting reticules. With size 5 do the majority, and with size 3 the nech, and with size 1 the final part. You don't want to get some paint on the wrong part of the gun. If you get a little blue on there it's fine, but don't get it into yellow.

Blue = weak influence. Red = strong influence.

Image

Image

Image

Image

That's IT! Safe PSK, Import it into PCC via Meshplorer, and enjoy the results!

Image


PS. Oh and one more thing.

If you are fine tuning something, like position of the sockets (or anything that doesn't require a TOC update), you don't need to exit your game. Simply exit to Main Menu, alt-tab out of your game, use Meshplorer (which never needs to be exited as well!), import, and alt-tab into your game again. Simply click "Resume" and check for changes. This works best when in Normandy Deck 5, since you're in casuals, no weapons need to be loaded. Approaching the weapons' bench loads all PCCs anew into memory (only if you've exited to Main Menu, otherwise old PCC from RAM will be used, even if your new one is OK).

That's it. Have a nice modding day!
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

Re: Skeletal Meshes Tutorial (Scope on Avenger!)

Postby Methos » 24 May 2013, 06:46

OMS, thanks for this! Busy modding some weapons, this will come in handy.

EDIT: Just wondering, how does the game generate the HUD and power wheel (main wheel) images? Are they updated accordingly?
User avatar
Methos
User
 
Posts: 19
Joined: 12 May 2013, 07:52
Has thanked: 0 time
Have thanks: 2 time

Re: Skeletal Meshes Tutorial (Scope on Avenger!)

Postby Eudaimonium » 24 May 2013, 12:00

Methos wrote:OMS, thanks for this! Busy modding some weapons, this will come in handy.

EDIT: Just wondering, how does the game generate the HUD and power wheel (main wheel) images? Are they updated accordingly?


"OMS" as in "Oh my spirits"? :D

You may notice that the in-game Avenger's images are actually re-used from ME2 to start with, all HUD art except the colored image in Weapon Bench screen depict the scope already there. That single 512x512 pix image can easily be replaced. I'll render out the scoped version in that style (red backlight, lens flare from weapon light) when I feel like it :p
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: Skeletal Meshes Tutorial (Scope on Avenger!)

Postby Methos » 24 May 2013, 13:21

...soul...cough :P

Yeah, the shop images are easy.
Just thought I'd ask. I'm trying to find the HUD images (one in the bottom left corner, and the one in the hold/weapon-select "screen")...trying to perfect some of my own mods :)

Thx
User avatar
Methos
User
 
Posts: 19
Joined: 12 May 2013, 07:52
Has thanked: 0 time
Have thanks: 2 time

Re: Skeletal Meshes Tutorial (Scope on Avenger!)

Postby Eudaimonium » 24 May 2013, 13:32

While you're at it, if you ever happen to stumble upon the image that is the Galaxy Map pointer, please let me know.

You know, the pointy object with place for text, that's above all interesting locations on the Map? I'd like to replace that one for it's ME1 counterpart, so straight and with edges, instead of weird curvy one in ME3.
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: Skeletal Meshes Tutorial (Scope on Avenger!)

Postby Methos » 24 May 2013, 14:19

Have a look in: BioD_Nor_203aGalaxyMap.pcc

Methos has been thanked by:
User avatar
Methos
User
 
Posts: 19
Joined: 12 May 2013, 07:52
Has thanked: 0 time
Have thanks: 2 time

Re: Skeletal Meshes Tutorial (Scope on Avenger!)

Postby Eudaimonium » 24 May 2013, 15:54

I love you so much right now!

'Shots to come later!
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: Skeletal Meshes Tutorial (Scope on Avenger!)

Postby Methos » 24 May 2013, 18:33

BODY SHOTS!!...I know this restaurant...

Anyhooo...remembered I saw that after hours of texture browsing, wish I could find my own sh1t...sigh.
User avatar
Methos
User
 
Posts: 19
Joined: 12 May 2013, 07:52
Has thanked: 0 time
Have thanks: 2 time

Re: Skeletal Meshes Tutorial (Scope on Avenger!)

Postby Eudaimonium » 25 May 2013, 13:28

Hmm this is very weird.

I have made and replaced the blue arrow, upside down blue arrow (half resolution), and upside down green arrow.

They are correctly saved in the PCC you named, TOC bin updated, and yet my Galaxy map still shows the boring old arrows instead of my new ones.

Two questions:
1) Where are the actual images used for arrows in galaxy map?
2) Why are there images of arrows that apparently aren't being used anywhere?

So far, by manual search (just poking around) I haven't yet found any other images that would be the map's arrows.
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: Skeletal Meshes Tutorial (Scope on Avenger!)

Postby Methos » 25 May 2013, 15:04

Hmmm, maybe check for duplicate files in DLC. I found that DLC's can overwrite changes...will have a look when I get a chance.
User avatar
Methos
User
 
Posts: 19
Joined: 12 May 2013, 07:52
Has thanked: 0 time
Have thanks: 2 time


Return to TexMesh Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests

suspicion-preferred