Texture and Material porting to Source 2

Things you’ll need:

To convert the textures:

To convert the materials:

To extract assets from .vpk and .bsp:

Todo:

  1. Gather all of our materials in a folder with the default material structure - materials/*
  2. Convert .VTFs to .TGAs
  3. By using caseytube/source2utils, convert our .VMTs to .VMATs
  4. Move the converted files to the content folder of your target addon - steamapps/common/Half-Life Alyx/content/*/materials

Gathering the files

Gather all of our materials in a folder with the default material structure:

  • css
    • materials
      • bricks
      • building_template
      • cable

Converting the textures

By using a handy-dandy VTFEdit feature called “Convert folder”, we are going to batch convert all the .VTFs to .TGAs.

Open VTFEdit, choose Tools/Convert folder. Select the Input and Output folders, and copy the rest settings as shown.

Converting .VMFs to .VMATs

Install Python 3 and download the caseytube/source2utils repository as .zip.

Extract the .zip archive, open and go to source2utils/utils. By pressing File/Open Windows PowerShell on Windows Explorer, open Windows Powershell.

Once open, Install Pillow by entering this command:
pip install Pillow

Once installed, start vmt_to_vmat.py by entering:
python.exe .\vmt_to_vmat.py

You are now going to be asked to specify what folder would you like to convert. To get the valid format of the materials folder, select the materials folder by clicking once on it, and press the Copy Path button located in the Home tab on Windows Explorer.

You have just saved the path of the folder. Paste it into the Windows PowerShell window, but don’t forget to remove the " " -
D:\Users\*\Desktop\css\materials, not "D:\Users\*\Desktop\css\materials".

You are now going to need to select:

Would you like to overwrite any existing .vmat files? (y/n): - Y
Would you like to overwrite any existing .tga files? (y/n): - Y
What is your target shader? Valid Options: vr_complex (vr_standard support coming soon) - vr_complex

And you are done!

Moving Files

You are now going to notice a new folder - *_imported. It is going to contain all of the newly ported materials ready for Source 2! But we are still not done, we need to add them to the game!

Todo so, copy the materials folder to your created addons folder or the game content folder located at steamapps/common/Half-Life Alyx/content/materials
If done correctly, all of them should show up in the Source Workshop Tools Assets list!

cs_assault materials ported from Counter-Strike: Source.

12 Likes

You should add this to the wiki!
EDIT: Here, you can create it with this link Edit Page Not Found - S&box Wiki if you don’t know how to you can ask @Grodbert since he’s made one in the past or visit About This Wiki - Wiki Help for help with formatting.

1 Like

This is just begging for someone with C# knowledge to create a script. Imagine a “S1toS2” model converter where you take the Models & Materials folders and it’ll recognize both and immediately convert all the VMTs, VTFs, Rename the Bones, Replace the Sequences, and wrap it all in a bow.

1 Like

Didn’t Layla implement that already? It’s on the latest blog.

1 Like

2021-04-13 16_25_09-March 2021 - News - s&box - Brave

She added support for Source 1 models, not Materials or Textures. Also, by using my guide, you are able to port and use them in the HL:A Hammer editor.

1 Like

Typo noticed.

1 Like

Happy asset porting!

4 Likes

I was replying to @CutthroatJoe.

1 Like