banner



how to add models to sfm

Introduction

These instructions will tell you how to import Source Film Maker (SFM) models into Unity, through Blender.

They are based primarily off the now-dead instructions by Digitalzombie.

Software Requirements

  • Unity - download.
  • Blender - download. Used to convert 3d models to FBX format.
  • Blender Source Tools - download. Used to load decompiled SFM files into Blender.
  • BoneFix - download. Optional - used to fix skeletons.
  • Crowbar (ZIP Version) - download. Used to decompile SFM files.
  • VTFEdit - download. Used to convert VTF textures to PNG.

Installation

Installing Unity & Blender

Install Unity and Blender as normal - the default options should be fine.

Installing Blender Source Tools

  1. Load Blender and click on the Edit menu and choose Preferences.
  2. Click the Add-ons tab then click the Install button.
    Screenshot
    Install an add-on
  3. Locate the blender_source_tools.xxx.zip file you downloaded earlier and click the Install Add-on button.
    Screenshot
    Select Plugin File
  4. Check the plugin is active by typing "source" into the addon search box, and making sure the checkbox is checked next to Import-Export: Blender Source Tools.
    Screenshot
    Ensure Plugin is Active

Installing BoneFix

  1. Create a folder to store the scripts, and move BoneFix.py into it.
  2. Load Blender and click on the Edit menu and choose Preferences.
  3. Click the File Paths tab and set the Scripts folder to where you placed BoneFix.py, then click the Save User Settings button.
    Screenshot
    User Scripts Folder

Installing Crowbar & VTFEdit

Extract the each zip file into its own folder.

Convert the Model

Your SFM file will probably be a zip file - extract it and find the folder with the .mdl file you want to use.

Before starting, it's best to create a new folder to store your converted model and textures in.

  1. Load Crowbar and on the Decompile tab, open your .mdl file.
    Screenshot
    Choose your File
  2. Click the Full path radio button and choose folder you want to put the decompiled files in, then click the Decompile button. You can leave all the options at their default values.
    Screenshot
    Decompile the Model
  3. When decompilation is complete your model will be ready to import into Blender, but the textures need converting separately.

Convert the Textures

  1. Open VTFEdit and click the Tools menu then choose Convert Folder.
  2. Select the input folder that has the .vtf and .vmf files in it. Select an output folder for the .png files - use the folder you created for the decompiled model. Click the Convert button to convert the textures.
    Screenshot
    Decompile the Textures

Fix the Skeleton (Optional)

This is an optional step - follow it if your model has a skeleton you want to use in Unity

  1. Click the mode tool and select Object Mode then right-click on any bone to select the skeleton.
    Screenshot
    Select the Skeleton
  2. Go to the Python console by clicking the window button and selecting Python Console. Note - this was called Scripts in older versions of Blender.
    Screenshot
    Go to the Python Console
  3. Run the script using the following code (don't forget to change the script path!):
    exec(open("c:\\users\\RoBorg\\Documents\\Blender Scripts\\BoneFix.py").read())

    If you're using Python 2, you can use this instead:
    execfile("c:\\users\\RoBorg\\Documents\\Blender Scripts\\BoneFix.py")

how to add models to sfm

Source: https://roborg.github.io/sfm-to-unity/

Posted by: sheleybestione.blogspot.com

0 Response to "how to add models to sfm"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel