Create Dope Sheet custom key colors
 
 
 

You can create custom key colors for your Dope Sheet keys with MEL. You can set the shade and value of each color you create, as well as specify to which key states they are applied.

For example, you can create a custom key color that is a medium blue, and then specify that a high value of the blue be applied to selected keys and a low value of the color be applied to unselected keys.

To change the color of keys in the Dope Sheet with MEL

  1. In the Script Editor or Command Line, use select to select the animation channel for which you want to create custom key colors. For example:
    select pSphere1_translateX;
  2. Use addAttr to add the Dope Sheet custom color attributes to the selected channel. For example:
    addAttr -ln dopeSheetColorScheme -at compound -nc 3; addAttr -ln keyframeActive -dt float3 -m -p dopeSheetColorScheme; addAttr -ln keyframeInactive -dt float3 -m -p dopeSheetColorScheme; addAttr -ln colorPriority -at short -p dopeSheetColorScheme;
  3. Use setAttr to set the high and low values for your custom key colors as well as specify to which key states the colors are applied.

    Use [0] to set the low color value and [1] to set the high color value. Also, use keyframeActive to specify that the custom color be applied to selected keys only, or keyframeInactive to specify that the custom color be applied to unselected keys only. For example:

    setAttr pSphere1_translateX.dopeSheetColorScheme.keyframeActive[0] -type float3 0.5 0 0; setAttr pSphere1_translateX.dopeSheetColorScheme.keyframeActive[1] -type float3 1 0 0; setAttr pSphere1_translateX.dopeSheetColorScheme.keyframeInactive[0] -type float3 0 0 0.5; setAttr pSphere1_translateX.dopeSheetColorScheme.keyframeInactive[1] -type float3 0 0 1;
  4. (Optional) Use colorPriority to set the color priority of the selected channel’s custom key colors. For example:
    setAttr pSphere1_translateX.dopeSheetColorScheme.colorPriority 0;

    colorPriority determines which of your child channels’ custom colors (such as pSphere1_translateX or pSphere1_rotateY) are inherited by your parent channel (such as pSphere1).

    NoteThe summary objects do not display the custom key colors that you have created. Instead, they only display the color information in the priority channel.