diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-09-15 21:13:03 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-09-15 21:47:09 +0300 |
commit | 452a1c7b38383fd3f51532c429912677864e4a33 (patch) | |
tree | 37481ed6eca5cc6840dee0686b24b75ba1842cbc /source/blender/makesdna | |
parent | f137022f9919f4dd315ec6b325a08e1bf5aec6fb (diff) |
Collections: Add color tagging
This adds color tagging to collections. There are 8 color
options which are themable in the user preferences, with an additional
option for no color tag by default.
This adds a new filled collection icon and 8 colored variants of the
icon that can be themed in the user preferences.
In this commit the only interface to setting the color tags is through
Python, and there is nowhere in the interface where the collections are
shown colored. Setting and viewing the color tags from the outliner will
follow.
Manifest Task: https://developer.blender.org/T77777
Differential Revision: https://developer.blender.org/D8622
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_collection_types.h | 19 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 7 |
2 files changed, 25 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_collection_types.h b/source/blender/makesdna/DNA_collection_types.h index 6cf02137fa6..e188426fdda 100644 --- a/source/blender/makesdna/DNA_collection_types.h +++ b/source/blender/makesdna/DNA_collection_types.h @@ -58,7 +58,9 @@ typedef struct Collection { short flag; /* Runtime-only, always cleared on file load. */ short tag; - char _pad[4]; + + int16_t color_tag; + char _pad[2]; /* Runtime. Cache of objects in this collection and all its * children. This is created on demand when e.g. some physics @@ -92,3 +94,18 @@ enum { * Using a generic tag like LIB_TAG_DOIT for this is just impossible, we need our very own. */ COLLECTION_TAG_RELATION_REBUILD = (1 << 0), }; + +/* Collection->color_tag. */ +typedef enum CollectionColorTag { + COLLECTION_COLOR_NONE = -1, + COLLECTION_COLOR_01, + COLLECTION_COLOR_02, + COLLECTION_COLOR_03, + COLLECTION_COLOR_04, + COLLECTION_COLOR_05, + COLLECTION_COLOR_06, + COLLECTION_COLOR_07, + COLLECTION_COLOR_08, + + COLLECTION_COLOR_TOT, +} CollectionColorTag; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index b63f4529559..b60dcb67224 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -453,6 +453,10 @@ typedef enum eWireColor_Flags { /* TH_WIRECOLOR_TEXTCOLS = (1 << 1), */ /* UNUSED */ } eWireColor_Flags; +typedef struct ThemeCollectionColor { + unsigned char color[4]; +} ThemeCollectionColor; + /** * A theme. * @@ -491,6 +495,9 @@ typedef struct bTheme { ThemeWireColor tarm[20]; /*ThemeWireColor tobj[20];*/ + /* See COLLECTION_COLOR_TOT for the number of collection colors. */ + ThemeCollectionColor collection_color[8]; + int active_theme_area; char _pad0[4]; } bTheme; |