First: backup your preset. I am not responsible for blablabla
It’s relatively safe though. What I did is download the preset and save under a new unique name. When importing again, nothing should be overwritten this way.
It also helps if the list you want to replace already exists. So my control for selecting the effect presets was already there. Look for the overlay section in the json file
For example:
"overlays": [
{
"id": 1,
"items": [
I am only generating the stuff that goes in between the brackets (the items array)
Then:
I have a text file containing names I want to jsonnify (??!?!)
name 1
name 2
name 3
name 4
name 5
I have python script that takes that script (very simple, quick and dirty)
tab = '\t'
with open('names.txt', 'r') as f:
lines = f.readlines()
i=0
for line in lines:
output = f'''
{{
{tab} "value": {i},
{tab} "label": "{line.strip()}",
{tab} "index": {i}
}},
'''
print(output)
i += 1
It reads the file and creates an overlay -list-array (whatever you call it).
python3 the_name_you_saved_the_script_under.py
And the names are in names.txt or whatever you decided call your file. But then you have to adapt the filename in the python script too of course
Oh, I run it from the terminal. I either copy the output of the script to the clipboard or catch it in a file
e.g.
python3 the_name_you_saved_the_script_under.py > output.txt
After running it you end up with:
{
"value": 0,
"label": "name 1",
"index": 0
},
{
"value": 1,
"label": "name 2",
"index": 1
},
{
"value": 2,
"label": "name 3",
"index": 2
},
{
"value": 3,
"label": "name 4",
"index": 3
},
{
"value": 4,
"label": "name 5",
"index": 4
},
The last entry has a comma too much. You have to remove it manually
Then I open the downloaded preset. Find the overlays and replace the one in the preset with the output of the scripts. In my case it looked like
{
"id": 2,
"items": [
----------------- replace from here ---------------
{
"value": 0,
"label": "00 : Through",
"index": 0
},
{
"value": 1,
"label": "01 : Rev. Hall1",
"index": 1
}
----------------- replace until here ---------------
}
]
},
{
"id": 3,
etc
and replace the overlay (id 2 items in my case) it with the full list the script outputted.
So again: The script does not create the complete overlay but only the items. So there is some danger.
Also when opening the downloaded preset in json form it showed everything on 1 line, I opened it in visual studio and set the language to json, then did shift+option+f to format the file (guess shift+alt+f if you are on PC). Doing that will format the json over multiple lines and indent everything nicely. It also adviseble to do the formatting again after pasting in the custom items. It cleans up bad indents etc.
Hope this helps. In case of any questions other than “how can I sue you you destroyed all my presets” please feel free to ask
And how to generate he file with the names/effectnames/wavenames? My best bet is always:
getting a PDF, convert it to text (or copy relevant parts to a text file) and regex what you need from it. Depends on how the PDF was constructed how painful it will be