View on GitHub

UEPlasticPlugin

Plastic SCM Plugin for Unreal Engine

Plastic SCM plugin for Unreal Engine

release Join the chat at https://gitter.im/SRombauts/UE4PlasticPlugin

This is the official Plastic SCM Source Control Provider plugin for Unreal Engine 4 & 5 (UE 4.11 to 4.27, and UE 5.0 to 5.1). An old version 1.4.6+ has been integrated in Unreal Engine 4.24 and has been shipping with it since then. The most recent version 1.6.2 has been integrated in Github for the upcoming Unreal Engine 5.1 so it is eventually going to ship to everyone. But in the meantime, if you have a project of a certain size, chances are you need to upgrade manually to a version we provide from Github in order to benefit from all the performance improvements we have made since then. See the Status section below for more details.

It is not intended to replace Plastic SCM GUI or command line interface “cm”. It is a complementary tool improving efficiency in your daily workflow with assets in Editor.

It automates tracking of assets, brings common SCM tasks inside the Editor, and provides visual diffing of Blueprints. It also helps import an existing Unreal Project into source control, with appropriate ignore.conf file. Since Unreal does not manage C++ source code, but only assets, the plugin is especially useful for GDs and artists.

Table of Contents

User Guide

Plugin Setup

Unreal default version of the plugin

An old version of this PlasticSCM plugin 1.4.6 has been integrated in Unreal Engine and has been shipping with it since UE4.24 and UE5.0. A very recently updated version 1.6.2 shipped with UE5.1.

Why?: Why is it integrated, as opposed to, eg. being shared through the Marketplace?

It helps with discoverability of the plugin, and it is the easiest way to get started with Plastic SCM in Unreal Engine. But it will always be lagging somewhat behind the latest release in Github.

Manual installation from the latest version here

Why?: Why would you update to latest version in Github?

If you want the latest features, performance improvements and bug fixes that are missing from Unreal integrated plugin.

  1. Download the latest binary release UE5PlasticPlugin-x.x.x.zip targeting your UE5 version (resp UE4).
  2. Either:
    1. Unzip the content of the ZIP directly at the root of your project folder. This creates a “Plugins\UEPlasticPlugin" subdirectory into your project. This is the way to go to use Plastic SCM on a specific project, and to share the plugin with other team members by adding it to source control. Some users reported they also had to remove the integrated plugin from “Engine\Plugins\Developer\PlasticSourceControl” to avoid a collision. This is only needed for some specific use case I have not yet identified (eg. on CI/CD, or on Unix OSes).
    2. Unzip the content of the ZIP in the Engine\ directory of UEX.Y directly for all your projects (for instance “C:\Program Files\Epic Games\5.1\Engine") This creates a “UEPlasticPlugin” folder into the “Plugins" subdirectory. Then remove the integrated plugin from “Engine\Plugins\Developer\PlasticSourceControl” to avoid the collision. This is the way to enable Plastic SCM for all Unreal Engine projects on the machine.
  3. Then, launch your Unreal project, click on the Source Control icon “Connect to Source”, select “Plastic SCM”.

How to build from sources

Why?: If your project is already a C++ project, you only have to re-generate Visual Studio project files (step 4 below) and the plugin will get rebuilt the next time you compile your project.

Else, if you want to rebuild the plugin for a Blueprint project:

  1. You need Visual Studio 2015 or 2017 with C++ language support (free Community Edition is fine).
  2. Launch the Unreal Engine Editor, create a new C++ Basic Code Project (No Starter Content), for instance UnrealPlasticSCM. This should launch Visual Studio, build the game project, and open it into the Editor.
  3. Close the Editor, then using the file explorer, create a new Plugins directory at the root of your project.
  4. Clone the source code of the plugin into this Plugins directory (for instance Plugins\UEPlasticPlugin).
  5. Right-click on your project’s .uproject file, Generate Visual Studio project files.
  6. In Visual Studio, Reload All and Build Solution in Development Editor mode. That’s it, the plugin is built (resulting dlls are located in Plugins\UEPlasticPlugin\Binaries\Win64).

To release the plugin, zip the Plugins folder. But before that, remove the Intermediate, Screenshots and .git folders, and also the big *.pdb files in Plugins\UEPlasticPlugin\Binaries\Win64.

Project Setup

Start by saving your connection credentials with the Plastic SCM GUI

Enable Source Control

Launch you Unreal project, look at the Source Control menu at the bottom-right Source Control Connect

Launch you Unreal project, click on the Source Control icon “Connect to Source” Source Control Connect

Then select “Plastic SCM” plugin Source Control Connect - Select Provider

Create a new workspace & repository directly from Unreal

Source Control Login window, to create a new workspace/a new repository, click on “Initialize workspace” (example of a cloud repository): Source Control Login window - create a new workspace on cloud

Or on a server running on premise, using ip:port: Source Control Login window - create a new workspace on localhost

This creates an appropriate ignore.conf file, add all relevant files to source control (.uproject, Config & Content subdirectories) and can also do the initial commit automatically at the end.

Wait for this to succeed before accepting source control settings to not lock the UI & mess with the initialization! Source Control Login window - checking files in source control

Source Control settings

Source Control Settings

Source control settings can be changed using the Source Control menu, and are saved locally in Saved\Config\WindowsEditor\SourceControlSettings.ini.

Sharing settings

In order to share this with the team, copy and rename this file into Config\DefaultSourceControlSettings.ini, add it to source control and submit it.

The minimal useful setting would be selecting the proper provider, but it can be useful to set a few settings if different than the defaults:

[SourceControl.SourceControlSettings]
Provider=Plastic SCM

[PlasticSourceControl.PlasticSourceControlSettings]
BinaryPath=cm
UpdateStatusAtStartup=False
UpdateStatusOtherBranches=True
EnableVerboseLogs=False

Project Settings

Source Control

Unreal Engine allows you to configure project-related settings.

TODO: Some are not yet supported by the plugin:

Project Settings - Source Control

Source Control - Plastic SCM

The plugin allows you to configure project-related settings.

Project Settings - Source Control - Plastic SCM

There are 3 settings available at the moment:

Editor Preferences

Source Control

Unreal Engine allows you to configure Editor behaviors. In particular:

Editor Preferences - Source Control

Working in Editor

Unreal Documentation

Official documentation from Epic Games:

Plastic SCM forums:

Status Icons

New Unsaved Private/Not in source controlled Added to Source Control Controlled/Unchanged

  1. New, unsaved asset (not yet present on disk).
  2. Private, the asset is not in source control.
  3. Added to source control.
  4. Source Controlled but not checked-out nor locally changed

Changed Locally but not Checked-Out Checked-Out Redirector added by a Move Moved/Renamed

  1. Locally Changed without checkout, or Private ie not source controlled
  2. Checked-out exclusively to prevent others from making modifications (if Locks are enabled on the server)
  3. Redirector added by a Move
  4. Moved or Renamed

Checked-Out/Locked by someone else Not up-to-date/new revision in repository Newer change in another branch Merge Conflict

  1. Locked somewhere else, by someone else or in another workspace (if Locks are enabled on the server)
  2. Not at head revision, the asset has been submitted with a newer revision on the same branch
  3. Changed in another branch, the asset has been changed in a newer changeset in another branch
  4. Merge conflict, the asset has been changed in two separate branches and is pending merge resolution

Source Control Menu

Unreal Engine 4 Source Control Menu

Source Control status tooltip, when hovering the Source Control icon in toolbar: Source Control Status Tooltip

Source Control top Menu, extended with commands specific to Plastic SCM: Source Control Top Menu

Unreal Engine 5 Source Control Menu

Source Control Menu and status tooltip, extended with commands specific to Plastic SCM: Source Control Menu

Each Asset Editor also provide some source control operation, typically to Submit Content: Asset Tools Menu

The Blueprint Editor also provide a toolbar drop-down to visual diff against a previous revision: Blueprint Toolbar Diff drop-down

Source Control Windows

Using the Content Browser context source control sub-menu, you can call in specific actions and windows: Content Browser Context Menu

Submit Files

Submit Files to Source Control window, to check-in selected assets directly (see also Changelists below): Submit Files to Source Control

View Changelists

Changelists are the new way to group checked-out files by topic in Unreal Engine 5.0, to submit them in coherent batches. UE5.0 includes Validation checks to ensure there are no missing dependencies outside a changelist, and that all assets are saved on disk before submitting. Changelist Window

File History

File History window, to see the change-log of an asset: History of a file

Blueprint Diff

Visual Diffing of different revision of a Blueprint: Blueprint Visual Diff

Material Diff

Textual Diffing of a Material: Material Diff

Redirectors

When Source Control is enabled Unreal creates a redirector whenever an asset is renamed or moved, so that other developers relying on its old name / location can still work with other assets referencing it.

This means, you end up with two files that you have to submit, even if by default they don’t show up in the Content Browser.

You can show them in the Content Browser using a dedicated filter: Source Control - Show Redirectors

You can also delete them recursively using the context menu “Fix Up Redirectors in Folder”: Source Control - Show Redirectors

Detect Changes on other Branches

If you are making use of multiple branches, either for releases and patches, or for tasks or features, you can enable an option to check for changes in all other branches.

Enable “Update Status” to also checks the history to detect changes on other branches: Source Control Settings

Tooltip in the Content Browser when an asset is already checked-out somewhere else: Asset checked-out by someone else

Tooltip in the Content Browser when an asset has been modified in another branch: Asset modified in another branch

Warning when trying to checkout an asset that has been modified in another branch: Warning on checkout for an asset modified in another branch

Warning when trying to modify an asset that has been modified in another branch: Warning on modification for an asset modified in another branch

Merge conflicts on Blueprints

In case you ever use branches with binary assets without relying on exclusive checkouts (file locks) (see Workflows below) you will encounter cases of merge conflicts on binary assets. You have to trigger the resolve in the Plastic SCM GUI, but then skip it without saving changes in order to let the Editor present you with a visual diff.

TODO: take screenshots of Plastic SCM GUI

Branch explorer showing the merge pending with an asset in conflict: Merged branch with a pending conflict resolution

Corresponding icon in the Content Browser (only showing after the resolved has been triggered in Plastic SCM): Merge Conflict

Right click on the asset in conflict to open the Merge Tool (just a conflict solver with 3-way Visual Diff, no merge): Merge context menu

Visual diff of Blueprint properties in conflict: Merge of Blueprint properties

Visual diff of a Blueprint Event Graph in conflict: Merge of Blueprint Event Graph

Workflows

Mainline

The most common workflow with Unreal Engine binary assets is the one taught by Perforce: It relies mostly on one main branch (stream) for everyone with exclusive checkouts (locks) for the whole Content/ subdirectory, in order to prevent merge conflicts on a uasset or a umap file.

This typical workflow would work the best with the workspace in partial mode configured using Gluon GUI. The reason is that a partial workspace enables you to checkin assets without the need to update the workspace before.

  1. update the workspace (get latest) using Gluon GUI, with the Unreal Editor closed (since the Editor is locking assets, but also .exe & .dll files that might be in source control)
  2. start the Editor, make modifications and checkout assets
  3. then check-in (submit) the assets, either from within the Editor, or from the GUI after closing the Editor (the benefit of closing is you ensure that everything is saved)
  4. when needed, close the Editor and update the workspace again

If you try to use a full workspace (with Plastic SCM GUI instead of Gluon) you will often need to update the workspace before being able to checkin.

Task branches

Handling of binary assets works best in only one branch (regardless of the source control used) since they cannot be merged, and since they increase the cost (time/bandwidth) of switching between branches.

But with Plastic SCM you can use branches that are easy and cheap to create and merge: using them for code will enable you to leverage the built-in code review on these branches.

Note that some studios also use task branches for assets, and include them in their code reviews. Plastic SCM locks extend to all branches, preventing two people from working at the same time on the same assets regardless of the branch they are one. The Plastic plugin also offers some branch support to warn users if an asset has been changed in another branch.

To use branches, you would need to also close the Editor before switching from a branch to another, and before merging a branch into another:

  1. create a child branch from main using Plastic GUI
  2. switch to it, updating the workspace, with the Unreal Editor closed
  3. start the Editor, make modifications and checkout assets
  4. then check-in the assets (remember to save everything, or close the Editor to make sure of it)
  5. close the Editor
  6. create a code review from the branch
  7. create a new task branch from main or go back to main to merge branches

The plugin also leverages the visual diff merge conflicts resolution tool from the Editor but this is a pain and isn’t working as expected currently (as of 1.5.0 & UE5.0)

Plastic SCM Setup

Save connection credentials

The plugin works with the command line interface “cm” that currently requires your credentials to be stored. Use the Plastic SCM or Gluon GUI to enter and save your credentials before enabling Plastic SCM in Unreal.

Configure Locks for Unreal Assets (exclusive checkout)

Administrator guide - Chapter 7: Configuring exclusive checkout (Lock)

Binary assets should be locked for exclusive access to avoid merge conflicts.

To lock all assets on the whole Content directory, you need to put a lock.conf in your server directory (for instance C:\Program Files\PlasticSCM5\server) with this content:

rep:<repname> [lockserver:[<server>:<port>]]
/Content

For instance the more generic one would be:

rep:*
/Content

or to be more specific to one repository:

rep:UE5PlasticPluginDev lockserver:localhost:8087
*.uasset
*.umap

On Plastic Cloud, you can just set-up lock rules like that:

/Content

Configure Visual Diff of Blueprints from Plastic SCM GUI

In “Preferences -> Diff tools” add a new config for uasset and move it up before the existing $binary one: Diff tools

The command line needs the quoted path to the UnrealEditor.exe, the quoted patch to your “.uproject” file, -diff, then the source & destination files variables also quoted

"C:\Program Files\Epic Games\UE_5.0\Engine\Binaries\Win64\UnrealEditor.exe" "C:\wkspaces\ProjectName\ProjectName.uproject" -diff "@sourcefile" "@destinationfile"

or for Unreal Engine 4:

"C:\Program Files\Epic Games\UE_4.27\Engine\Binaries\Win64\UE4Editor.exe" "C:\wkspaces\ProjectName\ProjectName.uproject" -diff "@sourcefile" "@destinationfile"

Text Diff of any assets

To configure a text diff for any uasset (not only Blueprints) use this command instead

"C:\Program Files\Epic Games\UE_5.0\Engine\Binaries\Win64\UnrealEditor-Cmd.exe" "C:\wkspaces\ProjectName\ProjectName.uproject" -NoShaderCompile -run="DiffAssets" %1 %2 DiffCmd="C:\Program Files\PlasticSCM5\client\mergetool.exe {1} {2}"

Status

This version here is the development version, so it always contains additional fixes, performance improvements or new features compared to the one integrated in Engine.

Version 1.7.1 2023/01/17 for UE 5.0/5.1/Github 5.2.x and UE 4.27.2:

Feature Requests

Known issues

Features not supported

Some are reserved for internal use by Epic Games with Perforce only:

Support

You can always ask for support in:

Enable debug logs

Enable Verbose logs in Unreal Engine

To help diagnose any issue related to the plugin or to the Editor, toggle Verbose logs in Source Control settings.

Unreal log files are in <ProjectName>/Save/Logs/ProjectName.log.

Enable logging for Plastic SCM

To help diagnose any issue related to the underlying Plastic SCM “cm” Command Line Interface, enable logging for Plastic SCM.

cm log files are typically in <LOCALAPPDATA>\plastic4\logs\cm.log.txt.

Report an issue

To report an issue, please create a support ticket as it helps sort the priorities Plastic SCM support.

You can also use the Github issue-tracker.

  1. Have a look at existing issues (Open and Closed ones)
  2. Specify your Engine & Plugin versions, and if either are built from sources
  3. Describe precisely your issue
  4. Add reproduction steps, if possible on a basic template project
  5. Post log files whenever possible (see enable debug logs to get the most of it)
    1. Unreal Log file <ProjectName>/Saved/Logs/ProjectName.log
    2. cm debug log file typically from <LOCALAPPDATA>\plastic4\logs\cm.log.txt

Use merge requests

If you want to help, Github Pull Requests are welcome!

Source code architecture

See also Unreal Engine C++ Coding Standard

All the relevant C++ source code of the plugin reside in one subdirectory <ProjectName>/Plugins/UEPlasticPlugin/Source/PlasticSourceControl/Private/

Implementations of all the Source Control APIs as C++ interfaces

Other most relevant structural files

All the others providing various features

Copyright Unity Technologies Developed by Sébastien Rombauts (sebastien.rombauts@gmail.com)