-
-
Save X-Raym/4eb872787709f963cfdbc8ed202d9cec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- REGION MATRIX ------------------------------------------------------------- | |
function CleanRegionMatrix() | |
local i = 0 | |
repeat | |
local iRetval, bIsrgn, iPos, iRgnend, sName, iIndex, iColor = reaper.EnumProjectMarkers3(0,i) | |
if iRetval >= 1 then | |
if bIsrgn then | |
reaper.ShowConsoleMsg("Region index" .. tostring(iIndex) .. "\n" ) | |
for z = 0, count_tracks - 1 do | |
track = reaper.EnumRegionRenderMatrix( 0, iIndex, z ) -- 0 Because unsetting shift the index | |
if track then | |
retval, track_name = reaper.GetTrackName(track, "") | |
reaper.ShowConsoleMsg(tostring(track_name) .. "\n" ) | |
reaper.ShowConsoleMsg(tostring(track) .. "\n" ) | |
reaper.SetRegionRenderMatrix( 0, iIndex, track, -1 ) | |
else | |
break | |
end | |
end | |
end | |
i = i + 1 | |
end | |
until iRetval == 0 | |
end | |
--------------------------------------------------------- END OF UTILITIES | |
-- INIT ------------------------------------------------------------- | |
count_tracks = reaper.CountTracks(0) | |
if count_tracks > 0 then | |
reaper.PreventUIRefresh(1) | |
reaper.Undo_BeginBlock() -- Begining of the undo block. | |
reaper.ClearConsole() | |
CleanRegionMatrix() | |
reaper.Undo_EndBlock( "Clean render region matrix" , -1) | |
reaper.PreventUIRefresh(-1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment