Is it possible to update or delete a preset using Python? I could not find it in the docs
My application uses some custom presets that are loaded with a script when ParaView starts.
for colormap in results["presets"]["xml"]:
LoadLookupTable(os.path.join(results["presets"]["path"], f"{colormap}.xml"))
The problem arises when I update a preset for whatever reason. The new preset is loaded (I can see it in the list), but it is not applied.
The reason seems to be that when ParaView quits it saves the presets in .config/ParaView/ParaView-UserSettings.json
. Here I can see both versions, but maybe only the first one is actually used by ApplyPreset(preset_name)
.
I thought of editing the ParaView-UserSettings.json
directly and removing the old preset definition, but I have a mix of categorical and normal colormaps and it is not immediately obvious how to parse the content of CustomPresets
in the file.
Of course there would be the nuclear option to delete the file before launching ParaView, but it would not be nice for the user