Hey all,
Been trying to get a simple reset of the region render matrix to work. Handles master tracks (not shown) and individual tracks. However any region that has "all tracks" enabled will not reset using reaper.SetRegionRenderMatrix(). Looks like just a limitation of reaper.SetRegionRenderMatrix().
Anyone know how to get this to work? Thanks!
Code:
function GetRegions()--returns a table of regions in order to get real region indexes
local marker_count = reaper.CountProjectMarkers(0)
local region_table = {}
for i = 0, marker_count do
local _, isrgn, _, _, _, idx = reaper.EnumProjectMarkers(i)
if isrgn then
table.insert(region_table, idx)
end
end
return region_table
end
function Main()--iterates through render matrix track indexes disabling tracks
local t_regions = GetRegions()
for i, region_idx in pairs(t_regions) do
local t = 0
local t_temp_tracks = {}
while reaper.EnumRegionRenderMatrix(0, region_idx, t) do
t_temp_tracks[t] = reaper.EnumRegionRenderMatrix(0, region_idx, t)
t = t + 1
end
for i, track in pairs(t_temp_tracks) do
reaper.SetRegionRenderMatrix(0, region_idx, track, -1)
end
end
end
Main()