Asset Git Repos - SimDynamX/SpaceTeamsPRO GitHub Wiki

Simulation Development Workflow → Local Asset Git Repos

Up to date for Platform 0.44.1

Written by Connor Jakubik

Prerequisites:


Local Asset Git Repos

The main method for downloading others' work or collaborating on changes in ST PRO is through files in the Local Assets folder. This Local Assets folder, for Windows, is AppData/Local/SimDynamX/STPro/Assets. This folder is the default folder for saving assets, and is accessible from any installed Space Teams version on the computer.

While these files can be managed manually, it is recommended to use git repositories to handle updating external assets and collaborating on your own asset files. We have a tool in the SpaceCRAFT Unreal Client application for more easily managing git repos in the /Assets/Repos folder.

Git Credential Setup

In order to access private repositories, or to push changes to repositories that you have write access to, you must have credentials set up. These credentials are created and saved after authenticating with GitHub, GitLab, or another git server provider.

Note

GitHub Desktop handles credentials separately from the Git command-line program.

To trigger a re-authentication, you need to run a command specific to your Git host.

  • For GitHub
    • Ensure GitHub CLI is installed
    • In a new terminal after the install, run
      gh auth login --web --git-protocol https
      
    • Follow steps on-screen
  • For GitLab

Cloning a repo

  1. Click the Git Repos & Projects button on the main menu

    image
  2. Click Clone a Repo

  3. As shown in the popup, copy the HTTPS .git URL to clone, and paste it into the HTTPS Clone URL field.

  4. Clone

    1. If the repo does not show in the list, try repeating the Git Credential Setup, close and reopen Space Teams, and try again.

Pushing and Pulling Changes

In a simplified git interface, we show the branch that the repository is checked out to, and a status of the repository. Hover over the status icons to see a more detailed status. If Pull is displayed, the remote (where you cloned from) has commits (changes) on it that you don't yet have on your computer. If you click Pull, the tool attempts to download and apply those changes. If Push is displayed, you have changed files or commits that do not exist on the remote. If you click Push, the tool gathers all of your changed files in that repo, makes a commit with those changes, and uploads that commit to the remote.

image

If you encounter an error or require more advanced git operations such as checking out branches, merge conflict resolution, etc, please instead use a git GUI such as those built into various IDEs or GitHub Desktop, or use the git command line.

Using GitHub Desktop for extended functionality

After cloning using the method above, you can also add the repository to your GitHub Desktop program to take advantage of the GUI.

  1. File->Add local repository...
  2. Navigate to C:\Users\<yourself>\AppData\Local\SimDynamX\STPro\Assets\Repos
  3. Select the folder of the repo you are adding
  4. Add repository, then if prompted Initialize Git LFS

Using assets from Local Asset Git Repos

Running a sim

In the Sim section of the main menu, switch to the User-Made Sims to see sim configs in the Local Assets directory:

image

When running from command line, prefixing Local refers to the Local Assets folder (in AppData). Examples:

  • run_Server.exe --sim=Local/...path from STPro/Assets....simconf
  • run_Server.exe --sim=Local/Repos/Repo-Name/...path inside repo....simconf

Referencing files here from EntityConfig, SimConfig, etc files

Path references starting with Local refer to the /Assets folder.

For example, here is how to reference a Python System that is in a user-assets repo from a SimConfig.

"Systems": [
      {
        "Nametag": "MyPythonSystem1",
        "Source": "Local/Repos/my-special-repo/my_python_sys.py",
        "Type": "Python",
        "Active": true,
        "Inst_Parameters": {
        }
      },

Referencing files here from code

You can access it with spaceteams::path_utils::GetLocalAssetsDir()/st.path_utils.GetLocalAssetsDir() (c++/python).

Note

The other folders in /STPro have these purposes:

  • Config: Configuration files for user-specific settings
    • GetLocalConfigDir()
  • Output: Default folder for sim output files
    • GetLocalOutputDir()
  • Versions: ST-version-specific install cache directory, which holds a separate Python venv and other files
    • GetVersionInstallCacheDir()
⚠️ **GitHub.com Fallback** ⚠️