at

 :: 

Perforce

 :: 

Perforce Art Workflow

Perforce Art Workflow

§ Who Is This For?

  • Depending on your team's workflow, artists may be required to
    • Import assets into the engine
    • Make adjustments to materials for issues like color correction
    • Tweak parameters like animation speed
  • This walkthrough is suitable as long as
    • The number of changed files is small, and you can keep track of them
  • If that does not fit you, and...
    • The number of changed files is large, or you cannot keep track of some additions
    • You want to update changes of entire folders to the server, but those folders might include generated files that you want to ignore
    • ex. You are setting up an FMOD project that involves ignoring part of the project and tracking generated files
  • Then the programming workflow walkthrough is better.

§ Installation

  • Install the P4V client, this is like installing Git + GitHub Desktop locally

    • Ask your lead for the server link and user credentials
  • Open P4V, fill in your server and credentials (you can leave workspace blank)

  • P4V should look similar to below

    • A Depot is like a GitHub repository, where different versions of files and branches are stored
    • A Workspace is a folder on your computer managed by Perforce
    • A Stream is like a Git branch
    • A Changelist is a list of actions that updates the server once submitted. They can have descriptions just like commits having messages on Git.

  • To make Perforce workspaces behave more like Git folders, the "Work on Stream" behavior needs to be changed in preferences (otherwise it will create a local copy of every branch you work on, quickly going over the 20 workspace limit)

    • On the top bar, select Edit/Preferences/Stream

      • Select Reuse current workspace in Work in Stream" menu behavior and When dragging workspace to a new stream
    • You are now ready to create your stream and workspace!

§ Creating Streams and Workspaces

  • On the top bar, select View/Stream Graph

  • Depending on your team, you may or may not need to create a stream from the project depot. If not, skip to the next bulletpoint.

    • Right click the main branch to and choose Create new stream from 'main'

    • Select tasks as the stream type and fill out relevant fields, and check the Branch files from parent on stream creation option

      You can add files to ignore in the Advanced tab. Perforce ignore works more or less the same with Git ignore. If you have a generated .gitignore file for the project you can just paste it in.

      Note that for Perforce file ignoring is local, meaning what you ignore will not affect others.

    • Verify that the stream has been created

  • Open a local workspace connecting to the feature branch

    • Right click on the feature stream and select Work on the Stream. Relevant behaviors have been set in the previous section

    • Fill in relevant fields and create the workspace

      • Here if you use the same name as the depot itself, Perforce will give you a warning
    • Check the Depot tab on the left to see that the workspace has been created

    • Below the top bar, select Get Latest to download project files

  • You can now launch the project from the project files!

§ Working on a Feature

  • On the top bar, select View/Stream Graph

  • Depending on your team, you may or may not need to create a stream from the project depot. If not, skip to the next bulletpoint.

    • Right click the main branch to and choose Create new stream from 'main'

    • Select tasks as the stream type and fill out relevant fields, and check the Branch files from parent on stream creation option

    • Verify that the stream has been created

  • Open a local workspace connecting to the feature branch

    • Right click on the feature stream and select Work on the Stream. Relevant behaviors have been set in the previous section

    • Fill in relevant fields and create the workspace

      • Here if you use the same name as the depot itself, Perforce will give you a warning
    • Check the Depot tab on the left to see that the workspace has been created

    • Below the top bar, select Get Latest to download project files

  • You can now launch the project from the project files!

§ Unreal Engine Integration

The original instructions have not been updated with UE5 yet, this Perforce articles touch on some points corresponding to the UE4 documents

  • Right click in the content browser and log in to source control

    • Unreal should detect local settings and help you fill in some fields

      This section was adapted from the admin walkthrough, you do not require admin accounts to log in

    • Switch to the correct workspace from the Available Workspaces dropdown

    • Accept Settings

  • To edit an asset, you first need to check it out. This can be done inside Unreal

    • Example with Starter Content's Architecture assets:

      • After a successful check out, a red checkmark should appear on the asset preview
    • Double click to open that asset, then make some change like choosing another material

    • Save and close the editor window

    • Right click the asset again and Check In

    • The familiar changlist menu should show up from within UE5

      • After a successful submission, the red checkmark on the asset should disappear unless you selected the Keep File Checked Out option
  • Similarly, assets can be deleted without extra steps needed in P4V

    • Make sure you are logged in, then right click and delete an asset

    • Although it is not possible to check in the assets, you can right click the parent folder to check in (you may need to check out first if check in is greyed out)

    • Check that deletions are recorded correctly in the changelist

§ Unity Integration

WIP

§ Merging

  • Give your lead a notice that your feature branch is ready to merge. On GitHub this is done through pull requests, but since Perforce (at least Helix Core) does not support it directly, you will need to ping them somewhere else. Do ask your lead if Helix Swarm is setup as well, that will allow pull requesting.

  • If the merging goes through, the task stream you created can be deleted on the Stream Graph tab if it is not needed anymore. This is generally good practice as it saves server space.

    • You will need to switch to the main stream first by right clicking and selecting Work on this stream

§ Closing a Workspace

  • Your team might ask you to close your local workspaces if they are getting over the workspace cap for the free Perforce license
  • A workspace can be closed in the Workspaces tab (top bar Views/Workspaces)

§