Saturday, July 5, 2014

Installing the Substance UE4 Plugin


I recently bought the Substance Indie Pack off Steam. This allows you to build complex Materials for UE4.

More Here:
http://www.allegorithmic.com/products/substance-indie-pack

The rub is you have to rebuild UE4 from source to use the substance plugin. Expect this to take a few hours to sort through...

Here are my notes on how to do this:

Instructions for the non-substance/epic part:
https://github.com/EpicGames/UnrealEngine

Instructions that include substance are in this forum:
http://forum.allegorithmic.com/index.php/topic,1223.0.html

01. Install git
    > I already have git installed. You can find it here: http://git-scm.com/downloads

02. Install Visual Studio 2013 Express for Windows Desktop (you'll need it to compile this)
    > http://www.microsoft.com/en-us/download/details.aspx?id=40787 (3.2GB space used)

03. Link your git account to your UE4 account
    > https://www.unrealengine.com/settings
  
04. Download Allegorithmic's source code from their github page
    > fork the Allegorighmic UE4.2 version: https://github.com/Allegorithmic/UnrealEngine
    > NOTE: If you get a 404, it means you didn't properly link your unreal account to git
    > Substance (4.2.0.1)
    > Here are my repositories: https://github.com/{github username}?tab=repositories
    > clone it
      > open Git GUI
      > Repository Clone
      > Source Location: https://github.com/{github username}/UnrealEngine
      > Target Location: {git parent dir}/git/ue42 (don't create the ue42 directory... clone will do that)
      > I had to key my userid/password 3 TIMES

05. Download the 2 dependency packages
    (Required_1of2 and Required_2of2) from Epic's UE4 Github page.
    > UE4 current version is 4.2.1 (https://github.com/EpicGames/UnrealEngine)
    > extract these into your {git parent dir}/git/ue42 directory

06. Download Substance's required files
    https://github.com/Allegorithmic/UnrealEngine
    > SubstanceRequired_1of1.zip
    > extract this into your {git parent dir}/git/ue42 directory (it will overwrite 1+ files)
    > you should now have 3 directories: Engine, Samples, Templates
  
07. Navigate to the ue4 git root folder ({git parent dir}/git/ue42)
    > where you'll find the "GenerateProjectFiles.bat" and ".command" files

08. Run the GenerateProjectFiles.bat

     This create Visual Studio solution files

09. Double click the .sln file to open it in Visual Studio. 
   Wait for it to load everything.
    > this takes a while (10-15 minutes)

10. go to Build -> Build Solution in the menu
   This will start compiling the Unreal Engine.
    > this takes a while (10-15 minutes)
   
Congrats, your build is complete. Now to run it...

OPTION 1 : Running UE4 within Visual Studio (you plan on writing c++ code)
   
01. Set your start up project in Visual Studio to UE4
    > On the right in the "Solution Explorer" pick UE4
    > On the Project menu, choose Set as StartUp Project

02. Press F5 to start UE4 (Debug -> Start Debugging)
    > When I did this I got a dialog: This project is out of date: "UE4 - Development_Editor x64"
    > I said no to rebuilding it.

OPTION 2 : Running UE4 from an Exe (You just want to use Substance)

 Open the editor by navigating to the /Engine/Binaries/[YourPlatform] folder and
 open UE4Editor.exe. Then just enable the Substance plugin in the editor's plugin
 manager and restart the editor, and you're golden.
 > my editor = {git parent dir}\git\ue42\engine\Binaries\Win64\UE4Editor.exe

This fires up the launcher which can be very confusing. I didn't dig that.

OPTION 3 : Associate your unreal project files with your new UE4 executable

 1. Double click on Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe
    > this pops up a dialog "Configure this directory as an Unreal Engine Installation? (click Yes)
    > Response: Registration successful
 2. Find any unreal projects you want associated with the new executable
    > right click on the uproject file and select "Switch Unreal Engine Version..."
    > pick your custom Executable
 3. Fire up the launcher
 4. Go to the library tab and pick your project

 If it starts recompiling your shaders you know it is working
 > You can also verify it is working by firing up the Task Manager and seeing where UE4Editor.exe is running from.

VERIFYING THE PLUGIN IS INSTALLED

1. Within the editor pick "Window:Plugins" from the menu
2. Pick "Editor" and scroll down. You should see "Substance"

No comments:

Post a Comment