Space Engineers

Space Engineers

43 ratings
Porting Source Engine models into Space Engineers
By Rōnin and 2 collaborators
Hello there, potential model importer!

We all know the source engine. It's a beautiful thing, and it has the largest amount of custom content made for it (mostly thanks to garry's mod), which means we have a huge selection of things to pick from!

But there are somethings to go over before we dive in!
   
Award
Favorite
Favorited
Unfavorite
A BIG WARNING ABOUT COPYRIGHT
Garry's mod right now has about 36,000 addons and encounting. That's not even accounting for the several hundred websites that host it's content, and even the source models that are scattered about for various other games sites for other source games. There's probably about a million different models for the source engine, all over the web.

It is important to know, that some of this content is heavily protected by copyright. This mainly revolves around:

Content by Microsoft (I'm mostly refering to Halo here)

Content by Disney (Star wars, so many DMCA nightmares have happened to many people oblivious to the hefty protection it has)

Custom scratch made models (A lot of authors are a bit picky with thier hard work, I can't blame them)

It is KEY before you go on and bring in any models that you ask for permission! Most authors just simply say "Just credit me and/or add me as a contributor and we'll be fine" But it's always safe to check before you go on about this, especially if this is the first time and you really don't know what's going on here. Don't want put in all that work only to not be allowed to publish it.

Check yourself before you wreck yourself, because DMCA and copyright issues are no joke, and they really can mess things up for you.

With that aside, I will not take any claim nor responibility for any DMCA or Copyright issues that may or may not arise against you, as you are porting these models out of your own free will and taking the potential risk. It is always important to check and see if a developer has had a bad history of nasty DMCA fights against modders before you go on around and port things.

However, most developers are nice and friendly or just passive, and do appreciate seeing thier work spread out elsewhere. When you write the credits, make sure you give credit to them alongside with the person/people who ported the models you're about to bring into Space Engineers.
Intro and Tools of the trade
Make sure you read the section above very carefully, or it might not end well for you!

Welcome! Now we're in the good stuff. But you can't build a house without the right tools!

We're going to need the following for models

Tools:

The video tutorial, the SE skeleton for blender, and the mod folders [www.dropbox.com]

Crowbar Decompiler Tool

Blender

Source Tools for blender [steamreview.org]

And the following for the materials
VTFedit [nemesis.thewavelength.net]

Paint(dot)net [www.getpaint.net]

GIMP [www.gimp.org]

GIMP DDS Plugin [code.google.com]

Notepad++ [notepad-plus-plus.org]

You'll also need a legal copy of BOTH Half Life 2 AND Garry's Mod. Using pirated copies can cause terrible effects (since the files could possibly be modified without your knowledge and may contain viruses!)

Blender and it's source tools are for the modeling portion

VTFedit, Paint(dot)net and gimp are for converting textures.

Notepad++ for setting up the Batch file and the XML files in the folder's I provide you with.

They're all free (except Garry's Mod and Half Life 2)

Why do you need Half Life 2 and Garry's mod?


Half life 2 is the bare minimum to get garry's mod running, but if you get the valve complete pack that's even better (it's usually 25$ every sale, contains every official source game ever made)

Garry's mod is where you'll find the models the easiest. But you'll need a GMA extracter to get the addons out of the file. It will also grant you access to garrysmod.org, which also contains many addons to be put to use!

If you're using the steam garry's mod, use this GMA Extractor [www.treesoft.dk]

Again, do not use any pirated copies, it can cause some severely adverse effects and could even put a virus in your files!




Basic Controls you'll need to know for blender.
When you're selecting parts of the model, Right click highlights the vertice closest to the cursor.

To navigate the camera, Clicking and Draging with MMB held down moves it around the model spherically, Shift+MMB moves the Camera itself, zooming in and out.

If you move the 3D cursor by accident, just set it to 0,0,0 XYZ, it'll go back to center.

If you accidentally move the model, right click it again and it'll just move back to the previous place. Or set up its coordinates at 0,0,0 XYZ.

If you mess up, either starting a new file or the Revert button will help.Revert will take you back prior to the SMD implant, new starts it fresh.

CTRL+Z (undo) is also your friend.

CTRL+L In edit mode is useful. After you right click and select a triangle, pressing it will select all linked flatfaces to it. So if click on a triangle on a piece of armor (Like a should pauldron) It will select the entire pauldron but only the pauldron. This is needed for weights and assigning vertex groups. A very useful shortcut

The H key is the hide tool. H will hide the selected Triangle(s). This is useful for finding hidden vertex triangles that are unweighed but can't be seen through normal means (as in it's under many layers) Alt H will un hide all currently hidden vertex groups.

The A key selects EVERYTHING connected to the a part of a model. Not the whole model, but parts of it connected. Like the fallout power armor, if I hit A on the cloth regions, the entire body under the armor will be selected, but the armor itself won't. You'll have to do this at times to see if there's triangles in the certain regions that are unweighed but this is usually rare as blender is good with armor (again, usually).

BEYOND THIS POINT: This guide is written with the implication that you are reading it WHILE watching the video. The guide explains things that I do in the video in depth, and provides you with any information you may or may not have missed while watching the video.

Model Import Time Stamps, In Depth explanations (1:00 to 5:05)
0:00 to 1:00


This is just the text pad intro, half way through I make the offer of how if anyone can make a better tutorial on youtube or something like that, I'll add them as a contributor and the video will be at the top of the guide.

1:00 to 1:20


The model file was already open for me, but in your case you simple have to open it in blender.

Then you have to click on the Manipulate Center Points button near the bottom. (The button with the 2 way arrow, 3 blue dots above it) Make sure it's Light Gray or it won't let you edit the SMD when you import it.


1:20 to 1:50


This is me selecting the Reference SMD. Never select the QC files, always pick the Reference SMD.

LOD Reference SMD's should only be use IF the model has special effects (like the tesla power armor did in Garry's mod)

1:50 to 2:20


This is the part where we test out the SMD to make sure that it lines up with the skeleton, and that it scales properly. Some model's test poses aren't always like the Combine Soldiers, and as a result will need to be posed. But because we didn't need to pose his joints around the skeleton as he already lines up with it, we can just re scale him and delete the old Valve Skeleton.

2:20 to 2:50


After deleting the skeleton you must delete Old Vertex Groups or this will cause weight problems later on. Click on the downwards Facing Triangle next to the Modifer Wrench Icon, the click Vertex Groups. This will show all the Valve Biped stuff. We must remove it to ensure no unwanted weight or anything gets applied to the model when it is compiled.

There should be a vertical plus, minus and down arrow next to the list. Hit the arrow, and a dropdown menu will appear. Click Delete all Groups, this will remove all of the Valve Biped and prevent any issues in the future.

The armature modifier will only be there if you didn't have to pose the model around the skeleton. If it's still there, delete that as well so that it won't break the model and will use the space engineers armature when you apply weights.

2:50 to 3:50


We're going to go into edit mode, and check off the Show Weights box. This will set it up for later.

Back into object mode, we need add weight to this guy (so that Space Engineers can apply gravity to him and what not) The simplest way is to head to the list in the upper right hand corner and simply click and drag the reference file over the se_main_root (the skeleton)

Then we will select "With Automatic Weights". The reference file should now be under the skeleton with the Dummy's in the list.

If a model can't have automatic weights applied (bone heat error)
Apply a Subsurface modifier (Simple) than re-triangulate it (all of this found in the modifier section).
The weights now apply
And if that doesn't work, Mesh(near object mode)>Vertices>Smooth vertex after selecting all will fix it too.

Now that we've got weights, we need to head back into edit mode. If you already checked off show weights, you'll see that the foot is now rainbow like. That means it has weight.

However, Some models have issues where attachments don't have weights, and as a result, can break the whole model. It is key to take any weightless attachments, and assign them to a weight groupWe must first find out what the Weightless items are in weight paint mode, in the left panel under 'Options', you can enable 'Show Zero Weights'. setting it to 'All' should show unweighted verts as black.


3:50 to 5:05


I made various adjustments to the weights.

Blender sometimes assigns weights to places they don't belong. This mostly occurs with the Upper Arm regions, the forearm regions, and even fingers. This mainly happens when a model has attachments or bodygroups (like bags and equipmet) near the shoulders or near the lower waist, especially the sides. Sometimes thigh attachments (like a pistol holster) have issues as well.

In this case blender put the weights of the combine gas cap to the upper arms and neck instead of the head, so I had to delete those weights in order to prevent the gas cap from moving all over the place.

Any BLACK regions that pop up are weightless regions, just use CTRL L trick mentioned before, select the weightless part and assign it to the proper vertex weight group

Use the arrow keys to navigate the Vertex Group's section (up and down) to see weights throughout the model.

As you can see, the CTRL+L trick mention earlier helped me select entire regions that needed weight. The key thing is to assign weights to the proper areas, mainly in places where there's a connection (like the pelvic guard being attached to the armor in the 3rd spinal region) and remove any from places where they don't belong. (like the gas cap being bound to the upper arms instead of the head)

With all the weights assigned, we can now go and convert the materials.

