Import with command line. Source Control problem

Hi. I am working on project that is automated with Python. Using VXGI branch 4.17. Perforce for source control.

In Python I have loop for multiple files that looks like:

  1. Import files with command line to folder SceneImport.
  2. Run standalone game with command line. Output is screenshots and JSON file.
  3. Delete files in SceneImport with Python, it is a hard delete of files in explorer, no source control.
    End. Next one.

The problem is that when i import stuff into UE4, it’s marking them for add. When I one to run the same file on different machine it says that file is already checked out by other user. It’ s probably happening becouse I am deleting SceneImport files in windows explorer, not with UE4.

Possible solutions:

  1. Delete files from SceneImport folder with UE4 and Commandline. Is it possible? I can’t file command line argument like that.
  2. Use Python to delete files with Preforece. Not sure if possible.
  3. Disable source control on import. When it’s disabled it shows error, tries to connect to source control for about 10 seconds and the imports file. (To long to wait for it, with 100+ files it’s taking long time). Maybe there is some other way to disable this error?

Solution 1 or 2 would be best for me. I really appreciate any help you can provide

Hi Damian,

Your #2 solution is what I would recommend. I suggest getting the official P4Python API package provided by Perforce. That will allow you to automate whatever P4 logic your process needs.

Thank you Adric. I’ll try it.

Hey, I finally solved it by adding -nosourcecontrol flag to import command and it works fine for me. Never knew this flag exists. :slight_smile: