User Preferences - Automating Setup
The user_preferences.xml file contains all user-specific settings outside of the ones defined in a Project Configuration. These mainly relate to specific UI and performance settings.
The only relevant setting to change is the Configuration File that contains a list of projects. This can be done in a few ways, as listed below.
Alternatively, you can completely bypass modifying the User Preferences, and do a session-based override of the SBSCFG file by using a command-line argument on the Designer shortcut, see below.
Permanent or Session-based
There are two different ways to configure Designer to use another configuration file than the default, both with advantages and disadvantages:
- Permanently modifying user_preferences.xml
This file is located in ~User\AppData\Local\Adobe\Adobe Substance 3D Designer for Windows. If you modify it, Designer will always use what is defined there, regardless of how, when or where you start it. Making changes requires modifying the XML again, both of which are described below, and tend to be a bit involved.
- Temporarily setting the session through a command-line argument
Designer can take a command-line argument on startup to override the SBSCFG file for that session (see below for how). It's a simple, elegant solution, and allows for switching projects in a much quicker way than through modifying an XML. The danger is that if you open through multiple shortcuts (for example Start Menu and Desktop on Windows), you can have different results without it being entirely obvious. On top of that, it's not as tamper-proof, as users can delete, move or modify their shortcuts much easier than their user_preferences.xml.
Manually Modifying Preferences
If there is no automated setup, or for testing purposes, one can manually go to Edit > Preferences... and then click the "Projects" section on the left.
The button marked in red allows the user to choose a different SBSCFG file.
Modifying Through Script
Just like the Project and Configuration files, the user preferences is a structured XML, with the relevant setting clearly identifiable. Rather than modifying through a text editor like Notepad++ or Sublime Text, it is very well suited for modification through an external scripted setup.
The advantage of scripting is user don't have to do anything else than clicking a button, and if a sufficiently complicated system is created it's possible to manage and swap project easily without any need to manage files and settings manually.
The relevant line looks like this:
The following is a simple Python 2.7 example function for Windows that modifies the user_preferences.xml for another configuration file. This permanently alters the value until changed back. The function SetConfigurationFile can then be called with the path of your custom sbscfg file as a parameter.
A python script allows for powerful, clean code, and can be easily integrated elsewhere, but the downside is that for a user to run it, it needs to be compiled to an executable, or the user needs a Python deployment.
Command-line argument shortcut
In a much simpler way, Designer can be told to use a specific SBSCFG on startup through the "--config-file" (optional) argument.
While not recommended to use a manual method in a production environment, for testing purposes this can be done fairly quickly if you have setup your SBSCFG file already.
- Add a space.
- Add --config-file after the path to designer in the Target section.
- Add another space
- Add your path, wrapped in quotation marks to avoid issues with spaces in your path.
The result should be like this:
"C:\Program Files\Adobe\Adobe Substance 3D Designer\Adobe Substance 3D Designer.exe" --config-file "C:\Dev\Substance\custom_configuration.sbscfg"