reposting this in the bug reports forum, since I think it is a bug and I posted it wrongly in the JSFX forum first.
I don't expect the "Change FX preset: Track 1: ReaEQ" to appear in the undo history. It should be enclosed by the Undo Block. So it seems a bug, that after the undo block is created, another undo entry is added for setting the preset.
If you add multiple different TrackFX_SetPreset, a lot of undo entries are added.
code to test:
But it would be better
fxint=reaper.TrackFX_GetByName(track, "ReaEQ", true)
if fxint>=0 then
preset = reaper.TrackFX_SetPreset(track, fxint, "stock - Track Default")
reaper.Undo_EndBlock("Setting Preset", -1)
if we could have an option in the reaper.TrackFX_SetPreset function to completely skip the creation of undo entry.
boolean reaper.TrackFX_SetPreset(MediaTrack track, integer fx, string presetname, boolean createundo)
I've totally failed trying to make it not adding the undo. help!