|
|
|
10-22-2019, 08:26 AM
|
#1
|
Human being with feelings
Join Date: Aug 2011
Posts: 522
|
Weird select track functions problem
Whenever i try to use SetTrackSelected os SetOnlyTrackSelected i see the track being selected for some ms, then it goes unselected again. This function is the last line on the script so nothing else happens afterwards that deselects it.
Any idea?
EDIT: Just t be cleat, i see i got correct track index and userdata values, and I can change the name on the track, etc.
Last edited by reapero; 10-22-2019 at 08:35 AM.
|
|
|
10-22-2019, 08:28 AM
|
#2
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
- Post the code, just in case there's a bug.
- Do you have any scripts running in the background that might be affecting the track selection? (all running scripts are shown at the bottom of the action list)
|
|
|
10-22-2019, 08:43 AM
|
#3
|
Human being with feelings
Join Date: Aug 2011
Posts: 522
|
I have your script Lokasenna_Track_selection_follows_selection
Can this be the culprit?
Code:
num_selected_items =reaper.CountSelectedMediaItems(0)
for i=0, num_selected_items do
source_item = reaper.GetSelectedMediaItem(0,i)
table.insert(items,source_item)
end
for i=1, num_selected_items do
reaper.SetMediaItemInfo_Value(items[i], "B_UISEL", 0)
end
track_with_items= reaper.GetMediaItem_Track( items[1] )
track_with_items_index = reaper.GetMediaTrackInfo_Value( track_with_items, "IP_TRACKNUMBER" )
num_tracks = reaper.GetNumTracks()
reaper.InsertTrackAtIndex( num_tracks, false )
reaper.SetOnlyTrackSelected( track_with_items )
|
|
|
10-22-2019, 09:07 AM
|
#4
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
My script is doing that, 100%. It checks for changes to the project state and then does its thing, so it would naturally react to your script changing stuff.
|
|
|
10-22-2019, 09:34 AM
|
#5
|
Human being with feelings
Join Date: Aug 2011
Posts: 522
|
Crap..any workaround?
|
|
|
10-22-2019, 10:25 AM
|
#6
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
You could:
- Have your script check if mine is running and kill it. I think this would require a mod to my script, but it's possible in theory.
- Not try to select a track while you have a script running that manages the track selection for you. :P
|
|
|
10-22-2019, 12:44 PM
|
#7
|
Human being with feelings
Join Date: Aug 2011
Posts: 522
|
Hom.. i want to copy and paste items to different tracks. I planned to do that by copying, selecting the track, then pasting.
Maybe there's a way to do that without messing with selection?
I'll investigate killing scripts from a script hoping you dont need to modify anything on your script.
Btw this auto select track when selecting items..isn't there a Reaper preference to do this natively? I was shocked at the time I started using your script, since the option is there in quite other sequences.
|
|
|
10-22-2019, 01:03 PM
|
#8
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
Quote:
Originally Posted by reapero
Hom.. i want to copy and paste items to different tracks. I planned to do that by copying, selecting the track, then pasting.
|
You can use reaper.Main_OnCommand([command id here], 0) to run commands from the action list, so if your script also did the copying and pasting it wouldn't run into any trouble with mine.
Quote:
isn't there a Reaper preference to do this natively? I was shocked at the time I started using your script, since the option is there in quite other sequences.
|
Apparently there is Preferences/Editing Behaviour/Mouse/Mouse click/edit in track view changes track selection, but I have no idea if it behaves the same as mine for things like selecting multiple items.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 01:43 AM.
|