Mega Preset Assembler

Hi All,

I made a python script which assembles presets to ease the process of putting together presets.

Basically normally to add extra passes to a preset you need to edit the numbers of all subsequent passes by hand which is really irritating and sometimes error prone.

The way it works is you put your preset shaders that you want to assemble somewhere relative to the script, then in the root folder where the python file is you create a .protoslangp file which just has references to those preset files.

You then need to run the file with python, so you will need to:

  • install python,
  • make sure python is in your system path
  • Run the script by going to the command prompt
  • Run the following

python c:/mypathhere/mega_preset_assembler.py

The package has an example .protoslang in it that can be generated a builds a preset with mdapt, GTU, grade & Guest-DrVenom

Mega Preset Assembler

12 Likes

This is a really great utility, thanks!

Took me a minute, but I got it working. :slight_smile:

For anyone having trouble adding python to the system path, this might be helpful:

https://java.com/en/download/help/path.html

3 Likes

I replaced “crt-guest-dr-venom-2” with “crt-guest-advanced” and edited the protoslangp file accordingly. The preset was successfully assembled, but now I get this error when I try to load the preset in RA:

[ERROR] [GLCore]: Failed to load LUT "C:\RetroArch-Win64\shaders\shaders\guest\lut\sony_trinitron1.png".

Any ideas?

2 Likes

This is because the “crt-guest-advanced” has relative paths in it. To be able to load the resulting preset built you would need to put it back where the original preset came from.

Alternately you can replace the local paths with absolute paths which start like this: :/shaders/shaders_slang

This is how the files in the example are set up, and what I recommend if you are going to use the tool a lot.

For the average user after the preset is built you can just leave the paths as absolute.

But if you need to use relative paths like I do for distributing the Mega Bezel you can change the paths to relative.

As an example my workflow for the Mega Bezel is:

  • All my component slangp files have absolute paths.
  • So when I build I get a compiled preset with all absolute paths (this allows me to test it right after creation easily).
  • I run the “replace_absolute_with_relative_path.py” in the output folder to do the relative replacement. (The text in the file defines what is replaced, so you need to edit the .py file to change it to something appropriate for you)
  • As an example these are the lines I use to replace the absolute path with an appropriate relative path for where the final preset will be moved to

line = line.replace(':/shaders/shaders_slang/bezel/Mega_Bezel/shaders/HyperspaceMadness/', '../../shaders/HyperspaceMadness/') line = line.replace(':/shaders/shaders_slang/', '../../../../')

  • Then I move the files to the appropriate place where the relative paths work
4 Likes

Moving the newly assembled preset into the same directory as the guest-dr-venom presets solved it, thanks again!

5 Likes

Probably could write a simple-ish bash script or make some small adjustments to the python file to not have to do that :joy:.

3 Likes

I need to learn to read, hyperspace basically wrote everything out that’s needed it looks like rofl.

4 Likes