Closed DrewTNBD closed 4 years ago
This call to RPR.SetMediaItemInfo_Value does not work when iterating over items gotten from project.items.
with rp.inside_reaper(): all_items = project.items max_group_id = [item.get_info_value('I_GROUPID') for item in all_items] max_group_id = int(max(max_group_id)) selected_items = project.selected_items for item in selected_items: new_group_id = max_group_id + 1 RPR.SetMediaItemInfo_Value(item, 'I_GROUPID', new_group_id)
If I swap the for loop for the following:
for item in range(0, len(selected_items)): gotten = RPR.GetSelectedMediaItem(0, item) RPR.SetMediaItemInfo_Value(gotten, 'I_GROUPID', new_group_id)
Then I get the result I expect - the items I select should all be in the same group.
RPR.SetMediaItemInfo_Value(item.id, 'I_GROUPID', new_group_id)
Dohhhh, I'm an idiot. I didn't realise about .id.
This call to RPR.SetMediaItemInfo_Value does not work when iterating over items gotten from project.items.
If I swap the for loop for the following:
Then I get the result I expect - the items I select should all be in the same group.