High Priority – Game Art

Perforce for Admins

1. Links

Perforce – Using Perforce with Unity3D
https://community.perforce.com/s/article/15244

Creating and Initializing a New Perforce Depot
https://youtu.be/pv4tvwghGCQ?list=PLxdnSsBqCrrGq_8ecmdE7A6KnRfbhHE4Q

2. Setup new Depot

  1. Create new depot
  2. In your workspace, include the new depot, “include tree”.
  3. Create a windows explorer folder with the same name, in your perforce root folder.
  4. Add a first new file, like a text file. And commit this file to the depot.
  5. Add Unity/Unreal and continue with the other steps below

3. Add type map << Important!

To make sure Perforce understands how to to treat Unreal & Unity file types. We need to update the type map file. This is a global step, so only needed once for all perforce projects.

  1. Inside the Perforce client, go to any project folder, right click on it and select “Open Command Window Here”
  2. In the command window, enter: p4 typemap
  3. A text file should open. Update the file with the following list, then save and close the file.

——————

TypeMap:
text //….js
text //….ini
text //….config
text //….cpp
text //….h
text //….c
text //….cs
text //…shader
text //….meta
text //….m
text //….mm
text //….py
text+l //….cm
text+l //….proc
text+l //….md5mesh
text+l //….md5anim
text+l //….ma
binary //….response
binary //….pdb
binary //….u
binary //….bmp
binary //….ip
binary+w //….dll
binary+w //….exe
binary+w //….lib
binary+w //….app
binary+w //….stub
binary+w //….dylib
binary+w //….ipa
binary+l //….prefab
binary+l //….mb
binary+l //….mat
binary+l //….psb
binary+l //….mp3
binary+l //….fbx
binary+l //….unity
binary+l //….asset
binary+l //….aas
binary+l //….tga
binary+l //….jpg
binary+l //….lwo
binary+l //….wav
binary+l //….ogg
binary+l //….demo
binary+l //….roq
binary+l //….doc
binary+l //….xls
binary+l //….celtx
binary+l //….pdf
binary+l //….odt
binary+l //….ods
binary+l //….ppt
binary+l //….skp
binary+l //….uasset
binary+l //….umap
binary+l //….upk
binary+l //….udk
binary+l //….ubulk
binary+lS //….dds
binary+lS //….bnk
binary+lS //….light
binary+lS //….shadow
binary+lS //….ibl
binary+lS //….bik
binary+lS //….upk

——————

 !!!  Restart the perforce client (and Unity/Unreal) and do a refresh in the perforce client.

4. Ignore files and folders

Add a text file in your perforce root called .p4ignore or .p4ignore.txt or whatever you like. Perforce uses the same setup as the git ignore files. So you can use the unity gitingore file found here: https://github.com/github/gitignore/blob/master/Unity.gitignore

Note: There can only be one accepted Ignore file name..

  • Create a file in the root directory of the engine (eg: C:/Projects/Perforce/Unity) called .p4ignore
  • Inside this file, define which file types to ignore. For example:
    • The .swatches file from Maya.
    • The Library folder from Unity.
    • Local source file folders.
  • Once this file is set up, open the command console (windows key + r then type in cmd) and type in: p4 set P4IGNORE = .p4ignore
  • Now, Perforce should ignore the file types and folders defined in the text document.
  • Next time an attempt to add this file is made, a warning should show up, and the files will not be added to your changelist.

Character rules

  • A # character at the beginning of a line denotes a comment. You can escape the # comment character with a backslash (\). This allows filenames beginning with # to be ignored.
  • A ! character at the beginning of a line line excludes the file specification. These exclusions override rules defined above it in the P4IGNORE file, but may be overridden by later rules.
  • A / (or \ on Windows) character at the beginning of a line causes the file specification to be considered relative to the P4IGNORE file. This is useful when the rule must apply to files at particular depots of the directory tree.
  • A / (or \ on Windows) character at the end of a line causes the file specification to only match directories, and not files of the same name.
  • The * wildcard matches substrings. Like the Helix server wildcard equivalent, it does not match path separators; however, if it is not used as part of a path, the directory scanning nature of the rule may make it appear to perform like the Perforce “…” wildcard.
  • The ** wildcard matches substrings including path separators. It is equivalent to the Helix server “…” wildcard, which is not permitted.

5. Deleting Depots

If deleting depots is declined or failed. Make sure all workspaces, streams and files linked to the depot are deleted/obliterated. If it still fails, use the following command to force it: p4 depot -f -d DepotName