diff --git a/openpype/plugins/publish/extract_burnin.py b/openpype/plugins/publish/extract_burnin.py index e266c39714d..7999893feef 100644 --- a/openpype/plugins/publish/extract_burnin.py +++ b/openpype/plugins/publish/extract_burnin.py @@ -114,8 +114,30 @@ def main_process(self, instance): # Prepare burnin options profile_options = copy.deepcopy(self.default_options) for key, value in (self.options or {}).items(): - if value is not None: - profile_options[key] = value + if value is None: + continue + + if key == "bg_color" and len(value) == 4: + bg_red, bg_green, bg_blue, bg_alpha = value + bg_color_hex = "#{0:0>2X}{1:0>2X}{2:0>2X}".format( + bg_red, bg_green, bg_blue + ) + bg_color_alpha = float(bg_alpha) / 255 + profile_options["bg_opacity"] = bg_color_alpha + profile_options["bg_color"] = bg_color_hex + continue + + elif key == "font_color" and len(value) == 4: + fg_red, fg_green, fg_blue, fg_alpha = value + fg_color_hex = "#{0:0>2X}{1:0>2X}{2:0>2X}".format( + fg_red, fg_green, fg_blue + ) + fg_color_alpha = float(fg_alpha) / 255 + profile_options["opacity"] = fg_color_alpha + profile_options["font_color"] = fg_color_hex + continue + + profile_options[key] = value # Prepare global burnin values from presets profile_burnins = {} diff --git a/openpype/settings/defaults/project_settings/global.json b/openpype/settings/defaults/project_settings/global.json index 61db35ba792..712ec22cfcb 100644 --- a/openpype/settings/defaults/project_settings/global.json +++ b/openpype/settings/defaults/project_settings/global.json @@ -73,8 +73,18 @@ "enabled": true, "options": { "font_size": 42, - "opacity": 1.0, - "bg_opacity": 0.5, + "font_color": [ + 255, + 255, + 255, + 255 + ], + "bg_color": [ + 0, + 0, + 0, + 127 + ], "x_offset": 5, "y_offset": 5, "bg_padding": 5 diff --git a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json index 1bd028ac79f..62de3110245 100644 --- a/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json +++ b/openpype/settings/entities/schemas/projects_schema/schemas/schema_global_publish.json @@ -301,20 +301,24 @@ "minimum": 0 }, { - "type": "number", - "key": "opacity", - "label": "Font opacity", - "decimal": 2, - "maximum": 1, - "minimum": 0 + "type": "schema_template", + "name": "template_rgba_color", + "template_data": [ + { + "label": "Font Color", + "name": "font_color" + } + ] }, { - "type": "number", - "key": "bg_opacity", - "label": "Background opacity", - "decimal": 2, - "maximum": 1, - "minimum": 0 + "type": "schema_template", + "name": "template_rgba_color", + "template_data": [ + { + "label": "Background Color", + "name": "bg_color" + } + ] }, { "type": "number",