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:
authorNathan Craddock <nzcraddock@gmail.com>2020-09-15 21:13:03 +0300
committerNathan Craddock <nzcraddock@gmail.com>2020-09-15 21:47:09 +0300
commit452a1c7b38383fd3f51532c429912677864e4a33 (patch)
tree37481ed6eca5cc6840dee0686b24b75ba1842cbc /source/blender/blenloader
parentf137022f9919f4dd315ec6b325a08e1bf5aec6fb (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/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_290.c6
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index 2db2bb3c29e..3bf464602bc 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -661,5 +661,11 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/
{
/* Keep this block, even when empty. */
+ LISTBASE_FOREACH (Collection *, collection, &bmain->collections) {
+ collection->color_tag = COLLECTION_COLOR_NONE;
+ }
+ LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
+ scene->master_collection->color_tag = COLLECTION_COLOR_NONE;
+ }
}
}
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index a0a60630986..d53959a1949 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -236,6 +236,9 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
*/
{
/* Keep this block, even when empty. */
+ for (int i = 0; i < COLLECTION_COLOR_TOT; ++i) {
+ FROM_DEFAULT_V4_UCHAR(collection_color[i].color);
+ }
FROM_DEFAULT_V4_UCHAR(space_properties.match);
}