Asset Git Repos - SimDynamX/SpaceTeamsPRO GitHub Wiki
| Simulation Development Workflow → Local Asset Git Repos |
|---|
Written by Connor Jakubik
Prerequisites:
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.
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
- Ensure GitLab CLI is installed
- (Untested) In a new terminal after the install, run
glab auth login - Select
Web - (Untested) Follow steps on-screen
-
Click the
Git Repos & Projectsbutton on the main menu
-
Click
Clone a Repo -
As shown in the popup, copy the HTTPS .git URL to clone, and paste it into the
HTTPS Clone URLfield. -
Clone- If the repo does not show in the list, try repeating the Git Credential Setup, close and reopen Space Teams, and try again.
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.
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.
After cloning using the method above, you can also add the repository to your GitHub Desktop program to take advantage of the GUI.
-
File->Add local repository... - Navigate to
C:\Users\<yourself>\AppData\Local\SimDynamX\STPro\Assets\Repos - Select the folder of the repo you are adding
-
Add repository, then if promptedInitialize Git LFS
In the Sim section of the main menu, switch to the User-Made Sims to see sim configs in the Local Assets directory:
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....simconfrun_Server.exe --sim=Local/Repos/Repo-Name/...path inside repo....simconf
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": {
}
},You can access it with spaceteams::path_utils::GetLocalAssetsDir()/st.path_utils.GetLocalAssetsDir() (c++/python).
Note
- 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()