A bit of advice here for shoulder pauldrons (those parts are usually the biggest issue)

If the shoulder pauldrons are vertical and attached to the upper arm, they should only be assigned to the upper arm region.

If they're Slanted across the collorbone and touching the upper arm, they should be assigned to both the upper arm and collorbone regions

If they're horizontal, they should only be bound to the collorbone, not the upper arms.


Material Conversion Time Stamps, in depth explanation (5:20-11:50)
5:20 to 6:20


This section involves VTF edit.

Simply open up the VTF file of your choice, and under file, select EXPORT and use the BMP format.

If you're doing multiple files

To convert a single texture, use the export command under File.

To convert a bunch of textures, use the Convert Folder tool in the Tools menu. Just select an Input Folder (where your .vtf files are), an Output Folder (where you want your .bmp files to go), enter *.vtf as the filter and press Convert. If Recurse is checked, subfolders will also be processed.

6:20 to 7:20


Now we use Paint. net to convert from BMP to DDS. Simply open up the newly made BMP file in Paint. net, go under file and click Save as and pick DDS format.

The settings should be:

DXT5 Interpolated Alpha
Compressor type should be Cluster Fit
Error Metric should be Perceptual
Generate Mipmaps should be on.
Weight Color by alpha should be off.
Fant should be selected in the dropdown

Click OK, and now you've got yourself a fully made DDS file.

7:20 to 10:50


Now we must add an alpha layer so that the textures will display correctly.

Open up the newly made DDS file in Gimp. Say ok to the dialog that appears, and
you have to add a Alpha Map for space engineers to display the materials correctly, so open up gimp and

layer > transparency > threshold alpha, set to 0

This will remove the old broken alpha map from source, but we're going to need a new one.

right click layer > add layer mask

If your model came with any kind of specularity map (should look like the normal texture but grayscale) you can use it here. to do it, follow these steps:

-drag the spec map to gimp. it should appear over the image you were editing.
-press CTRL+X
-on the layers window there should be a layer with two thumbnails, one being the texture and one is white
-click the white thumbnail
-press CTRL-V twice
-click on the trash bin that is below the layers window

now you have a proper spec map in your texture and can proceed. if you dont have a spec map though, youll need to use the paint bucket with 50% opacity.

If you don't set the opacity first it won't work and will be solid black instead of gray, Don't do that!

Click "Layer's Alpha Channel" then OK
select fill bucket tool
select black color
Set Opacity to 50% (grey, Space Engineers Default Alpha Map Color)

Then click on the picture, a gray checkerboard that's semi-transparent should appear. This means the alpha channel is ready, and now the model's materials will be ready to work with the game.

Save the file as an XCF (so the changes remain), then depending on what was converted.

if it's a normal colored texture (like the video) it should be exported as a _cm.dds and a _de.dds

If it's a normal map, it should be exported as a _ng.dds and a _ns.dds

_add.dds is a blank red texture. This is supposed to be for Additional details but in most cases it's not needed.

When you export the DDS from gimp, the settings should be
BC3/DXT5 Compression
Generate Mip Maps.

Open up the advanced panel to check and see if everything is ok. Then Export the material twice (either as a CM and DE, or a NG and NS) and close out gimp.

10:50 to 11:50


Click on the "Type of active Data" button (2 icons to the left, looks like a crash dummy symbol). A white sphere will appear. Depending on how many textures the model uses, you will need each one filled with it's respectively named DDS file.

Head over to the Checkerboard icon just next to the previous, this is where we load the DDS files to apply the textures. Click New and a menu will dropdown showing a black box with the word "Preview"

Load up the BMP file and you should see the material fill in the "preview" window that was previously black. DO this for each layer until all of them use the correct corresponding materials they used in Source Engine.

In order to check and make sure ALL materials applied correctly, click on Material Paint (the same place where you found Weight Paint) if it looks just like it did in the Source Engine, you did everything right! Any missing textures will be eyeblindingly pink, letting you know you missed something. It's easy to tell if you applied something wrong as well. Sometimes you have to re apply the same texture more than once to get the appropriate look.

Now save it as a blend file. Name it whatever you like, but i like to keep it to the original and just add an se_ prefix to it.

Exporting the Blend file, setting up the folders.
A Quick Setup


Place the appdata folder within the zip file provided above in Users\*name*\AppData\Roaming\SpaceEngineers\Mods\

Place the MODSdk folder in common\SpaceEngineersModSDK\OriginalContent\Models\Characters

The MOD Sdk is where you will export the blend as an FBX to. It must end up in the same directory as the XML

The Appdata folder is the mod itself for space engineers. I provided a ADD texture to use so you don't have to go through the hassle of trying to make one. CM, DE, NG and NS are made by you by exporting from gimp.

*_de.dds - This is meant to be colored, same as CM
*_ns.dds - Normal Map for DX9
*_cm.dds - Color(albedo) and Metalness map (alpha)(Normal colored texture goes here)
*_ng.dds - Normal map and Gloss map (alpha)(Normal Map goes here)
*_add.dds - Its meant for extra details but leave it red unless you know what you're doing.

12:35 to 14:30

We must now export our blend file into an FBX, Make sure you have the following settings

Under Main:
Selected Objects is unchecked

Scale is 1.00
Foward is -z foward
Up is Y up.

Empty, Armat,Mesh and Other are selected
Camera and Lamp are de selected.

Custom properties and Experimental are unchecked.

Pathmode is auto

Batch mode is off

Under Geometriec:

Apply Modifiers is Checked

Loose edges is unchecked

Smoothing is Normals only

Tangent Space is checked.

Under Armatures:

Only Deform bones is Unchecked
Add leaf bones is unchecked

Primary is Y Axis
Secondary is X axis

Under Animation, just Uncheck Baked Animation and it will uncheck everything else for you.


14:30 to 19:00


This is basically showing how the batch file should be set up, and how the XML should look.

I forgot to mention during the XML section, ONLY delete the material blocks you don't need. Without a material block the model will have no materials and will not process.

19:00 to 23:48 (end)

If the error pops up, that means it's processing new reference link for that model set of materials. That's a good thing

If red text pops up in the batch file, that means you either

Forgot to add weights to a triangle vertice (easy fix, just head back to edit mode and move through the model)
Messed up the XML file (again, easy fix)

If it's saying it can't find the DiffuseTexture or something like that, it means you either messed up the Material Reference name, the path to the materials, or you messed up the names of the material itself. Just a simple fix, make sure it's all named exactly after the material reference (it's case sensitive)


Conclusion
That's all there is to it. Edit the SBC file to use your model (a simple task, just copy the name from the mwm's name in the models folder) and give it a name.

It should work at that point and show up in the menu at that point.

I hope the guide wasn't too terrible. If you're sitting there confused, ask any questions here in the comments or add me on steam and we can talk it out. It's not the best guide but it will have to do.

Remember, you're supposed to watch the video ALONGSIDE with reading the guide, pausing here and there.

When you get the hang of it all, the process is relatively short and simple.

Credits:

CJay for providing all these resources, mainly the blend file, the batch file and just teaching me how to do it all. I really owe it all to him for the help he's given me.

The makers of Paint.net,Gimp,Crowbar,VTFedit and blender, for such excellent, free and easy to use tools.

Valve for the combine model, and the source engine.

KEEN for the MOD SDK kit, and being so open to modders.
24 Comments
BANAИA 15 Dec, 2020 @ 8:37am 
Is there a way to do this in reverse, to port S.E. models into Source?
Qurinesk 12 Aug, 2019 @ 9:45am 
Looks like I won't be able to make a server for the Mass Effect universe :C
Still, thank you for this guide.
Rōnin  [author] 12 Aug, 2019 @ 8:54am 
This guide is heavily outdated, and it seems keen has made it near impossible to port models. Had a guy contact me a few monthes ago trying to get this to work and it seems unlikely it will.
Qurinesk 12 Aug, 2019 @ 1:55am 
Hello [mR]Danp1970! Can you help me, please?

I have a problem with a red text pops. I've checked the whole model and haven't found any black triangles that don't have weight yet.

Here the sreenshots:
1) build.bat: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1832472078
2) Blender: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1832472335

I'm new to this, sorry if I make stupid mistakes.
The Coffee Man 16 May, 2019 @ 9:19pm 
Does this still work in 2019? Can anyone confirm?
TauXv9 30 Dec, 2018 @ 2:09pm 
Hey so i keep getting a red error and i checked everything and i can't find where i'm missing something i have all my weights that i know and paths correct so i'm at a loss.
Cackles 21 Feb, 2017 @ 8:34pm 
bummer, I'm not having much luck finding any sort of guides for adding custom character models to ME yet
Rōnin  [author] 21 Feb, 2017 @ 7:20pm 
Nope. Medieval Engineers has a unique skeleton and a different animation set than Space engineers.
Cackles 21 Feb, 2017 @ 6:37pm 
Any chance this would work with Medieval Engineers?
Saxxon 7 Jan, 2017 @ 6:36pm 
Are you still planning to update this tutorial with another video? I'm struggling with this one mostly because of the different Blender versions.