Restructuring this post a bit:
all the scripts and templates are attached as a ZIP to this post.
General instructions for all scripts:
Requirements:
- Photoshop
- Quixel Suite
- Substance Automation Toolkit
- Substance Designer
Instructions:
1. Create a folder where you want these files output. Im using "D:\CG\Database\Quixel2Substance"
2. extract the contents of the ZIP file in to that folder.
3. open the jsx files with any text editor and modify the top path declarations to match yours. The variables you need to set are:
-outputDir: the folder you just created which has the template files, and this is also where the resulting sbs and sbsar files will be exported to.
-toolkitDir: Substance Automation Toolkit installation folder
-substanceDir: path to your substance designer installation folder
-quixelDir: path to your quixel suite installation folder
4. move the jsx scripts to the photoshop scripts folder (Photoshop_Install_Folder\Presets\Scripts)
5. open photoshop and execute the scripts from File>Scripts
6. copy the resulting sbsar files in to your substance shelf.
Scripts:
Quixel Alpha to Substance Alpha
This script takes all the brush alpha JPG files and slots them in to alpha_template.sbs, then compiles that in to a SBSAR.
the compiled SBSARs will be located in "outputDir\Brushes\Compiled"
Known Issues:the brushes are sometimes slow. I might have been a bit ambitious with the occluder feature, so if you edit the template to just be input>histogramscan>output the brushes should work much smoother. If you do this also remove all the input parameters in the Occluder group.
Modifying the template:
alpha_template.sbs
If you want to modify the template sbs file yourself, make sure you do not rename the input node. Other than that you can make any changes to the template.
Quixel Bitmap to Substance Grunge Bitmap
This script operates on quixel Masking Patterns and converts them to grunge bitmaps for use in Substance.
Quixel has normal Masking Patterns as well, but the script should be capable of detecting them with the _Normal suffix. I havent tested it though, because I dont really use normals in SP
the compiled SBSARs will be located in "outputDir\Alphas\Compiled"
Modifying the template:
bitmap_template.sbs - This template is used for all the greyscale bitmaps
normal_template.sbs - This template is used for all normal bitmaps
If you want to modify the template sbs file yourself, make sure you do not rename the input node. Other than that you can make any changes to the template.
Quixel Material Compiler
when run, the script will ask Parse Whole Folders?
select yes if you want to parse all materials found in the selected folder and its subfolders
if not, you will be prompted to manually select one or more materials. The files you want to select are the XML files!
The script will load up a list of every XML file selected (or every XML it finds in the folders), then for each XML it'll find the corresponding PSB channel textures, save them out as TIFF files, slot those in to the SBS template, then compile the template in to an SBSAR.
The compiled SBSARs will be located in "outputDir\Materials\Compiled"
Known issues:Most if not all the issues with this script are due to the unoptimized template that I whipped up just to get the script up and running. Maybe i'll make a better template in the future if i ever need better materials, or you can do it yourself.
- Height doesn't work properly. default height seems to be mid gray, when it should be 0,0,0. Allego also does some weird stuff where you can have negative values in the height channel, and I haven't looked in to how any of that works. The height PSBs from quixel seem to be 8 bits, so they'll also need to be converted to 32 bits or 16 bits. I'm not sure which substance uses for height, probably the former.
- SBSARs are slow. This is because I just exposed every parameter I found in the quixel material XMLs. Most of them are not needed, and many of them can be combined in to a single parameter (gloss and roughness params for example are just inverts), so theres definitely room for optimization here.
- The fillOpacity, Opacity and Blend parameters are not supported by how substance materials work. As far as i can tell the only quixel material that uses these should be the Water Droplets material. That you'll have to manually convert to a substance filter if you want to use it in SD or SP
Modifying the template:If you want to modify the template sbs file yourself, make sure you do not rename the input nodes or any of the input parameter identifiers. Other than that you can make any changes to the template.
You can't however remove input parameters from the template, because the script will most likely complain when it tries to input data in to nonexistent params. In order to optimize the template by hiding unnecessary input params --switch-to-constant option for sbsmutator.exe will need to be implemented in to the script and I've yet to look in to how that could be done.
Replies
Its not like the resources are encrypted somehow.
I might be able to put together a video later... the explanation before the script in the top post should cover it all though.
If you get any errors or anything like that, feel free to post here and ill take a look.
oh and Ubisoft did it on Rinbow Six Siege, used quixel resources with substance painter. there's a video of a presentation they did on Allegorithmic youtube channel if anyone is keen
Its just a 1:1 conversion of the data though, and because of some differences between quixel and substance im not too happy with the result.
Hopefully ill have time to improve the template sbs and the script so the result is more usable.
Also added the material converter in its current "working but unoptimized" state.
Edit: Tried using the Alpha-script but it stops at line 61 with this error message:
did the script run for long before you got the error?
what folder are you running the script on?
do you have any custom alphas added to quixel?
The script seems to run up until the compiling part as I can see the image files in the correct directories (screenshot of the layout: https://imgur.com/a/R6lDa). Have adjusted the script(s) accordingly. I have no custom alphas, migrated to substance quite soon after I bought Quixel. Should add I've tried running all three scripts since and get the same results on all of them.
Suspected it might have been due to Photoshop not being the default app for the filetype but after changing that, the issue still persists.
Never used the Automation Toolkit since installing it, so there might be an issue there as well. Going to re-install system soon so unless something obvious strikes you from this message, I will give it a go again after that.
Thanks a lot for your time!
EDIT: I tried running on the script folder from quixel and that worked for alphas and brushes and for the materials i selected the materials folder from quixel folder.
EDIT2: After finished i have only the textures from the compiled materilas and no substance files:(.
EDIT3: When running the Materials script and selecting the smart materials folder from the quixel i get this error. 0 sbsar files
Can we hope to get a fix soon, I would love to have those Quixel materials inside Substance Painter!
Thank you!
So I managed to reproduce the error 8000 with the alpha script, and I fixed it (had to do with inconsistency in the naming of the "thumbs" folder which is supposed to be excluded from processing)
Also you shouldnt choose the main Quixel SUITE folder, because the script then parses everything in that folder, and that is a lot of stuff, some of which might be misinterpreted as the right kind of file, leading to problems.
The primary locations of the Alphas, Bitmaps and Materials are as follows:
Materials: C:\Program Files\Quixel SUITE 2.3\script\presets\Materials\Basic Materials
Bitmaps: C:\Program Files\Quixel SUITE 2.3\script\presets\Materials\Masking Patterns
Brush Alphas: C:\Program Files\Quixel SUITE 2.3\x64\3DO\3DO2_Data\BrushCategories
However the material and bitmap scripts work fine for me, i just tested them again. the line in question basically takes every possible texturechannel name ("Albedo", "Gloss", "Specular", "Normal", "Roughness", "AO", "Height", "Opacity", "Metalness", "AlbedoM") and tries to find it in the XML. if its undefined, then that channel doesnt exist in the material XML so it doesnt parse it.
What seems to be happening is that your script interpreter isnt recognizing "undefined" as a thing. This might have something to do with photoshop version.
Could you let me know which version you are using?
Also if you could run the script on a single XML (click no when it asks if you want to parse full folders, and then navigate to one of the material XMLs) and let me know exactly what happens on the screen.
What should happen is first it quickly opens and closes all the texture channels in the photoshop window. Then you should get 2 successive black console window popups, the first one closes in a second or so, and then the second one opens and that one takes longer. Then it should close and the material should be generated.
Attached is the fixed brush alpha script
Hey Olli., glad to see you back on this thread and thank you very much for taking the time to look into this.
So to answer your questions, I'm using Photoshop CC 2017. I tried to run the script on a single XML file and the behavior is pretty much like you described, although it's hard to tell if there is actually 2 successive black console window, I might be getting just one.
Also, I tried using your new alpha script and I'm now getting an error every time Photoshop opens an alpha.
Thank you again and I hope you can find a solution!
also that alpha script error isnt actually an error, seems like i forgot to remove a debug alert i used to diagnose the issue. Just search for alert(file) and comment the line out with //, or download the attachment where ive done it myself.
if thats all correct, then next you could try run an alpha through the mutator manually. Do so by replacing the brackets in this string with your own paths and then running it in the windows console:
first navigate to the sbsmutator. Just type in the path in to the command prompt. Then run this (but change the paths so they match your own setup):
sbsmutator.exe edit --input "D:\CG\Database\Quixel2Substance\alpha_template.sbs" --output-path "D:\CG\Database\Quixel2Substance\Brushes\Assorted" --output-name "Dense" --presets-path "E:\Utilities\Substance Automation Toolkit\resources\packages" --connect-image input@path@"D:\CG\Database\Quixel2Substance\Brushes\Assorted\Dense.tif"@tiling@1
What this does is it takes the alpha_template.sbs, slots in the Dense.tif texture, and saves it as Dense.sbs in Brushes\Assorted folder. It doesnt matter which texture you use.
edit: also make sure you have stuff in the ..\Substance Automation Toolkit\resources\packages folder.
Yes I made sure that the path definitions are set correctly.
I tried to run an alpha manually like you said and it seems to be working as intended, I did get the sbs file in the end.
You could try opening powershell and running this.
I'll have a better look when i get home tonight
edit: also make sure youre running everything as administrator
The solution is to add cd\ to the beginning of the cmd string builders which forces to the drive root regardless of where you are. I've added this fix and updated the download link on the first post, or you can download it below
@Gabriel Nadeau, did you got the smart materials to?
Hi Olli, thanks for taking the time to fix it, but i still dont get any sbs/sbsar files , everything works well without any errors, but when i run the material script, i get no files in the material folder. Using Photoshop 2017.1.1
This is what i have in the jsx files.
Help please
"What should happen is first it quickly opens and closes all the texture channels in the photoshop window. Then you should get 2 successive black console window popups, the first one closes in a second or so, and then the second one opens and that one takes longer. Then it should close and the material should be generated."
This is what you wrote in a post, so i`m getting the tabs with the textures, but the 2 successive black console windows never showed up.
Yes, I do get the smart materials but it seems that the maps aren't plugged in the materials. So for now, what I do is that I manually open the sbs in substance designer, plug the maps for each channel and republish the sbsar to get the material working. Not sure if it's just me and if there's anything we can do about it ?
Thank you!