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/makesdna
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/makesdna')
-rw-r--r--source/blender/makesdna/DNA_anim_types.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index d3551817a85..3ce656faf92 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -225,6 +225,10 @@ typedef struct FCurve {
/* RNA - data link */
int array_index; /* if applicable, the index of the RNA-array item to get */
char *rna_path; /* RNA-path to resolve data-access */
+
+ /* curve coloring (for editor) */
+ int color_mode; /* coloring method to use */
+ float color[3]; /* the last-color this curve took */
} FCurve;
@@ -255,6 +259,13 @@ enum {
FCURVE_EXTRAPOLATE_LINEAR, /* just extend gradient of segment between first segment keyframes */
} eFCurve_Extend;
+/* curve coloring modes */
+enum {
+ FCURVE_COLOR_AUTO_RAINBOW = 0, /* automatically determine color using rainbow (calculated at drawtime) */
+ FCURVE_COLOR_AUTO_RGB, /* automatically determine color using XYZ (array index) <-> RGB */
+ FCURVE_COLOR_CUSTOM, /* custom color */
+} eFCurve_Coloring;
+
/* ************************************************ */
/* 'Action' Datatypes */