Skip to content
Snippets Groups Projects
Commit 7011d02c authored by Nathan Craddock's avatar Nathan Craddock Committed by Campbell Barton
Browse files

blender_theme_as_c: Add workaround for collection colors

When running blender_theme_as_c.py after collection colors were added,
the generated default theme only had one collection color because array
themes are not supported yet.

This hard codes the collection colors into the script just like is done
for bone color sets.

Ref D9154
parent ffc2b092
No related branches found
No related tags found
No related merge requests found
......@@ -160,6 +160,32 @@ TARM_WORKAROUND = '''\t\t{
\t\t},
'''
COLLECTION_COLOR_WORKAROUND = '''\t\t{
\t\t\t.color = RGBA(0xe4312bff),
\t\t},
\t\t{
\t\t\t.color = RGBA(0xef7e42ff),
\t\t},
\t\t{
\t\t\t.color = RGBA(0xe4dd52ff),
\t\t},
\t\t{
\t\t\t.color = RGBA(0x9ac546ff),
\t\t},
\t\t{
\t\t\t.color = RGBA(0x46bcc2ff),
\t\t},
\t\t{
\t\t\t.color = RGBA(0x8b65dcff),
\t\t},
\t\t{
\t\t\t.color = RGBA(0x999999ff),
\t\t},
\t\t{
\t\t\t.color = RGBA(0x06d4432ff),
\t\t},
'''
def round_float_32(f):
from struct import pack, unpack
......@@ -288,6 +314,11 @@ def write_member(fw, indent, b, theme, ls):
fw(TARM_WORKAROUND)
path_old = path_new
continue
if key[0] == b'collection_color':
if path_old[0] != b'collection_color':
fw(COLLECTION_COLOR_WORKAROUND)
path_old = path_new
continue
if not is_ignore_dna_name(key[-1]):
indent = '\t' * (len(path_new) + 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment