diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-07-07 14:37:15 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-07-07 16:49:25 +0300 |
commit | f3b3eb70a6c0576db88115e5b9742295809ca6fd (patch) | |
tree | 7c828d8bc86da96eb2d9b21613118de979509380 /source/blender/editors/interface/resources.c | |
parent | 2ba2860e11c122824bb4e083b3f1148610693be3 (diff) |
Dopesheet: Added "Moving Hold" as a keyframe type
Currently "long keyframes" are only useful for indicating where stationary
holds occur. If however you try to create a "moving hold" (where the values
are slightly different, but in terms of overall effect, it's still a hold)
then it could get tricky to keep track of where these occur.
Now it's possible to tag such keyframes (using the keyframe types - RKEY)
as being part of a moving hold. These will not only be drawn differently
from normal keyframes, but they will also result in a "long keyframe"
being drawn between each pair of them, just like if they had been completely
stationary instead.
Currently the theming/styling of these is a bit rough. They reuse the existing
theme colours for long keyframes.
Diffstat (limited to 'source/blender/editors/interface/resources.c')
-rw-r--r-- | source/blender/editors/interface/resources.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index a9607d93672..c8ff335f2a0 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1473,6 +1473,30 @@ void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]) col[2] = cp[2]; } +/* get the color, range 0.0-1.0, complete with shading offset */ +void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4]) +{ + int r, g, b, a; + const unsigned char *cp; + + cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); + + r = offset + (int) cp[0]; + CLAMP(r, 0, 255); + g = offset + (int) cp[1]; + CLAMP(g, 0, 255); + b = offset + (int) cp[2]; + CLAMP(b, 0, 255); + + a = (int) cp[3]; /* no shading offset... */ + CLAMP(a, 0, 255); + + col[0] = ((float)r) / 255.0f; + col[1] = ((float)g) / 255.0f; + col[2] = ((float)b) / 255.0f; + col[3] = ((float)a) / 255.0f; +} + /* get the color, in char pointer */ void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]) { |