Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-02-15 13:58:24 +0300
committerJoshua Leung <aligorith@gmail.com>2009-02-15 13:58:24 +0300
commit844db375593d2a02f9182f9c195316de01253b67 (patch)
treefb22c05a58c0c00a51a982b4aefadd1e2e509ee5 /source/blender/editors/animation/anim_ipo_utils.c
parent394b3fcede01356764bb91883a2f32b08b0a6ca3 (diff)
Graph Editor: F-Curve Colouring
Now F-Curve channels in channels region are drawn with the same colour as their respective curve is drawn in the curves area. I've had to make a compromise to store such colour info in F-Curves themselves, which is not terribly ideal if the F-Curve gets reused in some way. However, for now, this will do (special tweaks can be made to make this work better though). I've also added a colour-determination mode per curve which should in future allow more control over this. By default, all curves still use the old 'rainbow' style. The available types area: * Old Rainbow - Colour is determined 'automatically' using a magic method which uses curve position + total curves to generate a colour. * Auto RGB - Color is determined using the 'array index' stored in F-Curve for data-access. An unresolved issue with this is that all the curves with this will end up with exactly the same colour, leading to confusion (i.e. all location.x and scale.x properties could potentially all be the same red colour). * Custom colour - self explanatory Currently, there's a minor bug when loading old files where the colours don't get initialised yet. For now, just clicking in the Graph Editor after file-load will solve any of these problems. Ton: it looks like area->refresh() isn't getting called after file read.
Diffstat (limited to 'source/blender/editors/animation/anim_ipo_utils.c')
-rw-r--r--source/blender/editors/animation/anim_ipo_utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c
index ba478b9e8c4..6be9a0e3091 100644
--- a/source/blender/editors/animation/anim_ipo_utils.c
+++ b/source/blender/editors/animation/anim_ipo_utils.c
@@ -183,7 +183,9 @@ void getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
/* ------------------------------- Color Codes for F-Curve Channels ---------------------------- */
-unsigned int ipo_rainbow(int cur, int tot)
+/* used for FCURVE_COLOR_AUTO_RAINBOW */
+// XXX this still doesn't work too great when there are more than 32 curves (which happens most of the time)
+void ipo_rainbow (int cur, int tot, float *out)
{
float dfac, fac, sat;
@@ -198,5 +200,6 @@ unsigned int ipo_rainbow(int cur, int tot)
if(fac>0.5f && fac<0.8f) sat= 0.5f;
else sat= 0.6f;
- return hsv_to_cpack(fac, sat, 1.0f);
+ //return hsv_to_cpack(fac, sat, 1.0f);
+ hsv_to_rgb(fac, sat, 1.0f, out, out+1, out+2);
}