Allegorithmic Substance Suite on Ubuntu 16.04
linux / ubuntu / substance / app install guides / 3d graphics
This guide covers how to install the Substance applications on Ubuntu 16.04 or similar distros (such as Debian or Mint) manually, without using alien
(check out this forum post on how to do this via alien
). We basically just need to extract the RPM contents, copy it to /opt
, then run the postinstall scripts to setup icons, links, and file associations.
At the end, we'll also look at setting up the Python API. If you have a Substance subscription plan, you can download the Automation Toolkit from the Licenses page after logging into Allegorithmic's website.
Installation
Install Prerequisites
sudo apt-get update
sudo apt-get install rpm rpm2cpio
Install Substance Packages
First, create a new directory called sub_extract
inside of your home directory:
mkdir ~/sub_extract
cd ~/sub_extract
Then download (or copy) your Substance RPMs to this new directory. You should see something like this when listing the directory (version and actual packages will obviously be different, depending on what you're trying to install):
jacob@jotunn:~/sub_extract$ ls
Substance_Automation_Toolkit-2017.2.4-132-linux-x64-standard-indie.tar.gz
Substance_Painter-2018.1.0-2128-linux-x64-standard-full.rpm
Substance_Designer-2018.1.0-1039-linux-x64-standard-full.rpm
Substance_Player-2018.1.0-1039-linux-x64-standard-full.rpm
Next, extract the RPM package contents for each RPM:
for thisrpm in *.rpm; do rpm2cpio $thisrpm | cpio -idmv ; done
If you downloaded the Substance Automation Toolkit, also extract that into the same directory:
tar -xvf Substance_Automation_Toolkit-*.tar.gz -C opt/Allegorithmic
Now — copy the files into their final installation location. The applications expect to be installed in /opt/Allegorithmic
, so that's where we'll put them:
sudo cp -Rvp ~/sub_extract/opt/Allegorithmic /opt/
Last, we need to extract the installation scripts from the RPMs. This one-liner will dump the scripts for each RPM, then extract the postinstall script:
for thisrpm in *.rpm; do outscript=$(echo "$thisrpm" | sed -e 's/^\([a-zA-Z0-9_]*\)-.*/\1/').sh ; rpm -qp --scripts $thisrpm | sed -n '/postinstall/,/preuninstall/p' | grep -v ':$' > $outscript ; chmod +x $outscript ; done
You should now have matching scripts in your directory that corresponds to each RPM:
jacob@jotunn:~/sub_extract$ ls -lAh *.sh
-rwxrwxr-x 1 jacob jacob 1022 Mar 31 01:02 Substance_Designer.sh
-rwxrwxr-x 1 jacob jacob 1016 Mar 31 01:02 Substance_Painter.sh
-rwxrwxr-x 1 jacob jacob 1016 Mar 31 01:02 Substance_Player.sh
After you have reviewed each script (they should just fix the permissions, then set up icons and file associations), run them:
sudo bash Substance_Designer.sh 1
sudo bash Substance_Painter.sh 1
sudo bash Substance_Player.sh 1
(Note: The 1
parameter is required as it triggers the postinstall actions in the RPM script)
If no errors were returned, then they were successful. The application launchers should now show up in your Applications Menu! You can also launch the main applications via substancedesigner
, substancepainter
, or substanceplayer
from a terminal window or run dialog.
Tweaks/Fixes
Panning Not Working
If you're using the Compiz compositor for your desktop, more than likely the Alt+Middle Mouse
(Middle Mouse = Button 2
) combo will be assigned to resizing windows. Since this is also the default configuration for panning the camera in Substance applications, this poses a problem. To fix it, open up the CompizConfig Settings Manager:
sudo ccsm
Then find the "Resize Window" plugin and click on it. On the first tab, click the key binding for "Initialize Window Resize", then either change it to something else, or disable it. This key is not required to be bound for window resizing to work. Once set, click "Back", then close CCSM to save the settings.
Fix missing UI asset
When running Painter or Designer, you may see an error message such as the following:
[Script] file:///home/jacob/Documents/Allegorithmic/Substance Painter/plugins/substance-source/MainHeaderBar.qml:161:7: QML Image: Cannot open: file:///home/jacob/Documents/Allegorithmic/Substance Painter/plugins/substance-source/exit.svg
In this case, the file does exist, but it's named Exit.svg
. Since most filesystems on Linux/UNIX are case-sensitive, but NTFS and HFS+ are not (HFS+ can be, but is usually configured to be case-insensitive), the application is unable to locate the file.
To solve this, simply add a symlink from exit.svg
to Exit.svg
:
ln -s ~/Documents/Allegorithmic/Substance\ Painter/plugins/substance-source/{E,e}xit.svg
I imagine this will be fixed by Allegorithmic in a future release. :D
Screenshots
Below are a couple of screenshots of Substance Painter and Substance Designer running on Ubuntu 16.04— working great! My machine has an nVidia GTX 960, running the proprietary NVIDIA 381.22 drivers. These applications can use a ton of VRAM (dependent upon your output texture size), so the more graphics memory you have, the better!
Python API Setup
The toolkit should already be installed in /opt/Allegorithmic/Substance_Automation_Toolkit
if you followed the previous installation procedure.
The pysbs
module (the Python module that houses all of the magic) is contained within a zip archive that can be installed via pip
:
sudo pip install /opt/Allegorithmic/Substance_Automation_Toolkit/Python\ API/Pysbs*.zip
If you have multiple Python versions, you can also install the module for those, too. For example, to also install for Python 3:
sudo pip3 install /opt/Allegorithmic/Substance_Automation_Toolkit/Python\ API/Pysbs*.zip
If everything went smoothly, you should be able to run one of the included sample scripts, located in /opt/Allegorithmic/Substance_Automation_Toolkit/samples
. Let's test out the variations.py
script, which takes an example stone texture, creates different variations, then bakes out all of the textures as PNG images.
cd /opt/Allegorithmic/Substance_Automation_Toolkit/samples
python variations.py
After some time, it should finish, and we can check the results (xdg-open
should open the image in your default image viewer, like eog
)
cd /opt/Allegorithmic/Substance_Automation_Toolkit/samples/variations/_output
ls
xdg-open basecolor_opus_0.png
That's it! Now you can start writing scripts that generate, manipulate, or bake out substances! Try using ipython
to interactively test and explore the API.