Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 11-11-2017, 02:56 AM   #1
ausbaxter
Human being with feelings
 
Join Date: Apr 2016
Posts: 39
Default Region render matrix: issue when resetting when "all tracks" option enabled

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()
ausbaxter is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.