Old 10-23-2019, 04:54 PM   #1
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
Default Item vs Take default color behavior

Hi gurus,

I wrote a script to color regions based on the underlying item's color. Except that sometimes it didn't work even if there were no takes (just an item). It seems the status of an item's default color changes depending on how it was edited or something. So a colored item may have a color value of 0.0 which is default color or none... or something. Anyway... I wrote a silly workaround that seems to satisfy all cases... but wanted to understand why this is the way it is.

Any explanation would be nice. Any ideas?

Here is the relevant piece of code....

Code:
 local iRetval, bIsrgnOut, iPosOut, iRgnendOut, sNameOut, iMarkrgnindexnumberOut, iColorOur = reaper.EnumProjectMarkers3(0, region_idx)

    if iRetval > 0 then
    
      if reaper.GetMediaItemInfo_Value(item, "I_CUSTOMCOLOR") == 0 then
        take_color = reaper.GetMediaItemTakeInfo_Value(take, "I_CUSTOMCOLOR")
       -- Msg("take")
      else
        take_color =reaper.GetMediaItemInfo_Value(item, "I_CUSTOMCOLOR")
       -- Msg("item")
      end
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
Thonex is offline   Reply With Quote
Old 10-24-2019, 01:35 AM   #2
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Items get coloured according to the track colour they belong in. This colour can be overridden by the "item colour". So, you can have, for example, a yellow item in a green track. Inside items there are takes, which can have their own colour which overrides the colours of the item and the track. So, as an example, you can have a yellow item in a green track, which has one take which is red. The item appears red because its only take is red. If you delete or remove the take's custom colour then the (empty) item will appear yellow. If you remove the custom colour of the item, then the item will inherit the colour its parent track.
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 10-24-2019, 08:16 AM   #3
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,719
Default

Quote:
Originally Posted by amagalma View Post
Items get coloured according to the track colour they belong in. This colour can be overridden by the "item colour". So, you can have, for example, a yellow item in a green track. Inside items there are takes, which can have their own colour which overrides the colours of the item and the track. So, as an example, you can have a yellow item in a green track, which has one take which is red. The item appears red because its only take is red. If you delete or remove the take's custom colour then the (empty) item will appear yellow. If you remove the custom colour of the item, then the item will inherit the colour its parent track.
Thanks amagalma!!

That makes sense! But I guess that begs the questions: what constitutes a Take? Somehow there are processes that turn items into takes even though there are not any overlapping versions of the item.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
Thonex 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 04:11 AM.


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