I’m thinking about a way to script filters using key frames. Some parameters are not linear but are managed as if they were. For instance audio fade in fade out, simulating zoom using scale (which should be proportional to a square), I have also noticed some similar problems with gradient colors.
To script this there is the “brutal way” (I don’t like it) which could be analyzing an xml project, find how key frames are saved and write a script to compute and replace them in the xml file.
The other way should be provided by shotcut developer… Is there such a way to script key frames?
The only way to possibly script keyframes today is through a filter preset. You can make some keyframes, save a preset, and look at the generated file (Settings > App Data Directory > Show…) to understand the format. Then, write a script that generates something similar to a new text file. The preset text files are loaded dynamically when a filter is added through the UI. Your new custom preset does not need to include all of the parameters and only the one you are interested. Also, for the timestamps on the keyframes, you can use a negative value to operate in reverse from the end time of the filter for out-going effects.
Another thing you can script is the .qml file for the filter. You can modify the Preset.onPresetSelected JavaScript code to do something special when a certain preset is selected. Currently, there is no way to get the name of the preset from here, and you would have to also make a change to Preset.qml to send the name along with the signal. QML is a Qt technology.